Results 1 to 5 of 5

Thread: java 5 persist attribute

  1. #1

    Question 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. #2
    Join Date
    Jan 2005
    Location
    Bucharest, Romania
    Posts
    5,403

    Default

    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.
    Costin Leau
    SpringSource - http://www.SpringSource.com- Spring Training, Consulting, and Support - "From the Source"
    http://twitter.com/costinl
    Please use [ c o d e ] [ / c o d e ] tags

  3. #3

    Default

    Hello,

    do you have any results concerning this topic?

    Cheers,
    Martin

  4. #4

    Default

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

  5. #5

    Default

    Alright, thanx for your answer!

    Cheers,
    Martin

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •