1 28 29 package org.objectweb.util.launcher ; 30 31 import org.objectweb.util.trace.TraceSystem; 32 33 45 public class ModeThread 46 extends Thread 47 implements Mode 48 { 49 50 protected CommandJava command_ ; 51 52 55 public void run() { 56 command_.execute(); 57 } 58 59 64 public void execute(CommandJava cmd) { 65 this.command_ = cmd ; 66 this.setName(cmd.getName()); 67 TraceSystem.get("launcher").debug("Starting new Thread "+this.getName()); 68 this.start(); 69 try { 70 this.join(); 71 TraceSystem.get("launcher").debug("Thread "+this.getName()+" terminated."); 72 } catch(java.lang.InterruptedException ex) { 73 TraceSystem.get("launcher").error("Exception raised: "+ex); 74 throw new LauncherException(ex); 75 } 76 } 77 } 78 | Popular Tags |