@Test public void testRequest() throws Exception { ProtocolMessage msg = new PingMessage(); ReflexiveProtocolHandler handler = new ReflexiveProtocolHandler(); listener.addHandler(handler); marshaller.marshal(msg, socket.getOutputStream()); ProtocolMessage response = unmarshaller.unmarshal(socket.getInputStream()); assertEquals(msg.getType(), response.getType()); assertEquals(1, handler.getMessages().size()); assertEquals(msg.getType(), handler.getMessages().get(0).getType()); }
@Override public void addHandler(final ProtocolHandler handler) { if (handler == null) { throw new NullPointerException("Protocol handler may not be null."); } handlers.add(handler); }
SocketProtocolListener extends SocketListener implements ProtocolListener { @Override public void addHandler(final ProtocolHandler handler) { if (handler == null) { throw new NullPointerException("Protocol handler may not be null."); } handlers.add(handler); } }
SocketProtocolListener extends SocketListener implements ProtocolListener { @Override public void addHandler(final ProtocolHandler handler) { if (handler == null) { throw new NullPointerException("Protocol handler may not be null."); } handlers.add(handler); } SocketProtocolListener(
            final int numThreads,
            final int port,
            final ServerSocketConfiguration configuration,
            final ProtocolContext<ProtocolMessage> protocolContext); }
SocketProtocolListener extends SocketListener implements ProtocolListener { @Override public void addHandler(final ProtocolHandler handler) { if (handler == null) { throw new NullPointerException("Protocol handler may not be null."); } handlers.add(handler); } SocketProtocolListener(
            final int numThreads,
            final int port,
            final ServerSocketConfiguration configuration,
            final ProtocolContext<ProtocolMessage> protocolContext); @Override void setBulletinRepository(final BulletinRepository bulletinRepository); @Override void start(); @Override void stop(); @Override Collection<ProtocolHandler> getHandlers(); @Override void addHandler(final ProtocolHandler handler); @Override boolean removeHandler(final ProtocolHandler handler); @Override void dispatchRequest(final Socket socket); }
SocketProtocolListener extends SocketListener implements ProtocolListener { @Override public void addHandler(final ProtocolHandler handler) { if (handler == null) { throw new NullPointerException("Protocol handler may not be null."); } handlers.add(handler); } SocketProtocolListener(
            final int numThreads,
            final int port,
            final ServerSocketConfiguration configuration,
            final ProtocolContext<ProtocolMessage> protocolContext); @Override void setBulletinRepository(final BulletinRepository bulletinRepository); @Override void start(); @Override void stop(); @Override Collection<ProtocolHandler> getHandlers(); @Override void addHandler(final ProtocolHandler handler); @Override boolean removeHandler(final ProtocolHandler handler); @Override void dispatchRequest(final Socket socket);  }