Hello again!
Trying to use another implementation of the ModelMBean (i.e. the
RequiredModelMBean) with Modeler raised some problems.
I have a working xml configuration which instantiate a BaseModelMBean
for a class that has some getter properties.
For example I have a class Foo like this:
<snip>
public class Foo
{
private String a = "This is a string";
public String getA() { return a; }
}
</snip>
and the following xml configuration file:
<mbean
name="myDomain:name=Foo"
type="Foo">
<attribute
name="A"
displayName="A"
description="(no description)"
is="false"
getMethod="getA"
writeable="false"
type="java.lang.String">
</attribute>
</mbean>
Using the BaseModelMBean shows me the value and everything is working
okay - however using the standard implementation for ModelMBean, i.e.
"RequiredModelMBean" (and ofc adding this to the xml file)
<mbean
...
className="javax.management.modelmbean.RequiredModelMBean"
...
</mbean>
show a totally different story. Instead of the property value - "this
is a String" I get :
<snip>
UNAVAILABLE: javax.management.MBeanException wraps
[javax.management.ServiceNotFoundException: operation getA execution not supported
from mbeaninfo data]
</snip>
Basically the operation for the getter is not set in the MBeanInfo
data. More over when adding the required descriptor field in the xml
file like:
<operation
name="getA"
impact="INFO"
returnType="void">
<descriptor>
<field name="role" value="getter"/>
</descriptor>
</operation>
does the trick but in the web console I got a new operation exposed
(using BaseModelMBean doesn't).
So clearly there are some inconsistency between the
RequiredModelMBean and BaseModelMBean - should they have the same
metadata?
Am I right or rather missing something here?
--
Best regards,
Costin mailto:[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]