KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > logicalcobwebs > proxool > admin > SnapshotResultMonitor


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.admin;
7
8 import org.logicalcobwebs.proxool.ProxoolFacade;
9 import org.logicalcobwebs.proxool.ResultMonitor;
10
11 /**
12  * A ResultMonitor specifically for Snapshots
13  *
14  * @version $Revision: 1.4 $, $Date: 2003/03/03 11:12:05 $
15  * @author bill
16  * @author $Author: billhorsman $ (current maintainer)
17  * @since Proxool 0.8
18  */

19 public abstract class SnapshotResultMonitor extends ResultMonitor {
20
21     private SnapshotIF snapshot;
22
23     private String JavaDoc alias;
24
25     /**
26      * @param alias so we can lookup the latest {@link SnapshotIF snapshot}
27      */

28     public SnapshotResultMonitor(String JavaDoc alias) {
29         this.alias = alias;
30     }
31
32     /**
33      * Passes the latest snapshot to {@link #check(org.logicalcobwebs.proxool.admin.SnapshotIF) check}.
34      * @return {@link #SUCCESS} or {@link #TIMEOUT}
35      * @throws Exception if anything goes wrong
36      */

37     public boolean check() throws Exception JavaDoc {
38         snapshot = ProxoolFacade.getSnapshot(alias);
39         return check(snapshot);
40     }
41
42     /**
43      * Override this with your specific check
44      * @param snapshot the latest snapshot
45      * @return true if the result has happened, else false
46      * @throws Exception if anything goes wrong
47      */

48     public abstract boolean check(SnapshotIF snapshot) throws Exception JavaDoc;
49
50     /**
51      * Get the snapshot used in the most recent {@link #check(org.logicalcobwebs.proxool.admin.SnapshotIF) check}
52      * @return snapshot
53      */

54     public SnapshotIF getSnapshot() {
55         return snapshot;
56     }
57
58 }
59
60
61 /*
62  Revision history:
63  $Log: SnapshotResultMonitor.java,v $
64  Revision 1.4 2003/03/03 11:12:05 billhorsman
65  fixed licence
66
67  Revision 1.3 2003/03/01 15:27:24 billhorsman
68  checkstyle
69
70  Revision 1.2 2003/03/01 15:22:50 billhorsman
71  doc
72
73  Revision 1.1 2003/03/01 15:14:14 billhorsman
74  new ResultMonitor to help cope with test threads
75
76  */
Popular Tags