/** * Creates an instance of the MBean from the metadata stored in the context, * and registers it in the MBeanServer. * * @param context The ServiceControllerContext we are installing */ public void installAction(ServiceControllerContext context) throws Throwable { MBeanServer server = context.getServiceController().getMBeanServer(); ObjectName objectName = context.getObjectName(); ServiceMetaData metaData = context.getServiceMetaData(); Object mbean = context.getTarget(); ServiceInstance instance = ServiceCreator.install(server, objectName, metaData, mbean); context.setTarget(instance.getResource()); ContextRegistry registry = getRegistry(context); registry.addInstantiatedContext(context); }