Hi!
I'm trying to use persistent jmx-beans in Spring.
I can set and get the attribute foo, but I can't persist the attribute.
Any suggestion whats wrong?
My class looks like this
@ManagedResource
(description="My Managed Bean", objectName="spring:bean=testPersistent",
persistPolicy="OnUpdate", persistLocation="foo", persistName="foo.jmx")
public class TestingJmxAnnotationsImpl {
private int foo;
@ManagedAttribute (description="The Foo Attribute", persistPolicy="OnUpdate")
public void setFoo(int foo) {
this.foo = foo;
}
@ManagedAttribute (description="The Foo Attribute", defaultValue="18")
public int getFoo() {
return foo;
}
I use the java 1.5 built in server like this
<bean id="jmx.mbeanServer"
class="java.lang.management.ManagementFactory"
factory-method="getPlatformMBeanServer" />
and the spring 1.2.6 wireing is made like this:
<bean id="jmx.exporter2"
class="org.springframework.jmx.export.MBeanExporte r">
<property name="beans">
<map>
<entry key="bean:name=testing"
value-ref="jmx.test" />
</map>
</property>
<property name="assembler">
<bean
class="org.springframework.jmx.export.assembler.Me tadataMBeanInfoAssembler">
<property name="attributeSource">
<ref local="jmx.attributeSource" />
</property>
</bean>
</property>
</bean>
<bean id="jmx.attributeSource"
class="org.springframework.jmx.export.annotation.A nnotationJmxAttributeSource">
</bean>
<bean id="jmx.test"
class="test.jmx.TestingJmxAnnotationsImpl">
</bean>
Regards
Gunnar


Reply With Quote