public abstract class AbstractCompendiumHandler extends org.osgi.util.tracker.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 AtomicLong |
trackedId |
| Modifier | Constructor and Description |
|---|---|
protected |
AbstractCompendiumHandler(JMXAgentContext agentContext,
org.osgi.framework.Filter filter) |
protected |
AbstractCompendiumHandler(JMXAgentContext agentContext,
String clazz) |
| Modifier and Type | Method and Description |
|---|---|
Object |
addingService(org.osgi.framework.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(org.osgi.framework.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 final AtomicLong trackedId
protected AbstractCompendiumHandler(JMXAgentContext agentContext, org.osgi.framework.Filter filter)
agentContext - filter - protected AbstractCompendiumHandler(JMXAgentContext agentContext, String clazz)
agentContext - clazz - public Object addingService(org.osgi.framework.ServiceReference reference)
addingService in interface org.osgi.util.tracker.ServiceTrackerCustomizeraddingService in class org.osgi.util.tracker.ServiceTrackerpublic void removedService(org.osgi.framework.ServiceReference reference,
Object service)
removedService in interface org.osgi.util.tracker.ServiceTrackerCustomizerremovedService in class org.osgi.util.tracker.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 © 2009-2015 The Apache Software Foundation. All Rights Reserved.