KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jsmtpd > generic > threadpool > DummyThread


1 /*
2  *
3  * Jsmtpd, Java SMTP daemon
4  * Copyright (C) 2005 Jean-Francois POUX, jf.poux@laposte.net
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * 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 JavaDoc prm = "nada";
30
31     public void doJob() {
32         System.out.println("DummyTh working " + Thread.currentThread().getId() + " with param " + prm);
33
34         Thread.currentThread().setPriority(Thread.MIN_PRIORITY);
35         //int cpt = 0;
36

37 // try {
38
// while (true) {
39
// if (false)
40
// break;
41
//
42
// cpt++;
43
// System.out.println(cpt);
44
// }
45
// } catch (Exception ie) {
46
// ie.printStackTrace();
47
// }
48

49                 try {
50                     Thread.sleep(500);
51                 } catch (InterruptedException JavaDoc e) {
52                     e.printStackTrace();
53                 }
54         System.out.println("DummyTh end" + Thread.currentThread().getId());
55     }
56
57     /* (non-Javadoc)
58      * @see smtpd.common.ThreadPool.ThreadedClass#forceShutdown()
59      */

60     public void forceShutdown() {
61
62     }
63
64     /* (non-Javadoc)
65      * @see smtpd.common.ThreadPool.ThreadedClass#gracefullShutdown()
66      */

67     public void gracefullShutdown() {
68         
69     }
70
71     /* (non-Javadoc)
72      * @see smtpd.common.ThreadPool.ThreadedClass#setParam(java.lang.Object)
73      */

74     public void setParam(Object JavaDoc o) {
75         prm = (String JavaDoc) o;
76
77     }
78
79 }
Popular Tags