|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.wrq.vhi.script.api.LifeCycleEventHandler
public abstract class LifeCycleEventHandler
Abstract base class for a lifecycle event handler. All classes that extend this class appear as lifecycle event handlers in the VHI design tool.
Except for the authenticate client event, the lifecycle events correspond
to the build up and tear down of objects within VHI. Their primary purpose is
to allow for the initialization and cleanup of the model and client shared
state. None of the events have access to the terminal screen. If
initialization or cleanup of the terminal is needed, see
ModelEventHandler
.
The order in which these events fire on build up is as follows:
The order in which these events fire on tear down is as follows:
Field Summary |
---|
Fields inherited from interface com.wrq.vhi.script.api.EventHandler |
---|
DEFAULT_TIMEOUT |
Constructor Summary | |
---|---|
LifeCycleEventHandler()
|
Method Summary | |
---|---|
boolean |
authenticateUser(AuthenticateUserEvent event)
Called to authenticate a client connecting to the VHI server. |
void |
clientSessionCreated(ClientSessionCreatedEvent event)
Called when a client session is created. |
void |
clientSessionDestroyed(ClientSessionDestroyedEvent event)
Called when a client session is destroyed. |
void |
hostSessionCreated(HostSessionCreatedEvent event)
Called when a host session is created. |
void |
hostSessionDestroyed(HostSessionDestroyedEvent event)
Called when a host session is destroyed. |
void |
modelLoaded(ModelLoadedEvent event)
Called when a model is loaded. |
void |
modelUnloaded(ModelUnloadedEvent event)
Called when a model is unloaded. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LifeCycleEventHandler()
Method Detail |
---|
public void modelLoaded(ModelLoadedEvent event) throws ApptrieveException
This event will fire once per version of a model before any associated host sessions are created. It is the first opportunity to initialize the model shared state.
If an exception is thrown from this event the VHI server will log the error and fail to load the model. This means that clients will be unable to connect to the model or any session pools based on the model. The design tool will simply report the exception and move on.
event
- the event instance
ApptrieveException
public void modelUnloaded(ModelUnloadedEvent event) throws ApptrieveException
This event will fire once per version of a model only after all associated host sessions have been destroyed. It is the last opportunity to do any cleanup of the model shared state.
If an exception is thrown from this event the VHI server will log the error and move on. The design tool will report the exception and move on.
event
- the event instance
ApptrieveException
public void hostSessionCreated(HostSessionCreatedEvent event) throws ApptrieveException
This event is the first opportunity to initialize the model shared state with any host session specific information. The host session ID can be used to construct a unique key for storing such information.
This event does not have access to the host session's terminal. If
initialization of the terminal is needed, see
ModelEventHandler.executeLogin(com.wrq.vhi.script.api.ExecuteLoginEvent)
.
If an exception is thrown from this event the VHI server will log the error and fail the host session creation. If the host session is being created in response to a connectToModel() request, the connection will fail. The design tool will simply report the exception and move on.
event
- the event instance
ApptrieveException
public void hostSessionDestroyed(HostSessionDestroyedEvent event) throws ApptrieveException
This event is the last opportunity to do any cleanup of host session specific information stored in the model shared state.
This event does not have access to the host session's terminal. If
cleanup of the terminal is needed, see
ModelEventHandler.executeLogout(com.wrq.vhi.script.api.ExecuteLogoutEvent)
.
If an exception is thrown from this event the VHI server will log the error and move on. The design tool will report the exception and move on.
event
- the event instance
ApptrieveException
public boolean authenticateUser(AuthenticateUserEvent event) throws ApptrieveException
The VHI server will reject the client's connection request if false is returned or an exception is thrown. The design tool will simply report the rejection or exception.
event
- the event instance
ApptrieveException
public void clientSessionCreated(ClientSessionCreatedEvent event) throws ApptrieveException
ModelEventHandler.clientConnected(com.wrq.vhi.script.api.ClientConnectedEvent)
event.
This event is the first opportunity to initialize the client session shared state.
If an exception is thrown from this event the VHI server will log the error and fail the client connection. The design tool will simply report the exception and move on.
event
- the event instance
ApptrieveException
public void clientSessionDestroyed(ClientSessionDestroyedEvent event) throws ApptrieveException
ModelEventHandler.clientDisconnected(com.wrq.vhi.script.api.ClientDisconnectedEvent)
event.
This event is the last opportunity to do any needed cleanup of the client session shared state.
If an exception is thrown from this event the VHI server will log the error and move on. The design tool will report the exception and move on.
event
- the event instance
ApptrieveException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |