javax.slee
Interface EventContext


public interface EventContext

The 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.

Since:
SLEE 1.1

Method Summary
 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.
 java.lang.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.
 

Method Detail

getEvent

java.lang.Object getEvent()
Get the event object for the event that this Event Context is associated with.

Returns:
the event object.

getActivityContextInterface

ActivityContextInterface getActivityContextInterface()
Get a reference to the Activity Context the event was fired on.

Returns:
an ActivityContextInterface object that encapsulates the Activity Context on which the event was fired.

getAddress

Address getAddress()
Get the address that was provided when the event was fired.

Returns:
the address that was provided when the event was fired. If the provided address was null this method will also return null

getService

ServiceID getService()
Get the component identifier of the Service that was provided when the event was fired.

Returns:
the Service component identifier that was provided when the event was fired. If the provided Service component identifier was null this method will also return null.

suspendDelivery

void suspendDelivery()
                     throws java.lang.IllegalStateException,
                            TransactionRequiredLocalException,
                            SLEEException
Suspend further delivery of the event associated with this event context. No further SBBs will receive the event until 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.

Throws:
java.lang.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.

suspendDelivery

void suspendDelivery(int timeout)
                     throws java.lang.IllegalArgumentException,
                            java.lang.IllegalStateException,
                            TransactionRequiredLocalException,
                            SLEEException
Suspend further delivery of the event associated with this event context. No further SBBs will receive the event until 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.

Parameters:
timeout - the timeout period, measured in milliseconds, before event delivery will be implicity resumed if resumeDelivery() has not been invoked.
Throws:
java.lang.IllegalArgumentException - if timeout is equal to or less than zero.
java.lang.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.

resumeDelivery

void resumeDelivery()
                    throws java.lang.IllegalStateException,
                           TransactionRequiredLocalException,
                           SLEEException
Resume previously suspended event delivery of the event associated with this event context.

This method is a mandatory transactional method.

Throws:
java.lang.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.

isSuspended

boolean isSuspended()
                    throws TransactionRequiredLocalException,
                           SLEEException
Determine if event delivery of the event associated with this event context is currently suspended.

Returns:
true if event delivery is currently suspended, false otherwise.
Throws:
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.


Copyright © 2008. All Rights Reserved.