01: /*
02: *
03: * Jsmtpd, Java SMTP daemon
04: * Copyright (C) 2005 Jean-Francois POUX, jf.poux@laposte.net
05: *
06: * This program is free software; you can redistribute it and/or
07: * modify it under the terms of the GNU General Public License
08: * as published by the Free Software Foundation; either version 2
09: * of the License, or (at your option) any later version.
10: *
11: * This program is distributed in the hope that it will be useful,
12: * but WITHOUT ANY WARRANTY; without even the implied warranty of
13: * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14: * GNU General Public License for more details.
15: *
16: * You should have received a copy of the GNU General Public License
17: * along with this program; if not, write to the Free Software
18: * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19: *
20: */
21: package org.jsmtpd.generic.threadpool;
22:
23: /**
24: * A simple test of implementation
25: * @author Jean-Francois POUX
26: */
27: public class DummyThread implements IThreadedClass {
28:
29: private String prm = "nada";
30:
31: public void doJob() {
32: System.out
33: .println("DummyTh working "
34: + Thread.currentThread().getId()
35: + " with param " + prm);
36:
37: Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
38: //int cpt = 0;
39:
40: // try {
41: // while (true) {
42: // if (false)
43: // break;
44: //
45: // cpt++;
46: // System.out.println(cpt);
47: // }
48: // } catch (Exception ie) {
49: // ie.printStackTrace();
50: // }
51:
52: try {
53: Thread.sleep(500);
54: } catch (InterruptedException e) {
55: e.printStackTrace();
56: }
57: System.out.println("DummyTh end"
58: + Thread.currentThread().getId());
59: }
60:
61: /* (non-Javadoc)
62: * @see smtpd.common.ThreadPool.ThreadedClass#forceShutdown()
63: */
64: public void forceShutdown() {
65:
66: }
67:
68: /* (non-Javadoc)
69: * @see smtpd.common.ThreadPool.ThreadedClass#gracefullShutdown()
70: */
71: public void gracefullShutdown() {
72:
73: }
74:
75: /* (non-Javadoc)
76: * @see smtpd.common.ThreadPool.ThreadedClass#setParam(java.lang.Object)
77: */
78: public void setParam(Object o) {
79: prm = (String) o;
80:
81: }
82:
83: }
|