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
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 -
Method Summary
Modifier and TypeMethodDescriptionintgetPhase()Return the phase in which this connector manager will be started and stopped.booleanReturn the value for the 'autoStartup' property.booleanReturn whether sessions should be disconnected forciblybooleanDetermine whether this connector is currently running, that is, whether it has been started and not stopped yet.voidsetAutoStartup(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.voidsetForceDisconnect(boolean forceDisconnect) Specify whether to wait for sessions to logout before disconnect.voidsetPhase(int phase) Specify the phase in which this connection manager should be started and stopped.voidstart()Start the connector, accepting new connectionsvoidstop()Stop this connector, logging out existing sessions, closing their connections, and stopping to accept new connections.voidStop 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 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:
isAutoStartupin interfaceorg.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:
getPhasein interfaceorg.springframework.context.Phased- Specified by:
getPhasein interfaceorg.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:
startin interfaceorg.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:
stopin interfaceorg.springframework.context.Lifecycle
-
stop
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:
stopin interfaceorg.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.
-