ObjectName result = null;
ComponentNameSpace cns = new ComponentNameSpace(getName(), activationSpec.getComponentName(), activationSpec.getId());
log.info("Activating component for: " + cns + " with service: " + activationSpec.getService() + " component: "
+ component);
DeliveryChannelImpl dc = new DeliveryChannelImpl(this, activationSpec.getComponentName());
LocalComponentConnector lcc = registry.registerComponent(cns, description, component, dc, binding, service);
if (lcc != null) {
dc.setConnector(lcc);
lcc.setPojo(pojo);
ComponentEnvironment env = environmentContext.registerComponent(context.getEnvironment(),lcc);
env.setInstallRoot(installationDir);
context.activate(component, dc, env, activationSpec, installationDir);
lcc.setContext(context);
lcc.setActivationSpec(activationSpec);
component.getLifeCycle().init(context);
if (started.get() && lcc.isPojo()) {
component.getLifeCycle().start();
}
ComponentMBeanImpl mbean = new ComponentMBeanImpl(lcc);
result = managementContext.createObjectName(mbean);
try {
managementContext.registerMBean(result, mbean, ComponentMBean.class);
lcc.setMBean(result, mbean);
}
catch (JMException e) {
throw new JBIException(e);
}
}