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