@Test public void shouldCreateCorrectTypeOfQueueTracker() throws Exception { final Session quickfixSession = mock(Session.class, withSettings().defaultAnswer(RETURNS_DEEP_STUBS)); assertFalse(getField( new ThreadPerSessionEventHandlingStrategy(null, 42) .createDispatcherThread(quickfixSession), "queueTracker", QueueTracker.class) instanceof WatermarkTracker); assertTrue(getField( new ThreadPerSessionEventHandlingStrategy(null, 42, 43) .createDispatcherThread(quickfixSession), "queueTracker", QueueTracker.class) instanceof WatermarkTracker); assertFalse(getField( new ThreadPerSessionEventHandlingStrategy(null, -1, -1) .createDispatcherThread(quickfixSession), "queueTracker", QueueTracker.class) instanceof WatermarkTracker); }
MessageDispatchingThread createDispatcherThread(Session quickfixSession) { return new MessageDispatchingThread(quickfixSession, executor); }
ThreadPerSessionEventHandlingStrategy implements EventHandlingStrategy { MessageDispatchingThread createDispatcherThread(Session quickfixSession) { return new MessageDispatchingThread(quickfixSession, executor); } }
ThreadPerSessionEventHandlingStrategy implements EventHandlingStrategy { MessageDispatchingThread createDispatcherThread(Session quickfixSession) { return new MessageDispatchingThread(quickfixSession, executor); } ThreadPerSessionEventHandlingStrategy(SessionConnector connector, int queueCapacity);  ThreadPerSessionEventHandlingStrategy(SessionConnector connector, int queueLowerWatermark, int queueUpperWatermark); }
ThreadPerSessionEventHandlingStrategy implements EventHandlingStrategy { MessageDispatchingThread createDispatcherThread(Session quickfixSession) { return new MessageDispatchingThread(quickfixSession, executor); } ThreadPerSessionEventHandlingStrategy(SessionConnector connector, int queueCapacity);  ThreadPerSessionEventHandlingStrategy(SessionConnector connector, int queueLowerWatermark, int queueUpperWatermark); void setExecutor(Executor executor); @Override void onMessage(Session quickfixSession, Message message); @Override SessionConnector getSessionConnector(); void stopDispatcherThreads(); @Override int getQueueSize(); @Override int getQueueSize(SessionID sessionID); }
ThreadPerSessionEventHandlingStrategy implements EventHandlingStrategy { MessageDispatchingThread createDispatcherThread(Session quickfixSession) { return new MessageDispatchingThread(quickfixSession, executor); } ThreadPerSessionEventHandlingStrategy(SessionConnector connector, int queueCapacity);  ThreadPerSessionEventHandlingStrategy(SessionConnector connector, int queueLowerWatermark, int queueUpperWatermark); void setExecutor(Executor executor); @Override void onMessage(Session quickfixSession, Message message); @Override SessionConnector getSessionConnector(); void stopDispatcherThreads(); @Override int getQueueSize(); @Override int getQueueSize(SessionID sessionID);  }