public class ResourceEvent 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 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 |
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 pValue)
pType
- the event typepContext
- the resource contextpIsUpperThreshold
- whether it is an upper thresholdpValue
- the valuepublic int getType()
public Comparable getValue()
public ResourceContext getContext()
public boolean isUpperThreshold()
getType()
returns
NORMAL
, WARNING
or ERROR
.Copyright © OSGi Alliance (2000, 2015). All Rights Reserved. Licensed under the OSGi Specification License, Version 2.0