Package com.epam.fixengine.session
Class InitiatorFIXSession
java.lang.Object
com.epam.fixengine.session.AbstractFIXSession
com.epam.fixengine.session.InitiatorFIXSession
- All Implemented Interfaces:
FIXSession
,ExtendedFIXSession
,com.epam.fixengine.session.SessionStateListenSupport
- Direct Known Subclasses:
AutoreconnectFIXSession
-
Nested Class Summary
Nested classes/interfaces inherited from class com.epam.fixengine.session.AbstractFIXSession
AbstractFIXSession.ConsumingControlTransportWrapper
-
Field Summary
Fields inherited from class com.epam.fixengine.session.AbstractFIXSession
configuration, graceful, listener, messageFactory, preferredSendingMode, queue, runtimeState, sentTRNum, sequenceManager, sessionLock, sessionParameters, testRequestTime, transport
Fields inherited from interface com.epam.fixengine.FIXSession
DEFAULT_SENDING_OPTIONS, SEND_ASYNC, SEND_SYNC
-
Constructor Summary
ConstructorsConstructorDescriptionInitiatorFIXSession
(FIXMessageFactory factory, SessionParameters sessionParameters, HandlerChain fixSessionListener) Creates theInitiatorFIXSession
. -
Method Summary
Modifier and TypeMethodDescriptionvoid
connect()
Connects to remote counterparty, if initiator or accepts incoming connection if acceptor.protected void
void
disconnect
(String reason) Disconnect the session.void
dispose()
Disposes current session, removes its reference from GlobalSessionManager and frees all allocated resources.protected FIXTransport
getTransport
(SessionParameters sessionParameters, String host, int port) Gets transport.void
init()
Initialize FIX session.protected void
void
Unsupported for InitiatorFIXSession.void
setSessionState
(SessionState sessionState) Sets session state.Methods inherited from class com.epam.fixengine.session.AbstractFIXSession
addInSessionLevelMessageListener, addOutSessionLevelMessageListener, addSessionStateListener, addUserGlobalMessageHandler, backupStorages, checkHasSessionSendOrReceivedTestRequest, checkSessionInactiveAndSendHbt, clearQueue, disconnect, disconnect, disconnect, disconnect, disconnectTestRequestIsLost, equals, forcedDisconnect, getAttribute, getAttribute, getAttributeAsBool, getAttributeAsLong, getBytesRead, getBytesSent, getConfiguration, getEncryption, getErrorHandler, getEstablished, getExtendedFIXSessionListener, getFIXSessionOutOfSyncListener, getIncomingMessageStorage, getInSeqNum, getLastDisconnectReason, getLastInMessageTimestamp, getLastOutMessageTimestamp, getMessageFactory, getMessageHandlers, getMessageQueue, getMessageValidator, getMessageValidator, getMessageValidator, getNoOfInMessages, getNoOfOutMessages, getOutgoingMessageStorage, getOutSeqNum, getQueuedMessagesCount, getRejectMessageListener, getRuntimeState, getSequenceManager, getSessionParameters, getSessionParametersInstance, getSessionState, getSlowConsumerListener, getStorageFactory, hashCode, initSessionInternal, initSessionRuntimeState, isHbtControlInPumper, isResetSeqNumFlagRequiredForInitLogon, isStatisticEnabled, lockSending, markShutdownAsGraceful, onDisconnect, prepareForConnect, prepareMessage, prepareMessage, prepareMessage, prepareMessageFromString, prepareMessageFromString, reinit, removeAttribute, removeAttribute, removeLongAttribute, removeSessionStateListener, resetInitialization, resetSequenceNumbers, resetSequenceNumbers, resetTestRequestFlags, restoreSessionAfterReceivedTestRequest, saveSessionParameters, sendAsIs, sendAsIs, sendMessage, sendMessage, sendMessage, sendMessage, sendMessageAndGetQueueSize, sendMessageAndGetQueueSize, sendMessageOutOfTurn, sendTestRequest, sendWithChanges, sendWithChanges, sendWithChangesAndGetQueueSize, sendWithChangesAndGetQueueSize, setAttribute, setAttribute, setAttribute, setAttribute, setErrorHandler, setFIXSessionListener, setFIXSessionOutOfSyncListener, setInSeqNum, setLastDisconnectReason, setOutOfTurnMode, setOutSeqNum, setPreLogoffSessionState, setRejectMessageListener, setSequenceNumbers, setSlowConsumerListener, shutdown, shutdown, startSession, subscribeForAttributeChanges, toString, unlockSending
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface com.epam.fixengine.session.ExtendedFIXSession
getAndRemoveAttribute
-
Constructor Details
-
InitiatorFIXSession
public InitiatorFIXSession(FIXMessageFactory factory, SessionParameters sessionParameters, HandlerChain fixSessionListener) Creates theInitiatorFIXSession
.
-
-
Method Details
-
getTransport
Gets transport.- Parameters:
sessionParameters
- the session parametershost
- the hostport
- the port
-
init
Description copied from interface:FIXSession
Initialize FIX session. This allows to put messages to session. These messages will be send after connect.- Specified by:
init
in interfaceFIXSession
- Overrides:
init
in classAbstractFIXSession
- Throws:
IOException
- I/O exception if error occurred
-
connect
Description copied from interface:FIXSession
Connects to remote counterparty, if initiator or accepts incoming connection if acceptor.- Specified by:
connect
in interfaceFIXSession
- Specified by:
connect
in classAbstractFIXSession
- Throws:
IOException
- I/O exception if error occurred- See Also:
-
setSessionState
Description copied from interface:ExtendedFIXSession
Sets session state.- Specified by:
setSessionState
in interfaceExtendedFIXSession
- Overrides:
setSessionState
in classAbstractFIXSession
- Parameters:
sessionState
- the new session state- See Also:
-
reject
Unsupported for InitiatorFIXSession. Always throws IllegalStateException.- Specified by:
reject
in interfaceFIXSession
- Specified by:
reject
in classAbstractFIXSession
- Throws:
IllegalStateException
IOException
- I/O exception if error occurred- See Also:
-
connectInternal
- Throws:
IOException
-
initTransport
protected void initTransport() -
disconnect
Description copied from class:AbstractFIXSession
Disconnect the session.The method sends the logof message, if response is not received during the HBI, shutdown the session.
- Specified by:
disconnect
in interfaceFIXSession
- Overrides:
disconnect
in classAbstractFIXSession
- Parameters:
reason
- the reason, if parameter is not null, the logof message will be send with 58=reason.- See Also:
-
dispose
public void dispose()Description copied from interface:FIXSession
Disposes current session, removes its reference from GlobalSessionManager and frees all allocated resources. Normally should be called after disconnect(). However it is possible to call this method for active session without previous disconnect() that will abnormally terminate fix session by closing fix connection (without logon exchange). This is useful to terminate stuck sessions if standard FIX logoff procedure doesn't work.- Specified by:
dispose
in interfaceFIXSession
- Overrides:
dispose
in classAbstractFIXSession
- See Also:
-