Coverage Report - org.mule.util.counters.impl.AggregateCounter
 
Classes in this File Line Coverage Branch Coverage Complexity
AggregateCounter
67%
8/12
N/A
1.444
 
 1  
 /*
 2  
  * $Id: AggregateCounter.java 8077 2007-08-27 20:15:25Z aperepel $
 3  
  * --------------------------------------------------------------------------------------
 4  
  * Copyright (c) MuleSource, Inc.  All rights reserved.  http://www.mulesource.com
 5  
  *
 6  
  * The software in this package is published under the terms of the CPAL v1.0
 7  
  * license, a copy of which has been included with this distribution in the
 8  
  * LICENSE.txt file.
 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  22
         super(name, type);
 24  22
         this.base = base;
 25  22
         base.addAggregate(this);
 26  22
     }
 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  60
         this.doCompute();
 51  60
         this.propagate();
 52  60
     }
 53  
 
 54  
     public Counter getBase()
 55  
     {
 56  60
         return this.base;
 57  
     }
 58  
 
 59  
     public abstract double nextValue();
 60  
 
 61  
     public abstract void doCompute();
 62  
 
 63  
 }