}
private Object registerDomainProvider(Bundle bundle, String name) {
Class<? extends Domain> domainInterface = loadDomainInterfaceFromBundle(bundle);
Class<? extends DomainEvents> domainEventsInterface = loadDomainEventsInterfaceFromBundle(bundle);
DomainProvider provider =
new DefaultDomainProvider(name, bundle, domainInterface, domainEventsInterface);
Dictionary<String, Object> props = new Hashtable<String, Object>();
props.put("domain", name);
LOGGER.debug("registering DomainProvider for Bundle {} with properties {}", bundle, props);
return bundle.getBundleContext().registerService(DomainProvider.class, provider, props);