1 45 package org.openejb.server.telnet; 46 47 import java.io.DataInputStream ; 48 import java.io.IOException ; 49 import java.io.PrintStream ; 50 import java.net.InetAddress ; 51 52 55 public class Stop extends Command { 56 57 public static void register() { 58 Command.register("stop", Stop.class); 59 } 60 61 public void exec(Arguments args, DataInputStream in, PrintStream out) throws IOException { 62 try{ 63 String addr = Thread.currentThread().getName(); 64 InetAddress client = InetAddress.getByName(addr); 65 66 } catch (SecurityException e){ 68 out.println("Permission denied. "+e.getMessage()); 69 } catch (Exception e){ 70 out.println("Error occured. "+ e.getMessage() ); 71 } 72 try{ 73 Thread.sleep(2000); 74 } catch (Throwable t){ 75 } 76 } 77 78 } 79 80 | Popular Tags |