public class ThreadPerSessionEventHandlingStrategy extends Object implements EventHandlingStrategy
| Modifier and Type | Class and Description |
|---|---|
protected class |
ThreadPerSessionEventHandlingStrategy.MessageDispatchingThread |
protected static class |
ThreadPerSessionEventHandlingStrategy.ThreadAdapter
A stand-in for the Thread class that delegates to an Executor.
|
END_OF_STREAM, THREAD_WAIT_FOR_MESSAGE_MS| Constructor and Description |
|---|
ThreadPerSessionEventHandlingStrategy(SessionConnector connector,
int queueCapacity) |
ThreadPerSessionEventHandlingStrategy(SessionConnector connector,
int queueLowerWatermark,
int queueUpperWatermark) |
| Modifier and Type | Method and Description |
|---|---|
protected ThreadPerSessionEventHandlingStrategy.MessageDispatchingThread |
getDispatcher(SessionID sessionID) |
protected Message |
getNextMessage(quickfix.mina.QueueTracker<Message> queueTracker)
Get the next message from the messages
BlockingQueue. |
int |
getQueueSize() |
int |
getQueueSize(SessionID sessionID) |
SessionConnector |
getSessionConnector()
The SessionConnector is not directly required for thread-per-session handler - we don't multiplex
between multiple sessions here.
|
void |
onMessage(Session quickfixSession,
Message message) |
void |
setExecutor(Executor executor) |
protected void |
startDispatcherThread(ThreadPerSessionEventHandlingStrategy.MessageDispatchingThread dispatcher) |
void |
stopDispatcherThreads() |
public ThreadPerSessionEventHandlingStrategy(SessionConnector connector, int queueCapacity)
public ThreadPerSessionEventHandlingStrategy(SessionConnector connector, int queueLowerWatermark, int queueUpperWatermark)
public void setExecutor(Executor executor)
public void onMessage(Session quickfixSession, Message message)
onMessage in interface EventHandlingStrategypublic SessionConnector getSessionConnector()
getSessionConnector in interface EventHandlingStrategyprotected void startDispatcherThread(ThreadPerSessionEventHandlingStrategy.MessageDispatchingThread dispatcher)
public void stopDispatcherThreads()
protected ThreadPerSessionEventHandlingStrategy.MessageDispatchingThread getDispatcher(SessionID sessionID)
protected Message getNextMessage(quickfix.mina.QueueTracker<Message> queueTracker) throws InterruptedException
BlockingQueue.
We do not block indefinitely as that would prevent this thread from ever stopping
queueTracker - InterruptedExceptionEventHandlingStrategy.THREAD_WAIT_FOR_MESSAGE_MSpublic int getQueueSize()
getQueueSize in interface EventHandlingStrategypublic int getQueueSize(SessionID sessionID)
getQueueSize in interface EventHandlingStrategyCopyright © 2021. All rights reserved.