All Packages Class Hierarchy This Package Previous Next Index
Interface org.mitre.pam.service.resource.ResourceConsumer
- public abstract interface ResourceConsumer
A resource consumer is somewhat analogous to an AWT
Component.
The algorithm and precise meaning of consumption is vague by design.
-
getConsumption(String)
- The consumer is queried for how much it has actually consumed.
-
getId()
- The id of the consumer
-
setConsumerConstraint(String, Object)
- Set the constraint on this consumer.
-
setConsumption(String, Number)
- Instructs the consumer
to reset its tally of consumption.
getId
public abstract java.lang.String getId()
- The id of the consumer
- Returns:
- A string that is a unique identifier.
getConsumption
public abstract java.lang.Number getConsumption(java.lang.String resourceDimension)
- The consumer is queried for how much it has actually consumed. This is
analogous to AWT current size info.
If the resource represents a level
(like number-of-bytes moved), then the answer
would be the accumulated level.
If the resource represents a rate (like number-of-bytes-per-minute), then the
answer is some historical average over some
time window.
- Returns:
- Number whos actual type will depend on the resource.
Java can deal abstractly with numbers.
setConsumption
public abstract void setConsumption(java.lang.String resourceDimension,
java.lang.Number value)
- Instructs the consumer
to reset its tally of consumption.
Rate related resources (such as bytes-per-minute) should
reset their history to this value. Level related resources
should set their tally to this number.
- Returns:
- Number whos actual type will depend on the resource.
Java can deal abstractly with numbers.
setConsumerConstraint
public abstract void setConsumerConstraint(java.lang.String constraintName,
java.lang.Object constaintValue)
- Set the constraint on this consumer. There
must be a default set of constraints available for each manager,
so that the pool does not have to explicitly have its constraints
set by an external controller.
Simple pools will probably ignore this method.
- Parameters:
- constraintName - is a tag that has meaning to the manager
- constraintValue - is a value on the tag that has meaning to the manager and
is used by the manager in its algorithm for managing budgets and actual consumption
All Packages Class Hierarchy This Package Previous Next Index