You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tomcat.apache.org by micael <ca...@harbornet.com> on 2002/12/09 19:12:11 UTC

--> Starting and Stopping Applications in Servlets: Re: Threads of Control

At 05:17 PM 12/8/2002 -0800, you wrote:
>Can a servlet start an application on a server which is available to a 
>user on the server machine?  Something, i.e., like the following:
>
>import java.io.*;
>import java.util.*;
>import javax.servlet.*;
>import javax.servlet.http.*;
>
>public class AppCtrl extends HttpServlet implements Runnable {
>   private boolean change;
>   private Thread ctrl;
>   private App [] app;
>
>   public void init() throws ServletException() {
>     ctrl = new Thread(this);
>     ctrl.setPriority(Thread.MIN_PRIORITY);
>     ctrl.start();
>   }
>
>   public void run() {
>     while(true) {
>       if(AppProps.change()) {
>         app = AppProps.changes();
>         for(int i = 0; i < app.length; i++) {
>           AppManager.implementChange(app[i]);
>           try {
>             ctrl.sleep(200); // .2 second break between changes.
>           } catch (InterruptedException ignored) {
>           }
>         }
>       }
>     }
>   }
>}
>
>
>Micael
>
>-------------------------------------------------------
>
>This electronic mail  transmission and any accompanying documents contain 
>information belonging to the sender which may be confidential and legally 
>privileged.  This information is intended only for the use of the 
>individual or entity to whom this electronic mail transmission was sent as 
>indicated above. If you are not the intended recipient, any disclosure, 
>copying, distribution, or action taken in reliance on the contents of the 
>information contained in this transmission is strictly prohibited.  If you 
>have received this transmission in error, please delete the 
>message.  Thank you
>
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>

Micael

-------------------------------------------------------

This electronic mail  transmission and any accompanying documents contain 
information belonging to the sender which may be confidential and legally 
privileged.  This information is intended only for the use of the 
individual or entity to whom this electronic mail transmission was sent as 
indicated above. If you are not the intended recipient, any disclosure, 
copying, distribution, or action taken in reliance on the contents of the 
information contained in this transmission is strictly prohibited.  If you 
have received this transmission in error, please delete the message.  Thank 
you  



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>