Class ResourceEvent<T>
java.lang.Object
org.osgi.service.resourcemonitoring.ResourceEvent<T>
- Type Parameters:
T- The type for the Resource.
An event is sent to a ResourceListener when resource usage violates
one of their thresholds.
ResourceEvent objects are delivered synchronously to all
matching ResourceListener services. A typed code is used to identify
the event.
- Version:
- 1.0
- Author:
- $Id: 2c1fe38b57105cc9d5c5f90eb7a7947736a97539 $
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intType of ResourceEvent indicating a threshold goes to the ERROR state.static final intType of ResourceEvent indicating a threshold goes to the NORMAL state.static final intType of ResourceEvent indicating a threshold goes to the WARNING state. -
Constructor Summary
ConstructorsConstructorDescriptionResourceEvent(int pType, ResourceContext pContext, boolean pIsUpperThreshold, Comparable<T> pValue) Creates a new ResourceEvent. -
Method Summary
-
Field Details
-
NORMAL
public static final int NORMALType of ResourceEvent indicating a threshold goes to the NORMAL state.- See Also:
-
WARNING
public static final int WARNINGType of ResourceEvent indicating a threshold goes to the WARNING state.- See Also:
-
ERROR
public static final int ERRORType of ResourceEvent indicating a threshold goes to the ERROR state.- See Also:
-
-
Constructor Details
-
ResourceEvent
public ResourceEvent(int pType, ResourceContext pContext, boolean pIsUpperThreshold, Comparable<T> pValue) Creates a new ResourceEvent.- Parameters:
pType- the event typepContext- the resource contextpIsUpperThreshold- whether it is an upper thresholdpValue- the value
-
-
Method Details
-
getType
-
getValue
- Returns:
- the resource consumption value, or null if a resource monitor is not relevant.
-
getContext
Returns the resource context that caused the event.- Returns:
- The resource context that caused the event.
-
isUpperThreshold
-
hashCode
-
equals
-
toString
-