Announcement Announcement Module
Collapse
No announcement yet.
Expose MBean: want to see only interface methods. Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Expose MBean: want to see only interface methods.

    How can I expose an MBean where only the interface of the MBean is made public.

    example:

    Code:
    interface FooMBean{ 
        void start();
    }
    
    classs FooMBeanImpl implements FooMBean{
        private FooService fooService;
    
        public void setFooService(FooService fooService){
            this.fooService = fooService;
        }
    
        public void start(){
           fooService.start();
        }
    }
    If I expose the FooMBean with an exporter, I also see the methods of the implementation and this isn't what I want.

    example:

    Code:
     <bean id="fooMBean"
            class="FooMBeanImpl">
    
            <property name="fooService" ref="fooService"/>
        </bean>
    
        <bean id="exporter"
              class="org.springframework.jmx.export.MBeanExporter">
            <property name="beans">
                <map>
                    <entry key="jteam:bean=fooMBean" value-ref="fooMBean"/>
                </map>
             </property>
        </bean>

  • #2
    Check out this section of the manual: 19.3.6. Defining Management Interfaces using Java Interfaces

    Comment

    Working...
    X