Class ConnectorManager

  • All Implemented Interfaces:
    org.springframework.context.Lifecycle, org.springframework.context.Phased, org.springframework.context.SmartLifecycle

    public class ConnectorManager
    extends Object
    implements org.springframework.context.SmartLifecycle
    Connection manager for a connector. The connection is initialised when the application context is created and closed (including logging out all active sessions) when the application context is closed
    Author:
    Eduardo Sanchez-Ros
    • Field Summary

      • Fields inherited from interface org.springframework.context.SmartLifecycle

        DEFAULT_PHASE
    • Constructor Summary

      Constructors 
      Constructor Description
      ConnectorManager​(quickfix.Connector connector)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int getPhase()
      Return the phase in which this connector manager will be started and stopped.
      boolean isAutoStartup()
      Return the value for the 'autoStartup' property.
      boolean isForceDisconnect()
      Return whether sessions should be disconnected forcibly
      boolean isRunning()
      Determine whether this connector is currently running, that is, whether it has been started and not stopped yet.
      void setAutoStartup​(boolean autoStartup)
      Set whether to auto-connect to the remote endpoint after this connector manager has been initialized and the Spring context has been refreshed.
      void setForceDisconnect​(boolean forceDisconnect)
      Specify whether to wait for sessions to logout before disconnect.
      void setPhase​(int phase)
      Specify the phase in which this connection manager should be started and stopped.
      void start()
      Start the connector, accepting new connections
      void stop()
      Stop this connector, logging out existing sessions, closing their connections, and stopping to accept new connections.
      void stop​(Runnable callback)
      Stop this connector, invoking the specific callback once all the sessions have been logged out, all connections closed and it has stopped accepting new connections.
    • Constructor Detail

      • ConnectorManager

        public ConnectorManager​(quickfix.Connector connector)
    • Method Detail

      • setAutoStartup

        public void setAutoStartup​(boolean autoStartup)
        Set whether to auto-connect to the remote endpoint after this connector manager has been initialized and the Spring context has been refreshed.

        Default is "true".

        Parameters:
        autoStartup - Whether the connector should be automatically started
      • isAutoStartup

        public boolean isAutoStartup()
        Return the value for the 'autoStartup' property.
        Specified by:
        isAutoStartup in interface org.springframework.context.SmartLifecycle
      • setPhase

        public void setPhase​(int phase)
        Specify the phase in which this connection manager should be started and stopped.
        Parameters:
        phase - The phase number
      • getPhase

        public int getPhase()
        Return the phase in which this connector manager will be started and stopped.
        Specified by:
        getPhase in interface org.springframework.context.Phased
        Specified by:
        getPhase in interface org.springframework.context.SmartLifecycle
      • setForceDisconnect

        public void setForceDisconnect​(boolean forceDisconnect)
        Specify whether to wait for sessions to logout before disconnect.
        Parameters:
        forceDisconnect - don't wait for logout before disconnect.
      • isForceDisconnect

        public boolean isForceDisconnect()
        Return whether sessions should be disconnected forcibly
      • start

        public void start()
        Start the connector, accepting new connections
        Specified by:
        start in interface org.springframework.context.Lifecycle
      • stop

        public void stop()
        Stop this connector, logging out existing sessions, closing their connections, and stopping to accept new connections.
        Specified by:
        stop in interface org.springframework.context.Lifecycle
      • stop

        public void stop​(Runnable callback)
        Stop this connector, invoking the specific callback once all the sessions have been logged out, all connections closed and it has stopped accepting new connections.
        Specified by:
        stop in interface org.springframework.context.SmartLifecycle
      • isRunning

        public boolean isRunning()
        Determine whether this connector is currently running, that is, whether it has been started and not stopped yet.
        Specified by:
        isRunning in interface org.springframework.context.Lifecycle
        See Also:
        start(), stop()