com.epam.fixengine.session
Class InitiatorFIXSession

java.lang.Object
  extended by com.epam.fixengine.session.AbstractFIXSession
      extended by com.epam.fixengine.session.InitiatorFIXSession
All Implemented Interfaces:
FIXSession, ExtendedFIXSession, com.epam.fixengine.session.SessionStateListenSupport
Direct Known Subclasses:
BackupFIXSession

public class InitiatorFIXSession
extends AbstractFIXSession


Nested Class Summary
 
Nested classes/interfaces inherited from class com.epam.fixengine.session.AbstractFIXSession
AbstractFIXSession.SessionParametersProxyAdaptorListener
 
Field Summary
 
Fields inherited from class com.epam.fixengine.session.AbstractFIXSession
configuration, DEBUG_ENABLED, graceful, listener, log, messageFactory, queue, sessionLock, sessionParameters, TRACE_ENABLED, transport
 
Fields inherited from interface com.epam.fixengine.FIXSession
DEFAULT_SENDING_OPTIONS, SEND_ASYNC, SEND_SYNC
 
Constructor Summary
InitiatorFIXSession(FIXMessageFactory factory, SessionParameters sessionParameters, HandlerChain fixSessionListener)
          Creates the InitiatorFIXSession.
 
Method Summary
 void connect()
          Connects to remote counterparty,
if initiator or accepts incoming connection if acceptor.
protected  void connectInternal()
           
 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 reject(String reason)
          Unsupported for InitiatorFIXSession.
 void setSessionState(SessionState sessionState)
          Sets session state.
 
Methods inherited from class com.epam.fixengine.session.AbstractFIXSession
addSessionStateListener, checkHasSessionSendOrReceivedTestRequest, clearQueue, configureStateBeforeReset, disconnect, disconnect, disconnect, disconnectTestRequestIsLost, equals, forcedDisconnect, getAttribute, getAttributeAsBool, getAttributeAsLong, getBytesRead, getBytesSent, getEncryption, getErrorHandler, getEstablished, getExtendedFIXSessionListener, getIncomingMessageStorage, getLastDisconnectReason, getLastInMessageTimestamp, getLastOutMessageTimestamp, getMessageFactory, getMessageHandlers, getMessageValidator, getNoOfInMessages, getNoOfOutMessages, getOutgoingMessageStorage, getQueuedMessagesCount, getRejectMessageListener, getSequenceManager, getSessionParameters, getSessionParametersInstance, getSessionState, getStorageFactory, hashCode, initSession, initSessionInternal, isResetSeqNumFlagRequiredForInitLogon, isResetTimeMissed, isStatisticEnabled, loadSessionParametersFromFile, markShutdownAsGraceful, prepareMessage, prepareMessage, prepareMessage, prepareMessageFromString, prepareMessageFromString, removeAttribute, removeAttribute, removeLongAttribute, removeSessionStateListener, resetSeqNumIfConfigured, resetSequenceNumbers, resetSequenceNumbers, resetTestRequestFlags, restoreSessionAfterReceivedTestRequest, restoreSessionParameters, saveSessionParameters, sendAsIs, sendAsIs, sendMessage, sendMessage, sendMessage, sendMessage, sendMessageAndGetQueueSize, sendMessageAndGetQueueSize, sendMessageOutOfTurn, sendTestRequest, sendWithChanges, sendWithChanges, sendWithChangesAndGetQueueSize, sendWithChangesAndGetQueueSize, setAttribute, setAttribute, setAttribute, setErrorHandler, setFIXSessionListener, setLastDisconnectReason, setOutOfTurnMode, setPreLoggofSessionState, setRejectMessageListener, setSequenceNumbers, shutdown, shutdown, startSession, storeProcessedSeqNumber, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InitiatorFIXSession

public InitiatorFIXSession(FIXMessageFactory factory,
                           SessionParameters sessionParameters,
                           HandlerChain fixSessionListener)
Creates the InitiatorFIXSession.

Method Detail

getTransport

protected FIXTransport getTransport(SessionParameters sessionParameters,
                                    String host,
                                    int port)
Gets transport.

Parameters:
sessionParameters - the session parameters
host - the host
port - the port

connect

public void connect()
             throws IOException
Description copied from interface: FIXSession
Connects to remote counterparty,
if initiator or accepts incoming connection if acceptor.

Specified by:
connect in interface FIXSession
Specified by:
connect in class AbstractFIXSession
Throws:
IOException - I/O exception if error occurred
See Also:
FIXSession.reject(String)

setSessionState

public void setSessionState(SessionState sessionState)
Description copied from interface: ExtendedFIXSession
Sets session state.

Specified by:
setSessionState in interface ExtendedFIXSession
Overrides:
setSessionState in class AbstractFIXSession
Parameters:
sessionState - the new session state
See Also:
ExtendedFIXSession.setSessionState(com.epam.fixengine.SessionState)

reject

public void reject(String reason)
            throws IOException
Unsupported for InitiatorFIXSession. Always throws IllegalStateException.

Specified by:
reject in interface FIXSession
Specified by:
reject in class AbstractFIXSession
Throws:
IllegalStateException
IOException - I/O exception if error occurred
See Also:
FIXSession.reject(String)

connectInternal

protected void connectInternal()
                        throws IOException
Throws:
IOException

disconnect

public void disconnect(String reason)
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 interface FIXSession
Overrides:
disconnect in class AbstractFIXSession
Parameters:
reason - the reason, if parameter is not null, the logof message will be send with 58=reason.
See Also:
FIXSession.disconnect(String)

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 interface FIXSession
Overrides:
dispose in class AbstractFIXSession
See Also:
FIXSession.dispose()


Copyright © 2000-2014 EPAM Systems. All Rights Reserved.