|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.ecyrd.management.SimpleMBean
public abstract class SimpleMBean
A simple MBean which does not require an interface class unlike the StandardMBean class. The methods are exposed through a method call, which in turn then calls the methods using the Reflection API.
This class is similar to the javax.management.StandardMBean, but it does require the API interface to be declared, so it's simpler. It's not as powerful, but it does not require you to declare two classes (and keep them in sync).
| Field Summary | |
|---|---|
protected MBeanInfo |
m_beanInfo
|
| Constructor Summary | |
|---|---|
protected |
SimpleMBean()
Create a new SimpleMBean |
| Method Summary | |
|---|---|
Object |
getAttribute(String name)
Gets an attribute using reflection from the MBean. |
abstract String[] |
getAttributeNames()
This method must return a list of attributes which are exposed by the SimpleMBean. |
AttributeList |
getAttributes(String[] arg0)
Gets multiple attributes at the same time. |
protected String |
getDescription()
Customization hook: Override this to get a description for your MBean. |
MBeanInfo |
getMBeanInfo()
Return the MBeanInfo structure. |
abstract String[] |
getMethodNames()
This method must return a list of operations which are to be exposed by the SimpleMBean. |
Object |
invoke(String arg0,
Object[] arg1,
String[] arg2)
Invokes a particular method. |
void |
setAttribute(Attribute attr)
|
AttributeList |
setAttributes(AttributeList arg0)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected MBeanInfo m_beanInfo
| Constructor Detail |
|---|
protected SimpleMBean()
throws NotCompliantMBeanException
NotCompliantMBeanException| Method Detail |
|---|
protected String getDescription()
public Object getAttribute(String name)
throws AttributeNotFoundException,
MBeanException,
ReflectionException
getAttribute in interface DynamicMBeanname - Name of the attribute to find.
AttributeNotFoundException - If there is not such attribute
MBeanException
ReflectionExceptionpublic AttributeList getAttributes(String[] arg0)
getAttributes in interface DynamicMBeanarg0 - The attribute names to get
public MBeanInfo getMBeanInfo()
getMBeanInfo in interface DynamicMBean
public Object invoke(String arg0,
Object[] arg1,
String[] arg2)
throws MBeanException,
ReflectionException
invoke in interface DynamicMBeanarg0 - Method namearg1 - A list of arguments for the invocation
MBeanException
ReflectionException
public void setAttribute(Attribute attr)
throws AttributeNotFoundException,
InvalidAttributeValueException,
MBeanException,
ReflectionException
setAttribute in interface DynamicMBeanAttributeNotFoundException
InvalidAttributeValueException
MBeanException
ReflectionExceptionpublic AttributeList setAttributes(AttributeList arg0)
setAttributes in interface DynamicMBeanpublic abstract String[] getAttributeNames()
public void setFoo( String foo ) ...
public String getFoo() ...
public String[] getAttributeNames()
{
String[] attrs = { "foo" };
return attrs;
}
Also, methods starting with "is" are also recognized as getters
(e.g. public boolean isFoo().)
public abstract String[] getMethodNames()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||