Home » activemq-parent-5.3.1-source-release » org.apache » activemq » usage » [javadoc | source]
abstract public class: Usage [javadoc | source]

All Implemented Interfaces:

Direct Known Subclasses:
    MemoryUsage, StoreUsage, TempUsage

Used to keep track of how much of something is being used so that a productive working set usage can be controlled. Main use case is manage memory usage.
Field Summary
protected final  Object usageMutex     
protected  int percentUsage     
protected  T parent     
 public Usage(T parent,
    String name,
    float portion) 
Method from org.apache.activemq.usage.Usage Summary:
addUsageListener,   caclPercentUsage,   getExecutor,   getLimit,   getLimiter,   getName,   getParent,   getPercentUsage,   getPercentUsageMinDelta,   getPollingTime,   getUsage,   getUsagePortion,   isFull,   notifyCallbackWhenNotFull,   onLimitChange,   removeUsageListener,   retrieveUsage,   setLimit,   setLimiter,   setName,   setParent,   setPercentUsage,   setPercentUsageMinDelta,   setPollingTime,   setUsagePortion,   start,   stop,   toString,   waitForSpace,   waitForSpace
Methods from java.lang.Object:
clone,   equals,   finalize,   getClass,   hashCode,   notify,   notifyAll,   toString,   wait,   wait,   wait
Method from org.apache.activemq.usage.Usage Detail:
 public  void addUsageListener(UsageListener listener) 
 protected int caclPercentUsage() 
 protected Executor getExecutor() 
 public long getLimit() 
 public UsageCapacity getLimiter() 
 public String getName() 
 public T getParent() 
 public int getPercentUsage() 
 public int getPercentUsageMinDelta() 
 public int getPollingTime() 
 public long getUsage() 
 public float getUsagePortion() 
 public boolean isFull() 
 public boolean notifyCallbackWhenNotFull(Runnable callback) 
 protected  void onLimitChange() 
 public  void removeUsageListener(UsageListener listener) 
 abstract protected long retrieveUsage()
 public  void setLimit(long limit) 
    Sets the memory limit in bytes. Setting the limit in bytes will set the usagePortion to 0 since the UsageManager is not going to be portion based off the parent. When set using Xbean, values of the form "20 Mb", "1024kb", and "1g" can be used
 public  void setLimiter(UsageCapacity limiter) 
 public  void setName(String name) 
 public  void setParent(T parent) 
 protected  void setPercentUsage(int value) 
 public  void setPercentUsageMinDelta(int percentUsageMinDelta) 
    Sets the minimum number of percentage points the usage has to change before a UsageListener event is fired by the manager.
 public  void setPollingTime(int pollingTime) 
 public  void setUsagePortion(float usagePortion) 
 public  void start() 
 public  void stop() 
 public String toString() 
 public  void waitForSpace() throws InterruptedException 
 public boolean waitForSpace(long timeout) throws InterruptedException