public abstract class AbstractCompendiumHandler extends ServiceTracker implements MBeanHandler
Abstract implementation of MBeanHandler that provides a template with basic tracking of an optional
compendium service. MBeanHandler implementations that manage a StandardMBean that is backed by a single OSGi
compendium service should extend this class and implement the constructInjectMBean(Object) and
getName() methods
MBeanHandler| Modifier and Type | Field and Description |
|---|---|
protected JMXAgentContext |
agentContext |
protected StandardMBean |
mbean |
protected Long |
trackedId |
context, filter| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCompendiumHandler(JMXAgentContext agentContext,
Filter filter) |
protected |
AbstractCompendiumHandler(JMXAgentContext agentContext,
String clazz) |
| Modifier and Type | Method and Description |
|---|---|
Object |
addingService(ServiceReference reference) |
protected abstract StandardMBean |
constructInjectMBean(Object targetService)
Implement this method to construct an appropriate
StandardMBean instance which is backed by the supplied
service tracked by this handler |
protected abstract String |
getBaseName()
The base name of the MBean.
|
StandardMBean |
getMbean()
Gets the
StandardMBean managed by this handler when the backing service is available or null |
String |
getName()
Gets name of the MBean.
|
void |
removedService(ServiceReference reference,
Object service) |
close, getService, getService, getServiceReference, getServiceReferences, getServices, getServices, getTracked, getTrackingCount, isEmpty, modifiedService, open, open, remove, size, waitForServiceclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitclose, openprotected final JMXAgentContext agentContext
protected StandardMBean mbean
protected Long trackedId
protected AbstractCompendiumHandler(JMXAgentContext agentContext, Filter filter)
agentContext - filter - protected AbstractCompendiumHandler(JMXAgentContext agentContext, String clazz)
agentContext - clazz - public Object addingService(ServiceReference reference)
addingService in interface ServiceTrackerCustomizeraddingService in class ServiceTrackerpublic void removedService(ServiceReference reference, Object service)
removedService in interface ServiceTrackerCustomizerremovedService in class ServiceTrackerpublic StandardMBean getMbean()
StandardMBean managed by this handler when the backing service is available or nullgetMbean in interface MBeanHandlerStandardMBean.MBeanHandler.getMbean()protected abstract StandardMBean constructInjectMBean(Object targetService)
StandardMBean instance which is backed by the supplied
service tracked by this handlertargetService - the compendium service tracked by this handlerStandardMBean instance whose registration lifecycle will be managed by this handlerprotected abstract String getBaseName()
public String getName()
MBeanHandlergetName in interface MBeanHandlerMBeanHandler.getName()Copyright © 2015 JBoss by Red Hat. All rights reserved.