public interface RuntimeEnvironment
| Modifier and Type | Method and Description |
|---|---|
void |
applicationClosed()
Called by the application to tell the runtime manager about its successful
termination.
|
void |
applicationReset()
Notifies the runtime manager that the application has been terminated and wants to be reset
that is activated again and the current and previous executions have to be completely dropped.
|
void |
applicationResetTo(java.lang.String savepoint)
Notifies the runtime manager that the application has been terminated and wants to be reset to
the designated savepoint.
|
void |
applicationResetToPreviousSavepoint()
Notifies the runtime manager that the application has been terminated and wants to be reset to
the last savepoint before this application started.
|
void |
applicationSignalled(int signal)
Enables the application to signal a special event to the runtime
manager.
|
void |
applicationSuspended()
Tells the runtime manager about the application's suspension.
|
void |
applicationSuspended(long timeout)
Notifies the runtime manager that the application has been suspended and
wants to be resumed after the designated time.
|
boolean |
dispatch()
Analyses the messages sent by the runtime manager and call the appropriate
methods specified in the ExecutableComponent interface.
|
byte[] |
getApplicationState(java.lang.String savepoint)
Returns a byte array in which all the application state relevant information is stored or null
in case the application has stored null or an empty array as state.
|
DriverManager |
getDriverManager()
Gets a reference to a
DriverManager encapsulating the normal
JDBC-driver manager. |
java.lang.String |
getLastSavepoint()
Returns the ID of the last savepoint the application can restart at.
|
ActivityInstance |
getLocalisedActivityInstance()
Gets the activity instance localised with respect to the rich agent.
|
java.util.logging.Logger |
getLogger()
Gets the logger which should be used for all log messages of the
ExecutableComponent.
|
void |
setApplicationState(byte[] applicationState)
Enables the application to store its internal state to the system.
|
void |
setSavepoint(java.lang.String savepoint,
boolean flush)
Assigns the designated savepoint to the current state of the data, that is
application state and data context.
|
java.util.logging.Logger getLogger()
DriverManager getDriverManager()
DriverManager encapsulating the normal
JDBC-driver manager. This is needed to
circumvent the memory leak in the driver manager which stores each calling
class including the classloader forever. JDBC-driver manager. Always use the
one returned by this method!ActivityInstance getLocalisedActivityInstance()
boolean dispatch()
InvalidExecutorThreadException will be thrown if the method
is not called by the main thread of the corresponding component.byte[] getApplicationState(java.lang.String savepoint)
InvalidExecutorThreadException will be thrown if the method is not called by
the main thread of the corresponding component.
Use de.aristaflow.adept2.model.globals.CommonConstants#VIEW_ONLY_SAVEPOINT to store
additional data required for view-only execution that is not part of the process context.
savepoint - Identifies the requested session state. Use null to get the
current session state that has no savepoint yet.null if no savepoint exists for the
designated ID.java.lang.String getLastSavepoint()
ExecutableComponent.initResume(String, SessionContext). This will
allow to resume the application with an earlier savepoint if the user wants
it. InvalidExecutorThreadException will be thrown if the method
is not called by the main thread of the corresponding component.null will be returned.void setApplicationState(byte[] applicationState)
InvalidExecutorThreadException will be thrown if the method
is not called by the main thread of the corresponding component.
The latest application state that is stored when terminating will be provided for a view-only execution.
applicationState - Byte array that keeps the current internal state of
the application.void setSavepoint(java.lang.String savepoint,
boolean flush)
InvalidExecutorThreadException will be thrown if the method
is not called by the main thread of the corresponding component.savepoint - The identifier by which the current data state could be
retrieved. This must neither be null nor the empty
string.flush - Whether to flush all data since the last savepoint and store
it in the data manager.void applicationSuspended()
InvalidExecutorThreadException will be thrown if the
method is not called by the main thread of the corresponding component.void applicationSuspended(long timeout)
InvalidExecutorThreadException will be thrown if the method
is not called by the main thread of the corresponding component.timeout - The time period (in milliseconds) when the suspended
application wants to be resumed automatically.void applicationReset()
InvalidExecutorThreadException will be thrown if the method is not called by
the main thread of the corresponding component.void applicationResetTo(java.lang.String savepoint)
InvalidExecutorThreadException will be thrown if the method is not called by
the main thread of the corresponding component.savepoint - The savepoint to which to reset the execution. This should be a previous
savepoint. If this is null the last implicit savepoint will be used. If
the savepoint does not exist, the execution will be reset
completely.void applicationResetToPreviousSavepoint()
InvalidExecutorThreadException will be thrown if the method is not called by
the main thread of the corresponding component.void applicationClosed()
InvalidExecutorThreadException will be thrown if the method
is not called by the main thread of the corresponding component. This also
checks for whether all mandatory output parameters have been written. If
not, an ApplicationFailedException will be thrown.ApplicationFailedException - If not all mandatory output parameters
have been written, an ApplicationFailedException
will be thrown.void applicationSignalled(int signal)
InvalidExecutorThreadException will be thrown if the
method is not called by the main thread of the corresponding component.signal - ID that specifies the type of the signalled event