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