thread to shut the tomcat and restart


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: thread to shut the tomcat and restart

  1. #1
    Join Date
    Dec 2005
    Posts
    1

    Exclamation thread to shut the tomcat and restart

    THIS IS WHAT I AM TRYING TO DO BUT AFTER STARTING THE TOMCAT MY THREAD IS NOT WAKING UP

    HELP PLEASE

    class Restarts extends Thread{
    String fileStart="",fileRestart="";
    String line,line1;
    public Restarts(String start1, String restart1){
    fileStart=start1;
    fileRestart=restart1;
    start();
    }
    public void run(){
    try{
    Process p = Runtime.getRuntime().exec(fileStart);
    BufferedReader input = new BufferedReader(new InputStreamReader(p.getInputStream()));
    while ((line = input.readLine()) != null) {
    System.out.println(line);
    }
    input.close();
    sleep(20000);
    Process p1 = Runtime.getRuntime().exec(fileRestart);
    BufferedReader input1 = new BufferedReader(new InputStreamReader(p1.getInputStream()));

    while ((line1 = input1.readLine()) != null) {
    System.out.println(line1);
    }
    input1.close();

    }
    catch(Exception e){
    e.printStackTrace();
    }
    }

    }

    class Restart
    {
    public static void main(String a[]){
    Restarts start = new Restarts("startup.bat","shutdown.bat");

    }
    }

  2. #2
    Join Date
    Oct 2005
    Location
    New Jersey
    Posts
    255
    Happiness is good health and a bad memory.

Similar Threads

  1. integrating Tomcat with Apache
    By ashiers in forum Open Source
    Replies: 0
    Last Post: 11-16-2005, 07:34 PM
  2. Replies: 1
    Last Post: 11-30-2001, 11:14 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center