quickfix.mina.acceptor
Class DynamicAcceptorSessionProvider
java.lang.Object
quickfix.mina.acceptor.DynamicAcceptorSessionProvider
- All Implemented Interfaces:
- AcceptorSessionProvider
public class DynamicAcceptorSessionProvider
- extends java.lang.Object
- implements AcceptorSessionProvider
Dynamically defines sessions for an acceptor. This can be useful for
applications like simulators that want to accept any connection and
dynamically create an associated session.
For more complex situations, you can use this class as a starting
point for implementing your own AcceptorSessionProvider.
Constructor Summary |
DynamicAcceptorSessionProvider(SessionSettings settings,
java.util.List<DynamicAcceptorSessionProvider.TemplateMapping> templateMappings,
Application application,
MessageStoreFactory messageStoreFactory,
LogFactory logFactory,
MessageFactory messageFactory)
|
DynamicAcceptorSessionProvider(SessionSettings settings,
SessionID templateID,
Application application,
MessageStoreFactory messageStoreFactory,
LogFactory logFactory,
MessageFactory messageFactory)
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
WILDCARD
public static final java.lang.String WILDCARD
- See Also:
- Constant Field Values
settings
protected final SessionSettings settings
sessionFactory
protected final SessionFactory sessionFactory
DynamicAcceptorSessionProvider
public DynamicAcceptorSessionProvider(SessionSettings settings,
SessionID templateID,
Application application,
MessageStoreFactory messageStoreFactory,
LogFactory logFactory,
MessageFactory messageFactory)
- Parameters:
settings
- session settingstemplateID
- this is a session ID for a session definition in the session
settings that will be used for default dynamic session values. The BeginString,
SenderCompID, and TargetCompID settings will be replaced with those in the
received logon message.application
- application for the dynamic sessionsmessageStoreFactory
- message store factory for the dynamic sessionslogFactory
- log factory for the dynamic sessionsmessageFactory
- message factory for the dynamic sessions
DynamicAcceptorSessionProvider
public DynamicAcceptorSessionProvider(SessionSettings settings,
java.util.List<DynamicAcceptorSessionProvider.TemplateMapping> templateMappings,
Application application,
MessageStoreFactory messageStoreFactory,
LogFactory logFactory,
MessageFactory messageFactory)
- Parameters:
settings
- session settingstemplateMappings
- this is a list of session ID patterns mapped to session IDs in
the settings file. The session IDs represent the template for a specified session ID
pattern. The template is used to dynamically create acceptor sessions.
Use "*" to represent a wildcard for a pattern element. For example,
new SessionID("FIX.4.2", "*", "*") would match for any FIX 4.2 session ID.
This allows separate template session configurations for FIX versions (or
CompIDs) being accepted dynamically on a single TCP port.application
- application for the dynamic sessionsmessageStoreFactory
- message store factory for the dynamic sessionslogFactory
- log factory for the dynamic sessionsmessageFactory
- message factory for the dynamic sessions- See Also:
DynamicAcceptorSessionProvider.TemplateMapping
getSession
public Session getSession(SessionID sessionID,
SessionConnector sessionConnector)
- Description copied from interface:
AcceptorSessionProvider
- Return a session for this sessionID. The session might be
created dynamically.
- Specified by:
getSession
in interface AcceptorSessionProvider
- Returns:
- the associated session or null if no session can be
associated with the given ID.
optionallySetValue
protected void optionallySetValue(SessionSettings dynamicSettings,
java.lang.String key,
java.lang.String value)
lookupTemplateID
protected SessionID lookupTemplateID(SessionID sessionID)
copySettings
protected void copySettings(SessionSettings settings,
java.util.Properties properties)