javax.slee
Interface ActivityContextInterface


public interface ActivityContextInterface

The ActivityContextInterface interface provides an SBB object with a Java interface to an Activity Context.

An SBB may define shareable state to be stored in the Activity Context by extending the ActivityContextInterface interface and adding CMP-style accessor methods for the state attributes. State can be shared either between SBB objects of the same SBB type, or between all SBB objects of any SBB type. The configuration of an SBB's Activity Context Interface is declared in the SBB's deployment descriptor.


Method Summary
 void attach(SbbLocalObject sbb)
          Attach an SBB entity to the Activity Context.
 void detach(SbbLocalObject sbb)
          Detach an SBB entity from the Activity Context.
 java.lang.Object getActivity()
          Get the Activity object for the activity encapsulated by this Activity Context.
 boolean isEnding()
          Determine if the activity context is in the ending state.
 

Method Detail

getActivity

public java.lang.Object getActivity()
                             throws TransactionRequiredLocalException,
                                    SLEEException
Get the Activity object for the activity encapsulated by this Activity Context.

This method is a mandatory transactional method.

Returns:
the Activity object.
Throws:
TransactionRequiredLocalException - if this method is invoked without a valid transaction context.
SLEEException - if the activity could not be obtained due to a system-level failure.

attach

public void attach(SbbLocalObject sbb)
            throws java.lang.NullPointerException,
                   TransactionRequiredLocalException,
                   TransactionRolledbackLocalException,
                   SLEEException
Attach an SBB entity to the Activity Context. The SBB entity will subsequently begin to receive events that it is interested in that occur on the underlying activity. If the SBB has any <event> deployment descriptor elements with the mask-on-attach attribute set to True, those events will automatically be masked from the SBB entity until the event mask is explicitly changed via the SbbContext.maskEvent method.

If the specified SBB entity is already attached to the Activity Context, this method has no effect.

This method is a mandatory transactional method.

Throws:
java.lang.NullPointerException - if sbb is null.
TransactionRequiredLocalException - if this method is invoked without a valid transaction context.
TransactionRolledbackLocalException - if sbb does not reference a valid SBB entity.
SLEEException - if the SBB entity could not be attached due to a system-level failure.

detach

public void detach(SbbLocalObject sbb)
            throws java.lang.NullPointerException,
                   TransactionRequiredLocalException,
                   TransactionRolledbackLocalException,
                   SLEEException
Detach an SBB entity from the Activity Context. The SBB entity will no longer receive any events that occur on the underlying activity.

If the specified SBB entity is not attached to the Activity Context, this method has no effect.

This method is a mandatory transactional method.

Throws:
java.lang.NullPointerException - if sbb is null.
TransactionRequiredLocalException - if this method is invoked without a valid transaction context.
TransactionRolledbackLocalException - if sbb does not reference a valid SBB entity.
SLEEException - if the SBB entity could not be detached due to a system-level failure.

isEnding

public boolean isEnding()
                 throws TransactionRequiredLocalException,
                        SLEEException
Determine if the activity context is in the ending state. Events cannot be fired by SBBs on and activity context that is in the ending state.

This method is a mandatory transactional method.

Returns:
true if the activity context is in the ending state, false otherwise.
Throws:
TransactionRequiredLocalException - if this method is invoked without a valid transaction context.
SLEEException - if the ending state of the activity context could not be determined due to a system-level failure.