cancel
Showing results for 
Search instead for 
Did you mean: 

Registration on deloyment

Former Member
0 Kudos

Hi all,

Do you know if there is a possibility to call a given method when an EJB is deployed?

I know that it is possible to use the annotation @PostConstruct to execute some kind of "registration" work. In my case, it should be done when the engine is starting.

Thanks and best regards,

David

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi,

Using a servlet you can a Servlet context listener(javax.Servlet.ServletContextListener). This can be used to invoke a method which can some job, this servelt can be packed with your EAR.

Former Member
0 Kudos

Hi Vivek,

Thanks for the information but we don't wanna register when the servlet is called but at startup. The init method of the Servlet seems to be the right candidate for this!

Can anyone confirm?

Thanks and best regards,

David

Former Member
0 Kudos

Yes init also can be used, I have done this for creating some Timer service.(something like javax.ejb.Timer)

regards

Vivek Nidhi

Answers (0)