@Test public void testRegisteringAnEventProducerAndFiringEventsUsingRoundRobin() throws Exception { Producer p = new Producer(); p.createRoundRobin(); ServiceItem serviceItem = createServiceItem(p); BasicEventConsumer consumer1 = new BasicEventConsumer(getEventDescriptor()); Listener listener1 = new Listener(2); consumer1.register(listener1); BasicEventConsumer consumer2 = new BasicEventConsumer(getEventDescriptor()); Listener listener2 = new Listener(2); consumer2.register(listener2); BasicEventConsumer consumer3 = new BasicEventConsumer(getEventDescriptor()); Listener listener3 = new Listener(2); consumer3.register(listener3); Assert.assertNotNull(consumer1.register(serviceItem)); Assert.assertNotNull(consumer2.register(serviceItem)); Assert.assertNotNull(consumer3.register(serviceItem)); for(int i=0; i<6; i++) p.fire(); assertTrue("Should have gotten 2, got " + listener1.counter.get(), listener1.countDown.await(5, TimeUnit.SECONDS)); assertTrue("Should have gotten 2, got " + listener2.counter.get(), listener2.countDown.await(5, TimeUnit.SECONDS)); assertTrue("Should have gotten 2, got " + listener3.counter.get(), listener3.countDown.await(5, TimeUnit.SECONDS)); }
public boolean register(final RemoteServiceEventListener listener) { return (register(listener, null)); }
BasicEventConsumer implements EventConsumer, ServerProxyTrust { public boolean register(final RemoteServiceEventListener listener) { return (register(listener, null)); } }
BasicEventConsumer implements EventConsumer, ServerProxyTrust { public boolean register(final RemoteServiceEventListener listener) { return (register(listener, null)); } BasicEventConsumer(final EventDescriptor edTemplate);  BasicEventConsumer(final RemoteServiceEventListener<?> listener);  BasicEventConsumer(final EventDescriptor edTemplate, final RemoteServiceEventListener<?> listener);  BasicEventConsumer(final EventDescriptor edTemplate,
                              final RemoteServiceEventListener<?> listener,
                              final Configuration config);  BasicEventConsumer(final EventDescriptor edTemplate,
                              final RemoteServiceEventListener<?> listener,
                              final MarshalledObject<?> handback,
                              final Configuration config); }
BasicEventConsumer implements EventConsumer, ServerProxyTrust { public boolean register(final RemoteServiceEventListener listener) { return (register(listener, null)); } BasicEventConsumer(final EventDescriptor edTemplate);  BasicEventConsumer(final RemoteServiceEventListener<?> listener);  BasicEventConsumer(final EventDescriptor edTemplate, final RemoteServiceEventListener<?> listener);  BasicEventConsumer(final EventDescriptor edTemplate,
                              final RemoteServiceEventListener<?> listener,
                              final Configuration config);  BasicEventConsumer(final EventDescriptor edTemplate,
                              final RemoteServiceEventListener<?> listener,
                              final MarshalledObject<?> handback,
                              final Configuration config); void terminate(); boolean register(final RemoteServiceEventListener listener); boolean register(final RemoteServiceEventListener listener, final MarshalledObject handback); boolean deregister(final RemoteServiceEventListener listener); Watch createWatch(final WatchDataSourceRegistry watchRegistry); void destroyWatch(); Watch getWatch(); EventRegistration register(final ServiceItem item); EventRegistration register(final EventProducer eventProducer,
                                      final EventDescriptor eventDesc,
                                      final ServiceID serviceID); Object getEventRegistrationSource(final long eventID); void deregister(final ServiceID serviceID); void deregister(final ServiceID serviceID, final boolean disconnect); void notify(final RemoteEvent rEvent); TrustVerifier getProxyVerifier(); }
BasicEventConsumer implements EventConsumer, ServerProxyTrust { public boolean register(final RemoteServiceEventListener listener) { return (register(listener, null)); } BasicEventConsumer(final EventDescriptor edTemplate);  BasicEventConsumer(final RemoteServiceEventListener<?> listener);  BasicEventConsumer(final EventDescriptor edTemplate, final RemoteServiceEventListener<?> listener);  BasicEventConsumer(final EventDescriptor edTemplate,
                              final RemoteServiceEventListener<?> listener,
                              final Configuration config);  BasicEventConsumer(final EventDescriptor edTemplate,
                              final RemoteServiceEventListener<?> listener,
                              final MarshalledObject<?> handback,
                              final Configuration config); void terminate(); boolean register(final RemoteServiceEventListener listener); boolean register(final RemoteServiceEventListener listener, final MarshalledObject handback); boolean deregister(final RemoteServiceEventListener listener); Watch createWatch(final WatchDataSourceRegistry watchRegistry); void destroyWatch(); Watch getWatch(); EventRegistration register(final ServiceItem item); EventRegistration register(final EventProducer eventProducer,
                                      final EventDescriptor eventDesc,
                                      final ServiceID serviceID); Object getEventRegistrationSource(final long eventID); void deregister(final ServiceID serviceID); void deregister(final ServiceID serviceID, final boolean disconnect); void notify(final RemoteEvent rEvent); TrustVerifier getProxyVerifier(); static final String RESPONSE_WATCH; }