KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > logicalcobwebs > proxool > StateResultMonitor


1 /*
2  * This software is released under a licence similar to the Apache Software Licence.
3  * See org.logicalcobwebs.proxool.package.html for details.
4  * The latest version is available at http://proxool.sourceforge.net
5  */

6 package org.logicalcobwebs.proxool;
7
8 import org.apache.commons.logging.Log;
9 import org.apache.commons.logging.LogFactory;
10
11 /**
12  * A ResultMonitor specifically for State
13  *
14  * @version $Revision: 1.4 $, $Date: 2006/01/18 14:40:06 $
15  * @author bill
16  * @author $Author: billhorsman $ (current maintainer)
17  * @since Proxool 0.8
18  */

19 public class StateResultMonitor extends ResultMonitor implements StateListenerIF {
20
21     private static final Log LOG = LogFactory.getLog(StateResultMonitor.class);
22
23     private int upState;
24
25     private int expectedUpState;
26
27     /**
28      * waits for statistics
29      * @return {@link #SUCCESS} or {@link #TIMEOUT}
30      * @throws Exception if anything goes wrong
31      */

32     public boolean check() throws Exception JavaDoc {
33         return (upState == expectedUpState);
34     }
35
36     public void upStateChanged(int upState) {
37         this.upState = upState;
38     }
39
40     public void setExpectedUpState(int expectedUpState) {
41         this.expectedUpState = expectedUpState;
42     }
43
44 }
45
46
47 /*
48  Revision history:
49  $Log: StateResultMonitor.java,v $
50  Revision 1.4 2006/01/18 14:40:06 billhorsman
51  Unbundled Jakarta's Commons Logging.
52
53  Revision 1.3 2003/03/04 10:24:40 billhorsman
54  removed try blocks around each test
55
56  Revision 1.2 2003/03/03 11:12:05 billhorsman
57  fixed licence
58
59  Revision 1.1 2003/03/02 00:37:23 billhorsman
60  more robust
61
62  Revision 1.5 2003/03/01 18:17:50 billhorsman
63  arrffgh. fix,
64
65  Revision 1.4 2003/03/01 16:53:07 billhorsman
66  fix
67
68  Revision 1.3 2003/03/01 16:38:40 billhorsman
69  fix
70
71  Revision 1.2 2003/03/01 16:18:31 billhorsman
72  fix
73
74  Revision 1.1 2003/03/01 16:07:26 billhorsman
75  helper
76
77  Revision 1.3 2003/03/01 15:27:24 billhorsman
78  checkstyle
79
80  Revision 1.2 2003/03/01 15:22:50 billhorsman
81  doc
82
83  Revision 1.1 2003/03/01 15:14:14 billhorsman
84  new ResultMonitor to help cope with test threads
85
86  */
Popular Tags