public interface EventContext
EventContext
interface provides an SBB object with access to information
and state about events and event delivery.
An EventContext
object is given to an SBB object via the event handler method.
An EventContext
object may be stored in CMP field of an SBB if the type of
the CMP field is this interface.
Modifier and Type | Method and Description |
---|---|
ActivityContextInterface |
getActivityContextInterface()
Get a reference to the Activity Context the event was fired on.
|
Address |
getAddress()
Get the address that was provided when the event was fired.
|
Object |
getEvent()
Get the event object for the event that this Event Context is associated with.
|
ServiceID |
getService()
Get the component identifier of the Service that was provided when the event
was fired.
|
boolean |
isSuspended()
Determine if event delivery of the event associated with this event context is currently
suspended.
|
void |
resumeDelivery()
Resume previously suspended event delivery of the event associated with this event
context.
|
void |
suspendDelivery()
Suspend further delivery of the event associated with this event context.
|
void |
suspendDelivery(int timeout)
Suspend further delivery of the event associated with this event context.
|
Object getEvent()
ActivityContextInterface getActivityContextInterface()
ActivityContextInterface
object that encapsulates
the Activity Context on which the event was fired.Address getAddress()
null
this method will also return
null
ServiceID getService()
null
this method will also return null
.void suspendDelivery() throws IllegalStateException, TransactionRequiredLocalException, SLEEException
resumeDelivery
is invoked on
an event context for the same event, or the system-dependent default timeout is reached,
whichever occurs first.
This method is a mandatory transactional method.
IllegalStateException
- if event delivery has already been suspended.TransactionRequiredLocalException
- if this method is invoked without a valid
transaction context.SLEEException
- if event delivery could not be suspended due to a system-level failure.void suspendDelivery(int timeout) throws IllegalArgumentException, IllegalStateException, TransactionRequiredLocalException, SLEEException
resumeDelivery
is invoked on
an event context for the same event, or the specified timeout is reached, whichever
occurs first.
This method is a mandatory transactional method.
timeout
- the timeout period, measured in milliseconds, before event delivery
will be implicity resumed if resumeDelivery()
has not been invoked.IllegalArgumentException
- if timeout
is equal to or less than zero.IllegalStateException
- if event delivery has already been suspended.TransactionRequiredLocalException
- if this method is invoked without a valid
transaction context.SLEEException
- if event delivery could not be suspended due to a system-level failure.void resumeDelivery() throws IllegalStateException, TransactionRequiredLocalException, SLEEException
This method is a mandatory transactional method.
IllegalStateException
- if event delivery has not been suspended.TransactionRequiredLocalException
- if this method is invoked without a valid
transaction context.SLEEException
- if event delivery could not be resumed due to a system-level failure.boolean isSuspended() throws TransactionRequiredLocalException, SLEEException
true
if event delivery is currently suspended, false
otherwise.TransactionRequiredLocalException
- if this method is invoked without a valid
transaction context.SLEEException
- if the status of event delivery could not be determined due to a
system-level failure.