There is a generic way to do this with web applications in the 2.2 
servlet spec and even a better way in 2.3.

In 2.2, you can just have a servlet that calls your initializer in it's 
init() method.  Then, in web.xml, define the load-on-startup element. 
That way, when your web app comes up, you get called.  You can also call 
a clean-up class in the servlet's destroy() method.

Now, in servlet 2.3, you can define a ServletContextListener (a servlet 
context is basically your web app) in the web.xml.  You will get 
notified via the contextInitialized and contextDestroyed methods.

Granted, each of these methods mean assumes you've got a web tier.  Even 
if you don't, it's not a horrible thing to just through your ejb jars in 
an ear along with a tiny war who's only job is to initialize some stuff.

Now, if you just wanted to now about startup/shutdown classes outside of 
your app and specific to jboss, I don't know.

Hope this helps,
David

--

Saroj Kumar wrote:
> Hi All,
> 
> I want to register a class as startup class in JBOSS3. This class should
> be loaded in memory when server is started. 
> 
> This class reads some properties and loads them in the memory. Other
> classes need to access these variables using ClassName.Method Names().
> 
> Please suggest me a way.
> Saroj
> 
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by: Jabber - The world's fastest growing 
> real-time communications platform! Don't just IM. Build it in! 
> http://www.jabber.com/osdn/xim
> _______________________________________________
> JBoss-user mailing list
> [EMAIL PROTECTED]
> https://lists.sourceforge.net/lists/listinfo/jboss-user



-- 

---------------------
David Ward
[EMAIL PROTECTED]
http://www.dotech.com



-------------------------------------------------------
This sf.net email is sponsored by: Jabber - The world's fastest growing 
real-time communications platform! Don't just IM. Build it in! 
http://www.jabber.com/osdn/xim
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to