The BundleContext provides a registerService method to allow Bundles to registers services
into the framework. The current implementation installs the Service using the
BeanMetaData and the KernelController.
BeanMetaDataBuilder builder = BeanMetaDataBuilderFactory.createBuilder(GUID.asString(),
serviceInfo.getName());
| BeanMetaData metaData = builder.getBeanMetaData();
| KernelControllerContext context;
| try
| {
| context = controller.install(metaData, service);
| }
| catch (Throwable t)
| {
| throw new InternalOSGiFacadeException(t);
| }
| // todo - get underlying bundle --> ServiceReference
| return new ServiceRegistrationImpl(this, context, serviceId, serviceMap);
In this case, we could create a ServiceReference for the ServiceRegistration, and hold
onto it for any subsequent calls to getServiceReference. What will we do in the case of
a Deployment that was not deployed using the OSGi Deployers? If our goal is to provide a
Facade over the MC and allow deployments to be viewed as Bundles, we would need a generic
way to get ServiceReferences for other Deployments, that is if we want to use
ServiceReferences in this case.
What would the equivalent MC component be? Would it be any Bean created in a similar
fashion (BeanMetaData installed into Controller). If so, how do we trace it back to the
Deployment it came from?
View the original post :
http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4133775#...
Reply to the post :
http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&a...