public class IllegalCallingThreadException
extends java.lang.IllegalStateException
The Scenario Service guarantees that updates from scenarios are processed in order. The service also guarantees that any operation to change the state of running scenarios does not complete until any previous updates have been processed. It does not provide any guarantees of atomicity of operations.
This means that if an operation to change a scenario's state is attempted while in a PropertyChangeListener, the operation should not complete until after the PropertyChangeListener has completed. As this is not possible, the attempted operation will throw this exception instead.
If a scenario requires a change to an input variable because of an output variable, the scenario should do this by using rules in the scenario itself. Any such changes will then happen atomically - this cannot be done atomically using the Scenario Service (and any such input variables should be marked as output variables as well).
Alternatively, another thread should be used to perform the operation - this allows the PropertyChangeListener to complete before the operation. Note that further PropertyChangeListener calls may occur before the operation is complete. A simple implementation may be:
new Thread(new Runnable() { public void run() { instance.setValues(values); } }).start();
setValues
method returns.
Operations that throw this exception:
Constructor and Description |
---|
IllegalCallingThreadException(java.lang.String operation)
See class description.
|
public IllegalCallingThreadException(java.lang.String operation)
Submit a bug or feature
Copyright (c) 2013-2016 Software AG, Darmstadt, Germany and/or Software AG USA Inc., Reston, VA, USA, and/or its subsidiaries and/or its affiliates and/or their licensors. Use, reproduction, transfer, publication or disclosure is prohibited except as specifically provided for in your License Agreement with Software AG.