KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfox > pool > thread > Test


1 /* JFox, the OpenSource J2EE Application Server
2  *
3  * Distributable under GNU LGPL license by gun.org
4  * more details please visit http://www.huihoo.org/jfox
5  */

6
7 package org.jfox.pool.thread;
8
9 /**
10  * @author <a HREF="mailto:young_yy@hotmail.com">Young Yang</a>
11  */

12
13 public class Test {
14
15     public static void main(String JavaDoc[] args) {
16         ThreadPool tp = new SimpleThreadPool();
17         for(int c = 1; c < 100; c++) {
18             tp.execute(new TestClass(c + ""));
19         }
20     }
21 }
22
23 class TestClass implements Threadable {
24     private String JavaDoc name;
25
26     public TestClass(String JavaDoc name) {
27         this.name = name;
28     }
29
30     public void run() {
31         System.out.println("TestClass: " + name);
32     }
33 }
Popular Tags