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
-
-
Constructor Summary
Constructors Constructor Description ConnectorManager(quickfix.Connector connector)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetPhase()Return the phase in which this connector manager will be started and stopped.booleanisAutoStartup()Return the value for the 'autoStartup' property.booleanisForceDisconnect()Return whether sessions should be disconnected forciblybooleanisRunning()Determine 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(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.
-
-
-
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:
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
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:
stopin interfaceorg.springframework.context.SmartLifecycle
-
-