This week's book giveaway is in the OO, Patterns, UML and Refactoring forum.
We're giving away four copies of Refactoring for Software Design Smells: Managing Technical Debt and have Girish Suryanarayana, Ganesh Samarthyam & Tushar Sharma on-line!
See this thread for details.
The moose likes EJB and other Java EE Technologies and the fly likes EAR post install hook to run a class? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "EAR post install hook to run a class?" Watch "EAR post install hook to run a class?" New topic
Author

EAR post install hook to run a class?

Xolani Nkosi
Ranch Hand

Joined: Apr 29, 2009
Posts: 32
Is there a standard way to tell an application server that, once it's installed an EAR, it should run a class contained therein? I'd like to be able to drop a configuration class into an EAR such that, once it's installed somewhere, it runs and sets up some local configuration.

If not a standard way, is there a Websphere specific way of doing this?

Or am I going to be limited to creating something that runs every time on startup, but does this configuration the first time only?
Davide Crudo
Ranch Hand

Joined: Sep 08, 2009
Posts: 62

I would recommend using the @Startup annotation.
Of course it will run on each server restart, but you
could use it to do some other checks or things...




SCJP, SCBCD
 
Have you checked out Aspose?
 
subject: EAR post install hook to run a class?
 
It's not a secret anymore!