[jboss-user] [Beginner's Corner] - @Service annotated bean lifecycle methods

piotrekde do-not-reply at jboss.com
Sat Feb 19 14:31:24 EST 2011

piotrekde [http://community.jboss.org/people/piotrekde] created the discussion

"@Service annotated bean lifecycle methods"

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


I use org.jboss.ejb3.annotation.Service annotated bean as singleton. I'd like to perform some bean initialization before it will be used by other components (e.g. instantiate some local POJO fields by calling constructors). As it is stated in documentation:

 http://docs.jboss.org/ejb3/app-server/reference/build/reference/en/html/jboss_extensions.html http://docs.jboss.org/ejb3/app-server/reference/build/reference/en/html/jboss_extensions.html

I implemented: 
public void start() throws Exception

void create() throws Exception 

methods, but none of them is called upon @Service bean is created (no entries in logs).

I've read documentation couple of times, and now I am not sure if this methods are also applicable for @Service beans or maybe only for @Managment.
What are the correct annotations/method signatures to do such @Service bean initialization?

Thanks in advance,

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/20110219/3ac33526/attachment.html 

More information about the jboss-user mailing list