org.jmx4odp.j4oNet
Class MBeanResolver

java.lang.Object
  extended by org.jmx4odp.j4oNet.MBeanResolver
All Implemented Interfaces:
javax.management.MBeanRegistration, MBeanResolverMBean
Direct Known Subclasses:
BroadcastResolver, JsResgistryResolver, MBeanServerResolver

public abstract class MBeanResolver
extends java.lang.Object
implements javax.management.MBeanRegistration, MBeanResolverMBean

Extend this abstract class to create a custom MBeanResolver. It contains the basic functictions such as detrming if a request is in range and the basic attributes such as cachable, active, etc.

Specifically, coders need to override the handleMBeanRequest and handleAgentRequest methods. If a resolution request is with in range, and the MBean is active, it will pass the JmxServiceObj to one of these methods, depending on the JmxServiceObj.isAgent() method.

Author:
Lucas McGregor

Field Summary
protected  javax.management.MBeanServer mbeanServer
           
protected  javax.management.ObjectName objectName
           
 
Constructor Summary
MBeanResolver()
           
 
Method Summary
 boolean getActive()
           
 boolean getCachable()
           
 java.lang.String getNameSpace()
           
 int getThreshHold()
           
protected  JmxServiceObj[] handleAgentRequest(JmxServiceObj jso)
           
protected  JmxServiceObj[] handleMBeanRequest(JmxServiceObj jso)
          this is what all the children MBeanResolvers should over write.
protected  boolean inNameSpace(JmxServiceObj jso)
          if the jso is null, it returns a false.
 void postDeregister()
           
 void postRegister(java.lang.Boolean booleanParam)
           
 void preDeregister()
           
 javax.management.ObjectName preRegister(javax.management.MBeanServer mBeanServer, javax.management.ObjectName obj)
           
protected  void registered(javax.management.MBeanServer mBeanServer, javax.management.ObjectName obj)
          This is a preRegistration call out if any special behavior is needed and the developer doesn't want to over write preRegistration
 JmxServiceObj[] resolve(JmxServiceObj jso, int low, int high)
          if the threshHold is not lower than low or higher or than high and the bean is active, and the jso is inNameSpace, then it will call handleRequest, else it returns a null
 void setActive(boolean b)
           
 void setCachable(boolean b)
           
 void setNameSpace(java.lang.String s)
           
 void setThreshHold(int i)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

mbeanServer

protected javax.management.MBeanServer mbeanServer

objectName

protected javax.management.ObjectName objectName
Constructor Detail

MBeanResolver

public MBeanResolver()
Method Detail

resolve

public JmxServiceObj[] resolve(JmxServiceObj jso,
                               int low,
                               int high)
if the threshHold is not lower than low or higher or than high and the bean is active, and the jso is inNameSpace, then it will call handleRequest, else it returns a null

Specified by:
resolve in interface MBeanResolverMBean

inNameSpace

protected boolean inNameSpace(JmxServiceObj jso)
if the jso is null, it returns a false. if the jso.getNameSpace is null, it returns a true. if the jso name space is "DEFAULT", it returns a true jso name space is the reolver's name space, or a child of it, it returns a true. else it returns a false


handleMBeanRequest

protected JmxServiceObj[] handleMBeanRequest(JmxServiceObj jso)
this is what all the children MBeanResolvers should over write.


handleAgentRequest

protected JmxServiceObj[] handleAgentRequest(JmxServiceObj jso)

registered

protected void registered(javax.management.MBeanServer mBeanServer,
                          javax.management.ObjectName obj)
This is a preRegistration call out if any special behavior is needed and the developer doesn't want to over write preRegistration


getNameSpace

public java.lang.String getNameSpace()
Specified by:
getNameSpace in interface MBeanResolverMBean

setNameSpace

public void setNameSpace(java.lang.String s)
Specified by:
setNameSpace in interface MBeanResolverMBean

getActive

public boolean getActive()
Specified by:
getActive in interface MBeanResolverMBean

setActive

public void setActive(boolean b)
Specified by:
setActive in interface MBeanResolverMBean

getCachable

public boolean getCachable()
Specified by:
getCachable in interface MBeanResolverMBean

setCachable

public void setCachable(boolean b)
Specified by:
setCachable in interface MBeanResolverMBean

getThreshHold

public int getThreshHold()

setThreshHold

public void setThreshHold(int i)

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface javax.management.MBeanRegistration

postRegister

public void postRegister(java.lang.Boolean booleanParam)
Specified by:
postRegister in interface javax.management.MBeanRegistration

preDeregister

public void preDeregister()
                   throws java.lang.Exception
Specified by:
preDeregister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer mBeanServer,
                                               javax.management.ObjectName obj)
                                        throws java.lang.Exception
Specified by:
preRegister in interface javax.management.MBeanRegistration
Throws:
java.lang.Exception