ObjectName result = null;
ComponentNameSpace cns = new ComponentNameSpace(getName(), activationSpec.getComponentName());
if (LOG.isDebugEnabled()) {
LOG.info("Activating component for: " + cns + " with service: " + activationSpec.getService() + " component: " + component);
}
ComponentMBeanImpl lcc = registry.registerComponent(cns, description, component, binding, service, sharedLibraries);
if (lcc != null) {
lcc.setPojo(pojo);
ComponentEnvironment env = environmentContext.registerComponent(context.getEnvironment(), lcc);
if (env.getInstallRoot() == null) {
env.setInstallRoot(installationDir);
}
context.activate(component, env, activationSpec);
lcc.setContext(context);
lcc.setActivationSpec(activationSpec);
if (lcc.isPojo()) {
//non-pojo's are either started by the auto deployer
//or manually
lcc.init();
} else {
lcc.doShutDown();
}
result = lcc.registerMBeans(managementContext);
// Start the component after mbeans have been registered
// This can be usefull if listeners use them
if (lcc.isPojo() && started.get()) {
lcc.start();
}
}
return result;
}