@Test public void testReceive() throws Exception { HashMap<Class, Responder> classResponderHashMap = generateRespondersMap(); classResponderHashMap.put(UUID.class, responder2); JgroupsMessageReceiver jgroupsMessageReceiver = new JgroupsMessageReceiver(classResponderHashMap, new RemoteServiceHandlesStore()); jgroupsMessageReceiver.receive(UUID_MSG); jgroupsMessageReceiver.receive(UUID_MSG); jgroupsMessageReceiver.receive(STRING_MSG); new Verifications() {{ responder2.processMessage(UUID_MSG); times = 2; responder1.processMessage(STRING_MSG); times = 1; }}; }
@Override public void receive(final Message msg) { try { handle(msg); } catch (Exception exception) { if (!(exception instanceof SilverWareClusteringException)) { throw new SilverWareClusteringException(PROCESSING_ERROR, exception); } throw (SilverWareClusteringException) exception; } }
JgroupsMessageReceiver extends ReceiverAdapter implements RequestHandler { @Override public void receive(final Message msg) { try { handle(msg); } catch (Exception exception) { if (!(exception instanceof SilverWareClusteringException)) { throw new SilverWareClusteringException(PROCESSING_ERROR, exception); } throw (SilverWareClusteringException) exception; } } }
JgroupsMessageReceiver extends ReceiverAdapter implements RequestHandler { @Override public void receive(final Message msg) { try { handle(msg); } catch (Exception exception) { if (!(exception instanceof SilverWareClusteringException)) { throw new SilverWareClusteringException(PROCESSING_ERROR, exception); } throw (SilverWareClusteringException) exception; } } JgroupsMessageReceiver(Map<Class, Responder> responders, RemoteServiceHandlesStore store); }
JgroupsMessageReceiver extends ReceiverAdapter implements RequestHandler { @Override public void receive(final Message msg) { try { handle(msg); } catch (Exception exception) { if (!(exception instanceof SilverWareClusteringException)) { throw new SilverWareClusteringException(PROCESSING_ERROR, exception); } throw (SilverWareClusteringException) exception; } } JgroupsMessageReceiver(Map<Class, Responder> responders, RemoteServiceHandlesStore store); void setMyAddress(Address myAddress); Responder addResponder(Class clazz, Responder responder); @Override void receive(final Message msg); @Override void viewAccepted(final View view); @Override Object handle(Message msg); }
JgroupsMessageReceiver extends ReceiverAdapter implements RequestHandler { @Override public void receive(final Message msg) { try { handle(msg); } catch (Exception exception) { if (!(exception instanceof SilverWareClusteringException)) { throw new SilverWareClusteringException(PROCESSING_ERROR, exception); } throw (SilverWareClusteringException) exception; } } JgroupsMessageReceiver(Map<Class, Responder> responders, RemoteServiceHandlesStore store); void setMyAddress(Address myAddress); Responder addResponder(Class clazz, Responder responder); @Override void receive(final Message msg); @Override void viewAccepted(final View view); @Override Object handle(Message msg);  }