[jboss-dev-forums] [Design of OSGi Integration] - Re: BundleActivatorDeployer Questions
adrian@jboss.org
do-not-reply at jboss.com
Mon Feb 18 07:23:11 EST 2008
"johnbailey" wrote :
| In the BundleActivatorDeploymentVisitor a BundleContext is created, which will lazily create the Bundle. BeanMeteData for the BundleActivator is then installed into the controller with start and stop parameters of the BundleContext.
|
| | public void deploy(DeploymentUnit unit, OSGiMetaData deployment) throws DeploymentException
| | {
| | String bundleActivator = deployment.getBundleActivator();
| | if (bundleActivator != null)
| | {
| | String name = createBundleActivatorBeanName(deployment);
| | // todo - get deployment context in non-depricated way
| | BundleContext bundleContext = new BundleContextImpl(unit);
| | BeanMetaDataBuilder builder =
| | BeanMetaDataBuilderFactory.createBuilder(name, bundleActivator)
| | .addStartParameter(BundleContext.class.getName(), bundleContext)
| | .addStopParameter(BundleContext.class.getName(), bundleContext);
| | BeanMetaData beanMetaData = builder.getBeanMetaData();
| | try
| | {
| | controller.install(beanMetaData);
| | }
| | catch (Throwable throwable)
| | {
| | throw DeploymentException.rethrowAsDeploymentException("Unable to install BundleActivator.", throwable);
| | }
| | }
| | }
| |
|
I don't see why we need to create a seperate kernel controller context for the bundle?
The deployment is the context.
There just needs to a REAL deployer that invokes the bundle activator.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4130079#4130079
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4130079
More information about the jboss-dev-forums
mailing list