tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Remy Maucherat <r...@apache.org>
Subject [5.0] Threads scalability refactoring
Date Thu, 22 May 2003 18:18:00 GMT
I have examined a few possible solutions, including Timers (JDK 1.3) or 
JMX (JMX 1.2). It seems that a custom solution would be better, and I 
propose adding that in the Container interface.

Rather than a long talk, here's my proposed patch to Container. The 
Javadocs include what it is supposed to do.

Refactoring the current code to fit in the new model will be very easy. 
For security consious deployments, it is possible to associate a thread 
per engine, per host, or per context (for maximum isolation, but in that 
case there's little gain compared to what there today).

RCS file: 
/home/cvs/jakarta-tomcat-catalina/catalina/src/share/org/apache/catalina/Container.java,v
retrieving revision 1.3
diff -r1.3 Container.java
255a256,277
 >      * Get the delay between the invocation of the execute method on
 >      * this container and its children. Child containers will not be 
invoked
 >      * if their delay value is not negative (which would mean they 
are using
 >      * their own thread). Setting this to a positive value will cause
 >      * a thread to be spawn. After waiting the specified amount of time,
 >      * the thread will invoke the executePeriodic method on this 
container
 >      * and all its children.
 >      */
 >     public int getExecuteDelay();
 >
 >
 >     /**
 >      * Set the delay between the invocation of the execute method on this
 >      * container and its children.
 >      *
 >      * @param delay The delay in seconds between the invocation of 
execute
 >      *              methods
 >      */
 >     public void setExecuteDelay(int delay);
 >
 >
 >     /**
347a370,377
 >
 >
 >     /**
 >      * Execute a periodic task, such as reloading, etc. This method 
will be
 >      * invoked inside the classloading context of this container. 
Unexpected
 >      * throwables will be caught and logged.
 >      */
 >     public void execute();

Remy


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


Mime
View raw message