com.teraspaces.qwfix
Interface FIXStandaloneApplicationListener


public interface FIXStandaloneApplicationListener

The listener interface for receiving FIXStandaloneApplication events. The class that is interested in processing a FIXStandaloneApplication event implements this interface, and the object created with that class is registered with a component using the component's addListener method. When the FIXStandaloneApplication event occurs, that object's appropriate method is invoked.

The FIX engine recovery process will start after this event handler finishes. The recovery process will "replay" all historical FIX messages in the same order they are processed before.

The following is a typical example of sequence of events being triggered.

engineInitialized(FIXEngine)

engineRecovered(FIXEngine)

FIXSessionStatusListener.sessionStarting() and FIXSessionStatusListener.sessionStarted()

engineStarted(FIXEngine)

FIXSessionStatusListener.sessionStarting() and FIXSessionStatusListener.sessionStarted() on some sessions

FIXSessionStatusListener.sessionResetting() and FIXSessionStatusListener.sessionReseted() on some sessions

engineStopping(FIXEngine)

FIXSessionStatusListener.sessionStopping() and FIXSessionStatusListener.sessionStopped() on each session

engineStopped(FIXEngine)

See Also:
FIXStandaloneApplication

Method Summary
 void engineInitialized(FIXEngine engine)
          Occurs when the FIX engine has been initialized.
 void engineRecovered(FIXEngine engine)
          Occurs when the FIX engine has finished the recovery process.
 void engineStarted(FIXEngine engine)
          Occurs when the FIX engine has started.
 void engineStopped(FIXEngine engine)
          Occurs when FIX engine is stopped.
 void engineStopping(FIXEngine engine)
          Occurs when FIX engine is stopping.
 void fatalErrorOccurs(Exception e)
          Occurs when a fatal error occurs during FIX engine initialization process.
 

Method Detail

engineInitialized

void engineInitialized(FIXEngine engine)
Occurs when the FIX engine has been initialized.

Sessions can be retrieved from the engine at this time. Application should set the event handlers of each FIXSession in this event handler.

Additional FIXEngineMessageHandler can be set by calling FIXEngine.setEngineMessageHandler(FIXSession, FIXEngineMessageHandler, String...).

A FIXSession defined in a FIXEngine may have a different scheduler than that of FIXEngine. A FIXSession may not be started when FIXEngine is started because the scheduler of the session may have not been "kicked up" yet. It is recommended that application hook up the engineStarted(com.teraspaces.qwfix.FIXEngine) event and the FIXSessionStatusListener.sessionStarted() of every FIXSession and start the business logic after all required FIXSession has been started. SessionStarted has nothing to do with the status underlying TCP communication channel. It is controlled by the Scheduler only. Event if the underlying TCP channel is down, the session will still be started on time, and application can still send messages to the session by calling sendMessage(). The messages will be queued and later sent to the recipient when the TCP channel is up.

Parameters:
engine - the engine

engineRecovered

void engineRecovered(FIXEngine engine)
Occurs when the FIX engine has finished the recovery process.

By hooking up this event handler, application will have an opportunity to further recover information that can not be inferred from the FIX communication alone.

Application still can not send any FIX message at this stage because the no session has been started yet. For more details see note blow.

A FIXSession defined in a FIXEngine may have a different scheduler than that of FIXEngine. A FIXSession may not be started when FIXEngine is started because the scheduler of the session may have not been "kicked up" yet. It is recommended that application hook up the engineStarted(com.teraspaces.qwfix.FIXEngine) event and the FIXSessionStatusListener.sessionStarted() of every FIXSession and start the business logic after all required FIXSession has been started. SessionStarted has nothing to do with the status underlying TCP communication channel. It is controlled by the Scheduler only. Event if the underlying TCP channel is down, the session will still be started on time, and application can still send messages to the session by calling sendMessage(). The messages will be queued and later sent to the recipient when the TCP channel is up.

Parameters:
engine - the engine

engineStarted

void engineStarted(FIXEngine engine)
Occurs when the FIX engine has started.

Some FIXSession defined in the FIXEngine may have not been started because they may have different schedulers. For more details see the note below.

A FIXSession defined in a FIXEngine may have a different scheduler than that of FIXEngine. A FIXSession may not be started when FIXEngine is started because the scheduler of the session may have not been "kicked up" yet. It is recommended that application hook up the engineStarted(com.teraspaces.qwfix.FIXEngine) event and the FIXSessionStatusListener.sessionStarted() of every FIXSession and start the business logic after all required FIXSession has been started. SessionStarted has nothing to do with the status underlying TCP communication channel. It is controlled by the Scheduler only. Event if the underlying TCP channel is down, the session will still be started on time, and application can still send messages to the session by calling sendMessage(). The messages will be queued and later sent to the recipient when the TCP channel is up.

Parameters:
engine - the engine

engineStopping

void engineStopping(FIXEngine engine)
Occurs when FIX engine is stopping.

The FIX sessions have not been stopped until FIXEngineStopped is fired.

This event may be triggered when the scheduler of the FIX engine expires; or FIXStandaloneApplication.exit() is called.

Parameters:
engine - the engine

engineStopped

void engineStopped(FIXEngine engine)
Occurs when FIX engine is stopped.

This event may be triggered when the scheduler of the FIX engine expires; or FIXStandaloneApplication.exit() is called.

After this event handler finishes, the process is ready to be shut down. Remember FIXStandaloneApplication.exit() still needs to be called before terminating the process.

Parameters:
engine - the engine

fatalErrorOccurs

void fatalErrorOccurs(Exception e)
Occurs when a fatal error occurs during FIX engine initialization process.

This event is triggered when an irrecoverable error occurs during initialization process. Some examples of fatal errors are: Repository Server is down or password is not correct, Settings are invalid, etc.

The process will not automatically exit after this event is triggered.

Parameters:
e - the exception