[jboss-user] [Microcontainer] - start() and stop() methods in a MC bean

jaikiran do-not-reply at jboss.com
Mon Feb 23 03:05:14 EST 2009


I have a simple MC bean with a method named start and annotated with @InstallMethod:

public class MyBean
  | {
  | 
  |  @InstallMethod
  |  public void start() throws Exception
  |  {
  |   // do something
  |  }
  | 
  |  @UnInstallMethod
  |  public void stop() throws Exception 
  |  {
  |   // do something
  |  }
  | }
  | 
  | 
  | 

When this MC bean is deployed, the start() method gets called twice. From what i can see in the logs, its being called when the bean enters the START stage and the INSTALL stage. The note in this document http://www.jboss.org/file-access/default/members/jbossmc/freezone/docs/2.0.x/userGuide/ch05s04.html states that any method named start() (and stop) are considered as MBean start/stop methods and are called during the START/STOP stage.

But shouldn't those methods be skipped during start/stop, if they are annotated for something else - as in this example @InstallMethod.

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

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



More information about the jboss-user mailing list