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 EventHandlingStrategy
public SessionConnector getSessionConnector()
getSessionConnector
in interface EventHandlingStrategy
protected 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
- InterruptedException
EventHandlingStrategy.THREAD_WAIT_FOR_MESSAGE_MS
public int getQueueSize()
getQueueSize
in interface EventHandlingStrategy
public int getQueueSize(SessionID sessionID)
getQueueSize
in interface EventHandlingStrategy
Copyright © 2021. All rights reserved.