PDA

View Full Version : Expose MBean: want to see only interface methods.


Alarmnummer
May 16th, 2006, 10:13 AM
How can I expose an MBean where only the interface of the MBean is made public.

example:


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:


<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>

wpoitras
May 16th, 2006, 01:32 PM
Check out this section of the manual: 19.3.6. Defining Management Interfaces using Java Interfaces (http://static.springframework.org/spring/docs/1.2.x/reference/jmx.html#jmx-interface-java)