|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.lang.Throwable java.lang.Exception java.lang.RuntimeException java.lang.IllegalStateException com.apama.services.scenario.IllegalCallingThreadException
public class IllegalCallingThreadException
Thrown when an attempt is made to change the state of running scenarios in the data queue processing thread.
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 Summary | |
---|---|
IllegalCallingThreadException(java.lang.String operation)
See class description. |
Method Summary |
---|
Methods inherited from class java.lang.Throwable |
---|
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public IllegalCallingThreadException(java.lang.String operation)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |