コード例 #1
0
 protected void assertServiceEvent(int type, ServiceReference reference) throws Exception {
   ServiceEvent event = (ServiceEvent) waitForEvent(serviceEvents, type);
   log.debug("serviceEvents=" + serviceEvents);
   assertNotNull("Event not null", event);
   serviceEvents.remove(event);
   assertEquals(ConstantsHelper.serviceEvent(type), ConstantsHelper.serviceEvent(event.getType()));
   assertEquals(reference, event.getSource());
   assertEquals(reference, event.getServiceReference());
 }
コード例 #2
0
 @Override
 public void serviceChanged(ServiceEvent event) {
   synchronized (serviceEvents) {
     log.debug(
         "ServiceChanged type=" + ConstantsHelper.serviceEvent(event.getType()) + " for " + event);
     serviceEvents.add(event);
     serviceEvents.notifyAll();
   }
 }