1
2
3
4
5
6
7
8
9
10
11 package org.astrogrid.applications.manager;
12
13 import org.astrogrid.component.descriptor.ComponentDescriptor;
14
15 import org.picocontainer.Startable;
16
17 import junit.framework.Test;
18
19 import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;
20 import EDU.oswego.cs.dl.util.concurrent.PooledExecutor;
21
22 /*** customization of the standard pooled executor - to fit in better with our component system, and to provide default configuration.
23 * default configuration is an unbounded queue, max of 100 worker threads, minimum of 4 concurrent threads.
24 * @author Noel Winstanley nw@jb.man.ac.uk 14-Sep-2004
25 *
26 */
27 public class CeaThreadPool extends PooledExecutor implements
28 ComponentDescriptor, Startable {
29
30 /*** Construct a new CeaThreadPool
31 *
32 */
33 public CeaThreadPool() {
34 super(new LinkedQueue(),100);
35 super.setMinimumPoolSize(4);
36 }
37
38 /***
39 * @see org.astrogrid.component.descriptor.ComponentDescriptor#getName()
40 */
41 public String getName() {
42 return "CeaThreadPool";
43 }
44
45 /***
46 * @see org.astrogrid.component.descriptor.ComponentDescriptor#getDescription()
47 */
48 public String getDescription() {
49 return "Current number of worker threads " + super.getPoolSize();
50 }
51
52 /***
53 * @see org.astrogrid.component.descriptor.ComponentDescriptor#getInstallationTest()
54 */
55 public Test getInstallationTest() {
56 return null;
57 }
58
59 /***
60 * @see org.picocontainer.Startable#start()
61 */
62 public void start() {
63 }
64
65 /*** tell the threads in the pool to stop processing.
66 * @see org.picocontainer.Startable#stop()
67 */
68 public void stop() {
69 this.shutdownNow();
70 }
71
72
73 }
74
75
76
77
78
79
80
81
82
83
84
85
86
87