This content has been marked as final.
Show 3 replies
-
1. Re: Invoke a method in my application during JBoss start up
lafr Jun 13, 2012 3:10 PM (in response to rakeshsagar)Option1: EJB 3.1
Create a SLSB with annotations @Singleton and @Startup.
An instance of this bean is instantiated on deployment of your application.
In a method annotated with @Init you can do your things.
Option 2: WebListener
@WebListener
public class StartupTimers implements ServletContextListener
{
public void contextInitialized( final ServletContextEvent sce )
{
// do your job here
}
}
-
2. Re: Invoke a method in my application during JBoss start up
rakeshsagar Jun 19, 2012 12:54 AM (in response to lafr)Thanks Frank. We will try both the options.
Thanks
Rakesh
-
3. Re: Invoke a method in my application during JBoss start up
jaikiran Jun 19, 2012 1:39 AM (in response to lafr)Frank Langelage wrote:
Option1: EJB 3.1
Create a SLSB with annotations @Singleton and @Startup.
Small correction - It's not a SLSB (stateless session bean), but it's a Singleton session bean.