By implementing ServiceMBean (which extends Service) you just get 3 extra 
attributes Name, State and StateString. The last is useful to have a visual 
view of the state of the service in the jmx-console.

Finally there is the method jbossInternalLifecycle() which is used to 
coordinate your service with the service controller, and start/stop dependent 
services whenever you start/stop your service.

ServiceMBean really goes hand-in-hand with 
ServiceMBeanSupport/ListenerServiceMBeanSupport which implement this interface 
for you. It handles correctly jbossInternalLifecycle() and also emits 
AttributeChange events when the State of the service changes, from 
starting->started->stopping->stopped, or failed.

So the questions really is whether you extend or not one of the support classes 
(then you get the MBeanService implementation for free).

Otherwise you are probably better-off not implementing ServiceMBean, or even 
Service, and just write a simple POJO class with optional service lifecyle 
methods (create/start/stop/destroy) and wrap this with an XMBean descriptor.

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3856682#3856682

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3856682


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. 
http://productguide.itmanagersjournal.com/
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to