// Updating internal structure of registration
routingTable.updateRoute(path, registration.instance)
+ // Update routing table / send announce to message bus
+
val success = paths.put(context, path);
}
}
}
+
+ def createDelegate(Class<? extends RpcService> type) {
+ getManagedDirectProxy(type);
+ }
+
}
class RoutedRpcRegistrationImpl<T extends RpcService> extends AbstractObjectRegistration<T> implements RoutedRpcRegistration<T> {
if (false == services.empty) {
val ref = services.iterator().next() as ServiceReference<T>;
return bundleContext.getService(ref) as T;
+ } else {
+ broker.createDelegate(module);
+ return getRpcService(module);
}
} catch (InvalidSyntaxException e) {
log.error("Created filter was invalid:", e.message, e)
@Test
public void properInitialized() throws Exception {
- Collection<ServiceReference<ToasterService>> references = ctx.getServiceReferences(ToasterService.class, null);
- assertEquals(2, references.size());
+ Thread.sleep(500); // Waiting for services to get wired.
- consumer.createToast(WhiteBread.class, 5);
+ assertTrue(consumer.createToast(WhiteBread.class, 5));
}