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, transportFields 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 TypeMethodDescriptionvoidconnect()Connects to remote counterparty, if initiator or accepts incoming connection if acceptor.protected voidvoiddisconnect(String reason) Disconnect the session.voiddispose()Disposes current session, removes its reference from GlobalSessionManager and frees all allocated resources.protected FIXTransportgetTransport(SessionParameters sessionParameters, String host, int port) Gets transport.voidinit()Initialize FIX session.protected voidvoidUnsupported for InitiatorFIXSession.voidsetSessionState(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, unlockSendingMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods 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:FIXSessionInitialize FIX session. This allows to put messages to session. These messages will be send after connect.- Specified by:
initin interfaceFIXSession- Overrides:
initin classAbstractFIXSession- Throws:
IOException- I/O exception if error occurred
-
connect
Description copied from interface:FIXSessionConnects to remote counterparty, if initiator or accepts incoming connection if acceptor.- Specified by:
connectin interfaceFIXSession- Specified by:
connectin classAbstractFIXSession- Throws:
IOException- I/O exception if error occurred- See Also:
-
setSessionState
Description copied from interface:ExtendedFIXSessionSets session state.- Specified by:
setSessionStatein interfaceExtendedFIXSession- Overrides:
setSessionStatein classAbstractFIXSession- Parameters:
sessionState- the new session state- See Also:
-
reject
Unsupported for InitiatorFIXSession. Always throws IllegalStateException.- Specified by:
rejectin interfaceFIXSession- Specified by:
rejectin classAbstractFIXSession- Throws:
IllegalStateExceptionIOException- I/O exception if error occurred- See Also:
-
connectInternal
- Throws:
IOException
-
initTransport
protected void initTransport() -
disconnect
Description copied from class:AbstractFIXSessionDisconnect the session.The method sends the logof message, if response is not received during the HBI, shutdown the session.
- Specified by:
disconnectin interfaceFIXSession- Overrides:
disconnectin 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:FIXSessionDisposes 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:
disposein interfaceFIXSession- Overrides:
disposein classAbstractFIXSession- See Also:
-