KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > sapia > magnet > test > TestApp


1 package org.sapia.magnet.test;
2
3 /**
4  *
5  * @author Jean-Cedric Desrochers
6  *
7  * <dl>
8  * <dt><b>Copyright:</b><dd>Copyright &#169; 2002-2003 <a HREF="http://www.sapia-oss.org">Sapia Open Source Software</a>. All Rights Reserved.</dd></dt>
9  * <dt><b>License:</b><dd>Read the license.txt file of the jar or visit the
10  * <a HREF="http://www.sapia-oss.org/license.html" target="sapia-license">license page</a> at the Sapia OSS web site</dd></dt>
11  * </dl>
12  */

13 public class TestApp {
14   public static void main(String JavaDoc[] args) {
15     long aStart = System.currentTimeMillis();
16     try {
17       StringBuffer JavaDoc aBuffer = new StringBuffer JavaDoc();
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 JavaDoc();
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 JavaDoc();
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 JavaDoc();
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 JavaDoc e) {
49       e.printStackTrace();
50     }
51   }
52 }
53
Popular Tags