use of org.osgi.jmx.framework.ServiceStateMBean in project aries by apache.
the class Activator method start.
public void start(BundleContext context) throws Exception {
ctx = context;
logger = new Logger(ctx);
Filter filter = getFilter(context, PACKAGE_ADMIN, START_LEVEL, PERMISSION_ADMIN, CONFIG_ADMIN, USER_ADMIN, PROVISIONING_SERVICE);
tracker = new ServiceTracker(context, filter, this);
tracker.open();
stateConfig = StateConfig.register(context);
registerMBean(ServiceStateMBean.class.getName(), new Factory<ServiceStateMBean>() {
public ServiceStateMBean create() {
return new ServiceState(ctx, stateConfig, logger);
}
}, ServiceStateMBean.OBJECTNAME, _serviceStateMbean);
}
use of org.osgi.jmx.framework.ServiceStateMBean in project aries by apache.
the class ServiceStateMBeanHandler method open.
/**
* @see org.apache.aries.jmx.MBeanHandler#open()
*/
public void open() {
serviceStateMBean = new ServiceState(bundleContext, stateConfig, logger);
try {
mbean = new RegistrableStandardEmitterMBean(serviceStateMBean, ServiceStateMBean.class);
} catch (NotCompliantMBeanException e) {
logger.log(LogService.LOG_ERROR, "Failed to instantiate MBean for " + ServiceStateMBean.class.getName(), e);
}
agentContext.registerMBean(this);
}
Aggregations