1 | |
|
2 | |
|
3 | |
|
4 | |
|
5 | |
|
6 | |
|
7 | |
|
8 | |
|
9 | |
|
10 | |
|
11 | |
package org.mule.util.counters.impl; |
12 | |
|
13 | |
import org.mule.util.counters.Counter; |
14 | |
import org.mule.util.counters.CounterFactory.Type; |
15 | |
|
16 | |
public abstract class AggregateCounter extends AbstractCounter |
17 | |
{ |
18 | |
|
19 | |
private final Counter base; |
20 | |
|
21 | |
public AggregateCounter(String name, Type type, AbstractCounter base) |
22 | |
{ |
23 | 0 | super(name, type); |
24 | 0 | this.base = base; |
25 | 0 | base.addAggregate(this); |
26 | 0 | } |
27 | |
|
28 | |
public double increment() |
29 | |
{ |
30 | 0 | throw new UnsupportedOperationException(); |
31 | |
} |
32 | |
|
33 | |
public double incrementBy(double value) |
34 | |
{ |
35 | 0 | throw new UnsupportedOperationException(); |
36 | |
} |
37 | |
|
38 | |
public double decrement() |
39 | |
{ |
40 | 0 | throw new UnsupportedOperationException(); |
41 | |
} |
42 | |
|
43 | |
public void setRawValue(double value) |
44 | |
{ |
45 | 0 | throw new UnsupportedOperationException(); |
46 | |
} |
47 | |
|
48 | |
public final synchronized void compute() |
49 | |
{ |
50 | 0 | this.doCompute(); |
51 | 0 | this.propagate(); |
52 | 0 | } |
53 | |
|
54 | |
public Counter getBase() |
55 | |
{ |
56 | 0 | return this.base; |
57 | |
} |
58 | |
|
59 | |
public abstract double nextValue(); |
60 | |
|
61 | |
public abstract void doCompute(); |
62 | |
|
63 | |
} |