Class FIXSessionFactory


  • public class FIXSessionFactory
    extends Object
    The FIXSessionFactory is responsible for creating and managing FIX sessions. A FIX session can be initiated in one of two modes, namely the acceptor mode and the initiator mode. FIX sessions requested by the transport listener at service deployment are created in acceptor mode. When the transport sender is about to send a FIX message it will check whether a valid FIX session exists. If not it will request the FIXSessionFactory to create a new session in the initiator mode.

    To create a new FIX session (in either mode) the FIXSessionFactory has to create a LogFactory (nullable), and a MessageStoreFactroy. By default this implementation attempts to pass null as the LogFactory and a MemoryStoreFactory as the MessageStoreFactory. These can be configured in the services.xml as follows.

    file (acceptable values: console, file, jdbc)

    file (acceptable values: file, jdbc, memory, sleepycat)

    The configuraion details related to these factories has to be specified in the FIX configuration file as requested by the Quickfix/J API.

    • Method Detail

      • createFIXAcceptor

        public boolean createFIXAcceptor​(org.apache.axis2.description.AxisService service)
                                  throws org.apache.axis2.AxisFault
        Get the FIX configuration settings and initialize a new FIX session for the specified service. Create an Acceptor and a new FIX Application. Put the Acceptor into the acceptorStore keyed by the service name and start it.
        Parameters:
        service - the AxisService
        Returns:
        true if the acceptor is successfully initialized and false otherwise
        Throws:
        org.apache.axis2.AxisFault - if the acceptor cannot be created
      • createFIXInitiator

        public void createFIXInitiator​(String fixEPR,
                                       org.apache.axis2.description.AxisService service,
                                       quickfix.SessionID sessionID)
                                throws org.apache.axis2.AxisFault
        Extract the parameters embedded in the given EPR and initialize a new FIX session. Create a new FIX initiator and a new FIX Application.Put the initiator into the initiatorStore keyed by the EPR and start the initiator.
        Parameters:
        fixEPR - the EPR to send FIX messages
        service - the AxisService
        sessionID - the SessionID of the session created
        Throws:
        org.apache.axis2.AxisFault - Exception thrown
      • createFIXInitiator

        public boolean createFIXInitiator​(org.apache.axis2.description.AxisService service)
                                   throws org.apache.axis2.AxisFault
        Throws:
        org.apache.axis2.AxisFault
      • disposeFIXAcceptor

        public void disposeFIXAcceptor​(org.apache.axis2.description.AxisService service)
        Get the FIX Acceptor for the specified service from the sessionStore Map and stop it. Then remove the Acceptor from the Map.
        Parameters:
        service - the AxisService
      • disposeFIXInitiators

        public void disposeFIXInitiators()
        Stops all the FIX initiators created so far and cleans up all the mappings related to them
      • getServiceEPRs

        public String[] getServiceEPRs​(String serviceName,
                                       String ip)
        Returns an array of Strings representing EPRs for the specified service
        Parameters:
        serviceName - the name of the service
        ip - the IP address of the host
        Returns:
        an array of EPRs for the specified service
      • getAcceptor

        public quickfix.Acceptor getAcceptor​(String serviceName)
        Finds a FIX Acceptor for the specified service from the acceptorStore
        Parameters:
        serviceName - the name of the AxisService
        Returns:
        a FIX Acceptor for the service
      • getInitiator

        public quickfix.Initiator getInitiator​(String fixEPR)
        Finds a FIX initiator for the specified EPR from the initiatorStore
        Parameters:
        fixEPR - a valid FIX EPR
        Returns:
        a FIX initiator for the EPR
      • getApplication

        public quickfix.Application getApplication​(String fixEPR)
      • setListenerThreadPool

        public void setListenerThreadPool​(org.apache.axis2.transport.base.threads.WorkerPool listenerThreadPool)
      • setSenderThreadPool

        public void setSenderThreadPool​(org.apache.axis2.transport.base.threads.WorkerPool senderThreadPool)