@Test public void testRegisterProcessor() throws Exception { final String endpointId = "endpoint-id"; final WebSocketMessageRouters routers = new WebSocketMessageRouters(); try { routers.getRouterOrFail(endpointId); fail("Should fail because no route exists with the endpointId."); } catch (WebSocketConfigurationException e) { } final Processor processor1 = mock(Processor.class); when(processor1.getIdentifier()).thenReturn("processor-1"); assertFalse(routers.isProcessorRegistered(endpointId, processor1)); routers.registerProcessor(endpointId, processor1); assertNotNull(routers.getRouterOrFail(endpointId)); assertTrue(routers.isProcessorRegistered(endpointId, processor1)); routers.deregisterProcessor(endpointId, processor1); assertFalse(routers.isProcessorRegistered(endpointId, processor1)); }
public synchronized void registerProcessor(final String endpointId, final Processor processor) throws WebSocketConfigurationException { final WebSocketMessageRouter router = getRouterOrCreate(endpointId); router.registerProcessor(processor); }
WebSocketMessageRouters { public synchronized void registerProcessor(final String endpointId, final Processor processor) throws WebSocketConfigurationException { final WebSocketMessageRouter router = getRouterOrCreate(endpointId); router.registerProcessor(processor); } }
WebSocketMessageRouters { public synchronized void registerProcessor(final String endpointId, final Processor processor) throws WebSocketConfigurationException { final WebSocketMessageRouter router = getRouterOrCreate(endpointId); router.registerProcessor(processor); }  }
WebSocketMessageRouters { public synchronized void registerProcessor(final String endpointId, final Processor processor) throws WebSocketConfigurationException { final WebSocketMessageRouter router = getRouterOrCreate(endpointId); router.registerProcessor(processor); }  WebSocketMessageRouter getRouterOrFail(final String endpointId); synchronized void registerProcessor(final String endpointId, final Processor processor); boolean isProcessorRegistered(final String endpointId, final Processor processor); synchronized void deregisterProcessor(final String endpointId, final Processor processor); void sendMessage(final String endpointId, final String sessionId, final SendMessage sendMessage); void disconnect(final String endpointId, final String sessionId, final String reason); }
WebSocketMessageRouters { public synchronized void registerProcessor(final String endpointId, final Processor processor) throws WebSocketConfigurationException { final WebSocketMessageRouter router = getRouterOrCreate(endpointId); router.registerProcessor(processor); }  WebSocketMessageRouter getRouterOrFail(final String endpointId); synchronized void registerProcessor(final String endpointId, final Processor processor); boolean isProcessorRegistered(final String endpointId, final Processor processor); synchronized void deregisterProcessor(final String endpointId, final Processor processor); void sendMessage(final String endpointId, final String sessionId, final SendMessage sendMessage); void disconnect(final String endpointId, final String sessionId, final String reason);  }