1 2 package SOFA.SOFAnode.Made.TIR.Access.Browser; 3 import java.rmi.Naming ; 4 5 import SOFA.SOFAnode.Made.TIR.ManageRepository; 6 import SOFA.SOFAnode.Made.TIR.WorkRepository; 7 8 9 public class KillAll { 10 public static void main(String [] argv) { 11 try { 12 System.setSecurityManager(new java.rmi.RMISecurityManager ()); 13 14 String rmiport = System.getProperty("sofa.rmiport","1099"); 15 String rmihost = System.getProperty("sofa.rmihost","localhost"); 16 ManageRepository rep = (ManageRepository) Naming.lookup("//"+rmihost+":"+rmiport+"/Repository"); 17 18 WorkRepository[] wr = rep.getActiveWork(); 19 20 if (wr.length==0) { 21 System.out.println("No active"); 22 return; 23 } 24 for(int i=0;i<wr.length;i++) { 25 System.out.print("Aborting "+wr[i].workIdent()+"..."); 26 if (wr[i].abort()) 27 System.out.println("OK"); 28 else 29 System.out.println("Error!"); 30 } 31 32 33 } catch (Exception e) { 34 System.out.println("Exception: " + e.getMessage()); 35 e.printStackTrace(); 36 } 37 } 38 } 39 | Popular Tags |