java ee - How to Execute a Class when server is Starting -


i have dynamic webproject created in eclipse glassfish server, want execute specific class automatically when server started. class has listener listens jms queue, how can achieve this? have configure in web.xml? if how it? code example appreciated.

there alot of ways achieve this. can make startup ejb singleton. this:

@singleton @startup public class mystartupbean {     @postconstruct     private void init() {         log.info("initializing startup bean");         // stuff     } } 

Comments

Popular posts from this blog

commonjs - How to write a typescript definition file for a node module that exports a function? -

openid - Okta: Failed to get authorization code through API call -

ios - Change Storyboard View using Seague -