T - The type for the Resource.public class ResourceEvent<T> extends Object
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.
ResourceListener| Modifier and Type | Field and Description |
|---|---|
static int |
ERROR
Type of ResourceEvent indicating a threshold goes to the ERROR state.
|
static int |
NORMAL
Type of ResourceEvent indicating a threshold goes to the NORMAL state.
|
static int |
WARNING
Type of ResourceEvent indicating a threshold goes to the WARNING state.
|
| Constructor and Description |
|---|
ResourceEvent(int pType,
ResourceContext pContext,
boolean pIsUpperThreshold,
Comparable<T> pValue)
Creates a new ResourceEvent.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object var0) |
ResourceContext |
getContext()
Returns the resource context that caused the event.
|
int |
getType()
Returns the event type.
|
Comparable<T> |
getValue()
Returns the resource consumption value.
|
int |
hashCode() |
boolean |
isUpperThreshold()
Returns true if the threshold triggering this event is an upper
threshold.
|
String |
toString() |
public static final int NORMAL
public static final int WARNING
public static final int ERROR
public ResourceEvent(int pType,
ResourceContext pContext,
boolean pIsUpperThreshold,
Comparable<T> pValue)
pType - the event typepContext - the resource contextpIsUpperThreshold - whether it is an upper thresholdpValue - the valuepublic int getType()
public Comparable<T> getValue()
public ResourceContext getContext()
public boolean isUpperThreshold()
getType() returns
NORMAL, WARNING or ERROR.Copyright © Contributors to the Eclipse Foundation Licensed under the Eclipse Foundation Specification License – v1.0