public interface ActivityContextInterface
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.
Modifier and Type | Method and Description |
---|---|
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(Object obj)
Compare this Activity Context for equality with another object.
|
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.
|
Object getActivity() throws TransactionRequiredLocalException, SLEEException
This method is a mandatory transactional method.
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.void attach(SbbLocalObject sbb) throws NullPointerException, TransactionRequiredLocalException, TransactionRolledbackLocalException, SLEEException
<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.
sbb
- the SBB local object of the SBB entity to attach.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.void detach(SbbLocalObject sbb) throws NullPointerException, TransactionRequiredLocalException, TransactionRolledbackLocalException, SLEEException
If the specified SBB entity is not attached to the Activity Context, this method has no effect.
This method is a mandatory transactional method.
sbb
- the SBB local object of the SBB entity to detach.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.boolean isAttached(SbbLocalObject sbb) throws NullPointerException, TransactionRequiredLocalException, TransactionRolledbackLocalException, SLEEException
This method is a mandatory transactional method.
sbb
- the SBB local object of the SBB entity to check.true
if the specified SBB entity is attached to this Activity
Context, false
otherwise.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.boolean isEnding() throws TransactionRequiredLocalException, SLEEException
This method is a mandatory transactional method.
true
if the activity context is in the ending state,
false
otherwise.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.boolean equals(Object obj)
equals
in class Object
obj
- the object to compare this with.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.Object.equals(Object)
int hashCode()
aci1
and aci2
must
return the same hash code if aci1.equals(aci2)
.hashCode
in class Object
Object.hashCode()