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.
 boolean equals(java.lang.Object obj)
          Compare this Activity Context for equality with another object.
 java.lang.Object getActivity()
          Get the Activity object for the activity encapsulated by this Activity Context.
 int hashCode()
          Get a hash code value for this Activity Context Interface object.
 boolean isAttached(SbbLocalObject sbb)
          Determine if a specified SBB entity is attached to this Activity Context.
 boolean isEnding()
          Determine if the activity context is in the ending state.
 

Method Detail

getActivity

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

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.

Parameters:
sbb - the SBB local object of the SBB entity to attach.
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

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.

Parameters:
sbb - the SBB local object of the SBB entity to detach.
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.

isAttached

boolean isAttached(SbbLocalObject sbb)
                   throws java.lang.NullPointerException,
                          TransactionRequiredLocalException,
                          TransactionRolledbackLocalException,
                          SLEEException
Determine if a specified SBB entity is attached to this Activity Context.

This method is a mandatory transactional method.

Parameters:
sbb - the SBB local object of the SBB entity to check.
Returns:
true if the specified SBB entity is attached to this Activity Context, false otherwise.
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 attachment status of the SBB entity could not be determined to a system-level failure.
Since:
SLEE 1.1

isEnding

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.

equals

boolean equals(java.lang.Object obj)
Compare this Activity Context for equality with another object.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the object to compare this with.
Returns:
true if obj is an Activity Context Interface object that represents the same underlying activity as identified by the Activity Handle the activity was started with, false otherwise.
Since:
SLEE 1.1
See Also:
Object.equals(Object)

hashCode

int hashCode()
Get a hash code value for this Activity Context Interface object. Two Activity Context Interface objects aci1 and aci2 must return the same hash code if aci1.equals(aci2).

Overrides:
hashCode in class java.lang.Object
Returns:
a hash code value for this Activity Context Interface object.
Since:
SLEE 1.1
See Also:
Object.hashCode()


Copyright © 2009. All Rights Reserved.