FIXStandaloneApplication

FIXStandaloneApplication is very easy to program. In this chapter will will demonstrate step by step how to write a standalone QWFIX application.

 

Initialization

At the begining of your program you may need to initialize the memory size of FIX message cache.

Read FIXEngine.initMessageCache() to learn how to initialize the message cache size.

 

Create a Standalone FIX Application

Only three steps and less than a dozen lines of code is needed to create a QWFIX enabled application.

  1. Create a new instance of FIXStandaloneApplication.
  2. Register event listeners on the FIXStandaloneApplication instance.
  3. Start the application process by calling FIXStandaloneApplication.run().

For more information, please read the code snpppet "Initialize QWFIX Enabled Application".

 

FIXStandaloneApplication Events

The step 2 of the three steps above is very important. Application is required to implement and register a minimum set of event handlers.

FIXStandaloneApplication only triggers events after FIXStandaloneApplication.run() is called (step 3).

FIXStandaloneApplicationListener interface defines the event handlers of FIXStandaloneApplication. Event listeners can be added or removed by calling FIXStandaloneApplication.addListener() or FIXStandaloneApplication.removeListener() methods.

FIXSessionStatusListener interface defines the event handlers of FIXSession. Event listeners can be added or removed by calling FIXSession.addSessionStatusListener() or FIXSession.removeSessionStatusListener() methods.

Below is a complete list of all possible events that may be triggered by FIXStandaloneApplication.

 FIXStandaloneApplicationListener.engineInitialized should always be implemented in any application.

 

FIXStandaloneApplication Error Handling

If any irrecoverable fatal error occurs during initialization process, such as Repository Server error (cannot load settings), settings error or fatal application error (e.g. message handler is not set on a session), FIXStandaloneApplicationListener.fatalErrorOccurs event will be triggered.