| 1 package org.sapia.magnet.test; 2 3 13 public class TestApp { 14 public static void main(String [] args) { 15 long aStart = System.currentTimeMillis(); 16 try { 17 StringBuffer aBuffer = new StringBuffer (); 18 aBuffer.append(System.currentTimeMillis()-aStart).append(" ["). 19 append(Thread.currentThread().getName()).append("] "). 20 append("Excuting the TestApp.main() method"); 21 System.out.println(aBuffer.toString()); 22 23 aBuffer = new StringBuffer (); 24 aBuffer.append(System.currentTimeMillis()-aStart).append(" ["). 25 append(Thread.currentThread().getName()).append("] "). 26 append("With the arguments: "); 27 if (args.length == 0) { 28 aBuffer.append("[]"); 29 } else { 30 for (int i = 0 ; i < args.length; i++) { 31 aBuffer.append("[").append(args[i]).append("] "); 32 } 33 } 34 System.out.println(aBuffer.toString()); 35 36 aBuffer = new StringBuffer (); 37 aBuffer.append(System.currentTimeMillis()-aStart).append(" ["). 38 append(Thread.currentThread().getName()).append("] "). 39 append("TestApp was loaded from the classloader ").append(TestApp.class.getClassLoader()); 40 System.out.println(aBuffer.toString()); 41 42 aBuffer = new StringBuffer (); 43 aBuffer.append(System.currentTimeMillis()-aStart).append(" ["). 44 append(Thread.currentThread().getName()).append("] "). 45 append("The jc context class loader of the thread is ").append(Thread.currentThread().getContextClassLoader()); 46 System.out.println(aBuffer.toString()); 47 Thread.sleep(30000); 48 } catch (Exception e) { 49 e.printStackTrace(); 50 } 51 } 52 } 53 | Popular Tags |