[jboss-user] [Beginner's Corner] - POJO Service in an ear to provide lifecycle hooks?

Tim Haley do-not-reply at jboss.com
Tue Mar 1 10:27:34 EST 2011

Tim Haley [http://community.jboss.org/people/ymaraner] created the discussion

"POJO Service in an ear to provide lifecycle hooks?"

To view the discussion, visit: http://community.jboss.org/message/590372#590372

I have an enterprise application that currently deploys and runs on WebSphere and Weblogic that I would like to port to JBoss. When the application is started, there is some initialization code that needs to be run. When the application is stopped, there is some cleanup code that needs to be run. I am trying to determine the proper way to do this in JBoss 5. On another thread, I read that a Service MBean could provide that functionality. Can I simply annotate an EJB 3.0 stateful session bean with @Service to make it a singleton, @Management to make it an MBean, implement the management lifecycle methods and package the bean inside my ear file? The documentation says that the lifecycle methods are for the lifecycle of the bean, will my bean have the same lifecycle as my application? How can I ensure that it does? I would appreciate any help you can provide, including pointing me to the right place in the documentation.

Reply to this message by going to Community

Start a new discussion in Beginner's Corner at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20110301/c8acdf28/attachment-0001.html 

More information about the jboss-user mailing list