1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18 package org.apache.commons.performance.pool;
19
20
21
22
23
24 public class Waiter {
25 private boolean active = false;
26 private boolean valid = true;
27 long latency = 0;
28
29 public Waiter(boolean active, boolean valid, long latency) {
30 this.active = active;
31 this.valid = valid;
32 this.latency = latency;
33 }
34
35 public void doWait() {
36 try {
37 Thread.sleep(latency);
38 } catch (InterruptedException ex) {
39
40 }
41 }
42
43 public boolean isActive() {
44 return active;
45 }
46
47 public void setActive(boolean active) {
48 this.active = active;
49 }
50
51 public long getLatency() {
52 return latency;
53 }
54
55 public void setLatency(long latency) {
56 this.latency = latency;
57 }
58
59 public boolean isValid() {
60 return valid;
61 }
62
63 public void setValid(boolean valid) {
64 this.valid = valid;
65 }
66 }