You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by to...@the-morg.org on 2005/06/01 13:23:13 UTC

Your advise with Background Thread Creation / Management ?

I would like to include code within the WAR that instates itself after the Web Context has been sucessfully initialised, this context will create one (or more) background threads.  This should instate itself at context initialisation through deployment (independantly of any website activity).

I would then like to get access to one or more exposed API classes from my web application.  This will be a simple start/stop/status.   I believe the JNDI to be limited within tomcat, would I have to implement my own lookup mechanism to find or could I dynamically register control classes in JNDI for my WebApp to lookup and access ?

The code is fairly specific to the WAR as-in I would like to distribute it within the WAR and have it register for init and cleanup call to startup/shutdown threads based on deployment status changes.  So when I upgrade my WAR it will also upgrade this thread manager an worker task classes.


I have looked at JMX/MBean and this looks like it may fit, given my spec could anyone advise ?   Would I be correct in saying I can create an mbean-descriptor.xml file within my WAR in the same package as my management class, that it does not have to be installed in JAR files installed into $CATALINA_HOME/server/lib, I'm trying to simplify deployment issues ?

Am I free to create threads within my management class within tomcats JVM ?

--
Darryl L. Miles

---------------------------------------------------------------------
To unsubscribe, e-mail: tomcat-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tomcat-user-help@jakarta.apache.org