1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22 package de.bea.domingo.threadpool;
23
24 import de.bea.domingo.DNotesMonitor;
25
26 /***
27 * Default implementation of the <code>ThreadFactory</code> interface.
28 */
29 public final class DefaultThreadFactory implements ThreadFactory {
30
31 /*** Reference to the associated monitor. */
32 private final DNotesMonitor monitor;
33
34 /***
35 * @param theMonitor ThreadPool monitor
36 *
37 * Default constructor.
38 */
39 public DefaultThreadFactory(final DNotesMonitor theMonitor) {
40 super();
41 this.monitor = theMonitor;
42 }
43
44 /***
45 * {@inheritDoc}
46 * @see de.bea.domingo.threadpool.ThreadFactory#createThread(java.lang.Runnable)
47 */
48 public Thread createThread(final Runnable target) {
49 return new Thread(target);
50 }
51
52 /***
53 * {@inheritDoc}
54 * @see de.bea.domingo.threadpool.ThreadFactory#initThread()
55 */
56 public void initThread() {
57 }
58
59 /***
60 * {@inheritDoc}
61 * @see de.bea.domingo.threadpool.ThreadFactory#termThread()
62 */
63 public void termThread() {
64 }
65
66 /***
67 * {@inheritDoc}
68 * @see de.bea.domingo.threadpool.ThreadFactory#handleThrowable(java.lang.Throwable)
69 */
70 public void handleThrowable(final Throwable throwable) {
71 monitor.error(throwable.getMessage(), throwable);
72 }
73 }