|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.management.MBeanServerBuilder mx4j.server.ChainedMBeanServerBuilder
Base class for chained MBeanServerBuilders.
By default this class delegates all method calls to the nested MBeanServerBuilder.
See the MX4J documentation on how to use correctly this class.
Example implementation:
public class LoggingBuilder extends ChainedMBeanServerBuilder { public LoggingBuilder() { super(new MX4JMBeanServerBuilder()); } public MBeanServer newMBeanServer(String defaultDomain, MBeanServer outer, MBeanServerDelegate delegate) { LoggingMBeanServer external = new LoggingMBeanServer(); MBeanServer nested = getBuilder().newMBeanServer(defaultDomain, outer == null ? external : outer, delegate); external.setMBeanServer(nested); return external; } } public class LoggingMBeanServer extends ChainedMBeanServer { protected void setMBeanServer(MBeanServer server) { super.setMBeanServer(server); } public Object getAttribute(ObjectName objectName, String attribute) throws MBeanException, AttributeNotFoundException, InstanceNotFoundException, ReflectionException { Object value = super.getAttribute(objectName, attribute); System.out.println("Value is: " + value); return value; } ... }
Constructor Summary | |
ChainedMBeanServerBuilder(javax.management.MBeanServerBuilder builder)
Creates a new chained MBeanServerBuilder |
Method Summary | |
protected javax.management.MBeanServerBuilder |
getMBeanServerBuilder()
Returns the chained MBeanServerBuilder this object delegates to. |
javax.management.MBeanServer |
newMBeanServer(java.lang.String defaultDomain,
javax.management.MBeanServer outer,
javax.management.MBeanServerDelegate delegate)
Forwards the call to the chained builder. |
javax.management.MBeanServerDelegate |
newMBeanServerDelegate()
Forwards the call to the chained builder. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ChainedMBeanServerBuilder(javax.management.MBeanServerBuilder builder)
builder
- The MBeanServerBuilder this object delegates to.Method Detail |
public javax.management.MBeanServerDelegate newMBeanServerDelegate()
MBeanServerBuilder.newMBeanServerDelegate()
public javax.management.MBeanServer newMBeanServer(java.lang.String defaultDomain, javax.management.MBeanServer outer, javax.management.MBeanServerDelegate delegate)
MBeanServerBuilder.newMBeanServer(java.lang.String, javax.management.MBeanServer, javax.management.MBeanServerDelegate)
protected javax.management.MBeanServerBuilder getMBeanServerBuilder()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |