Class ConnectorManager

java.lang.Object
io.allune.quickfixj.spring.boot.starter.connection.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

    Modifier and Type
    Method
    Description
    int
    Return the phase in which this connector manager will be started and stopped.
    boolean
    Return the value for the 'autoStartup' property.
    boolean
    Return whether sessions should be disconnected forcibly
    boolean
    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 the connector, accepting new connections
    void
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • ConnectorManager

      public ConnectorManager(quickfix.Connector connector)
  • Method Details

    • 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: