-
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");
}
}
-
Happiness is good health and a bad memory.
Similar Threads
-
By ashiers in forum Open Source
Replies: 0
Last Post: 11-16-2005, 06:34 PM
-
Replies: 1
Last Post: 11-30-2001, 10: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
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks