quickfix.mina
Class SessionConnector

java.lang.Object
  extended by quickfix.mina.SessionConnector
Direct Known Subclasses:
AbstractSocketAcceptor, AbstractSocketInitiator

public abstract class SessionConnector
extends java.lang.Object

An abstract base class for acceptors and initiators. Provides support for common functionality and also serves as an abstraction where the code doesn't need to make the acceptor/initator distinction.


Field Summary
protected  org.slf4j.Logger log
           
static java.lang.String QF_SESSION
           
 
Constructor Summary
SessionConnector(SessionSettings settings, SessionFactory sessionFactory)
           
 
Method Summary
 void addDynamicSession(Session inSession)
           
protected  Session createSession(SessionID sessionID)
           
protected  int getIntSetting(java.lang.String key)
           
protected  org.apache.mina.common.IoFilterChainBuilder getIoFilterChainBuilder()
           
 java.util.List<Session> getManagedSessions()
          Get the list of session managed by this connector.
protected  java.util.concurrent.ScheduledExecutorService getScheduledExecutorService()
           
protected  java.util.Map<SessionID,Session> getSessionMap()
          This is for subclasses to directly access the session map.
 java.util.ArrayList<SessionID> getSessions()
          Return the list of session identifiers of sessions managed by this connector.
 SessionSettings getSettings()
           
 boolean isLoggedOn()
           
protected  void logError(SessionID sessionID, org.apache.mina.common.IoSession protocolSession, java.lang.String message, java.lang.Throwable t)
           
protected  void logoutAllSessions(boolean forceDisconnect)
           
 void removeDynamicSession(SessionID inSessionID)
           
 void setIoFilterChainBuilder(org.apache.mina.common.IoFilterChainBuilder ioFilterChainBuilder)
          Allows a custom IOFilterChainBuilder to be added to the session connector.
protected  void setSessions(java.util.Map<SessionID,Session> sessions)
           
protected  void startSessionTimer()
           
protected  void stopSessionTimer()
           
protected  void waitForLogout()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

QF_SESSION

public static final java.lang.String QF_SESSION
See Also:
Constant Field Values

log

protected final org.slf4j.Logger log
Constructor Detail

SessionConnector

public SessionConnector(SessionSettings settings,
                        SessionFactory sessionFactory)
                 throws ConfigError
Throws:
ConfigError
Method Detail

setSessions

protected void setSessions(java.util.Map<SessionID,Session> sessions)

getManagedSessions

public java.util.List<Session> getManagedSessions()
Get the list of session managed by this connector.

Returns:
list of quickfix.Session objects
See Also:
Session

getSessionMap

protected java.util.Map<SessionID,Session> getSessionMap()
This is for subclasses to directly access the session map.

Returns:
a map of sessions keys by session ID

getSessions

public java.util.ArrayList<SessionID> getSessions()
Return the list of session identifiers of sessions managed by this connector. Should be called getSessionIDs but the current name is retained for QF/JNI compatibility.

Returns:
list of session identifiers

addDynamicSession

public void addDynamicSession(Session inSession)

removeDynamicSession

public void removeDynamicSession(SessionID inSessionID)

getSettings

public SessionSettings getSettings()

createSession

protected Session createSession(SessionID sessionID)
                         throws ConfigError
Throws:
ConfigError

getIntSetting

protected int getIntSetting(java.lang.String key)
                     throws ConfigError
Throws:
ConfigError

isLoggedOn

public boolean isLoggedOn()

logoutAllSessions

protected void logoutAllSessions(boolean forceDisconnect)

waitForLogout

protected void waitForLogout()

logError

protected void logError(SessionID sessionID,
                        org.apache.mina.common.IoSession protocolSession,
                        java.lang.String message,
                        java.lang.Throwable t)

startSessionTimer

protected void startSessionTimer()

stopSessionTimer

protected void stopSessionTimer()

getScheduledExecutorService

protected java.util.concurrent.ScheduledExecutorService getScheduledExecutorService()

setIoFilterChainBuilder

public void setIoFilterChainBuilder(org.apache.mina.common.IoFilterChainBuilder ioFilterChainBuilder)
Allows a custom IOFilterChainBuilder to be added to the session connector. This will allow modification of the MINA filter chain. Modifying the filter chain can be useful for logging, encryption/SSL and other purposes. The FIX codec filter name can be used to for inserting custom filters before or after the FIX message codec.

Parameters:
ioFilterChainBuilder -
See Also:
IoFilterChainBuilder

getIoFilterChainBuilder

protected org.apache.mina.common.IoFilterChainBuilder getIoFilterChainBuilder()