public interface UsageParametersInterface
A usage parameters interface may be annotated with the @UsageParameters
annotation in order to provide additional information to the SLEE about the usage parameter
set.
The usage parameters interface defines usage parameters as follows:
public void increment<usage-parameter-name>(long value);
or set method:
public void set<usage-parameter-name>(long value);
Usage counter methods may be annotated with the @UsageCounter
annotation in order to provide additional information to the SLEE about the parameter.
In the case where both an increment and set method has been defined for a given parameter,
only one of the methods need be annotated. If both methods are annotated the annotation
used is chosen arbitrarily.
An accessor method may also be defined for a counter-type usage parameter with the signature:
public long get<usage-parameter-name>();
public void sample<usage-parameter-name>(long value);
Usage sample methods may be annotated with the @UsageSample
annotation in order to provide additional information to the SLEE about the parameter.
An accessor method may also be defined for a sample-type usage parameter with the signature:
public SampleStatistics get<usage-parameter-name>();
In the above method declarations, usage-parameter-name
is the name of the usage parameter,
where the first letter has been uppercased. Usage methods must not have a throws
clause.
Usage methods, and all methods defined in this interface, run in an unspecified transaction context.
Updates to usage parameters occur regardless of the outcome of any transaction active at the time
of the update.
Modifier and Type | Method and Description |
---|---|
Collection<? extends UsageParametersInterface> |
children()
Get all child usage parameter sets of this usage parameter set.
|
<T extends UsageParametersInterface> |
getOrCreateChild(String name)
Get the child usage parameter set with the given name.
|
<T extends UsageParametersInterface> |
getOrCreateChild(String name,
String type)
Get the child usage parameter set with the given name.
|
boolean |
hasChild(String name)
Determine if a child usage parameter set with the given name currently exists.
|
String |
key()
Get the key that identifies this usage parameter set.
|
String |
name()
Get the name of this parameter set.
|
<T extends UsageParametersInterface> |
parent()
Get the parent usage parameter set of this usage parameter set.
|
void |
remove()
Remove this usage parameter set.
|
String |
type()
Get the type of this usage parameter set.
|
String name()
null
for that usage parameter set.
This method is a non-transactional method.
null
if this is the
root usage parameter set.String type()
This method is a non-transactional method.
null
if this usage
parameter set has no type.String key()
Usage Facility
.
The key for the root usage parameter set is the empty string.
This method is a non-transactional method.
<T extends UsageParametersInterface> T getOrCreateChild(String name) throws NullPointerException, IllegalArgumentException, SLEEException
This method is a non-transactional method.
name
- the name of the child usage parameter set.NullPointerException
- if name
is null
.IllegalArgumentException
- if name
is zero-length.SLEEException
- if a system-level failure occurs.<T extends UsageParametersInterface> T getOrCreateChild(String name, String type) throws NullPointerException, IllegalArgumentException, UnrecognizedUsageParameterSetTypeException, SLEEException
This method is a non-transactional method.
name
- the name of the child usage parameter set.type
- the type of the usage parameter set, if it is created. May be null
to create a usage parameter set with no type.NullPointerException
- if name
is null
.IllegalArgumentException
- if name
is zero-length.UnrecognizedUsageParameterSetTypeException
- if type
is not null
and is not recognized as a declared usage parameter set type.SLEEException
- if a system-level failure occurs.boolean hasChild(String name) throws NullPointerException, SLEEException
This method is a non-transactional method.
name
- the name of the child usage parameter set.true
if a child usage parameter set with the given name currently
exists, false
otherwise.NullPointerException
- if name
is null
.SLEEException
- if a system-level failure occurs.Collection<? extends UsageParametersInterface> children() throws SLEEException
This method is a non-transactional method.
SLEEException
- if a system-level failure occurs.<T extends UsageParametersInterface> T parent() throws SLEEException
This method is a non-transactional method.
null
if this is the root
usage parameter set.SLEEException
- if a system-level failure occurs.void remove() throws SLEEException
While it is not possible to remove the root usage parameter set, this method may be invoked on the root usage parameter set in order to easily remove all its child usage parameter sets. Invoking this method on the root usage parameter set will also reset all usage statistics as if the parameter set had been removed and immediately recreated.
This method is a non-transactional method.
SLEEException
- if a system-level failure occurs.