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 super(name, type);
24 this.base = base;
25 base.addAggregate(this);
26 }
27
28 public double increment()
29 {
30 throw new UnsupportedOperationException();
31 }
32
33 public double incrementBy(double value)
34 {
35 throw new UnsupportedOperationException();
36 }
37
38 public double decrement()
39 {
40 throw new UnsupportedOperationException();
41 }
42
43 public void setRawValue(double value)
44 {
45 throw new UnsupportedOperationException();
46 }
47
48 public final synchronized void compute()
49 {
50 this.doCompute();
51 this.propagate();
52 }
53
54 public Counter getBase()
55 {
56 return this.base;
57 }
58
59 public abstract double nextValue();
60
61 public abstract void doCompute();
62
63 }