Announcement Announcement Module
Collapse
No announcement yet.
java 5 persist attribute Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • java 5 persist attribute

    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

  • #2
    I'm not sure if the JMX implementation packed within JDK 1.5 has such functionality. Try using MX4j or the JMX-RI and see if you still have the issue.

    Comment


    • #3
      Hello,

      do you have any results concerning this topic?

      Cheers,
      Martin

      Comment


      • #4
        No, I continued with the standard Java 1.5 and created a class of my own to update the property file.
        Cheers,
        Gunnar

        Comment


        • #5
          Alright, thanx for your answer!

          Cheers,
          Martin

          Comment

          Working...
          X