public interface SbbPartContext extends SbbContext
The SbbPartContext
interface provides an SBB part object with access to SLEE-managed state that is dependent on the SBB part’s currently executing context.
An SBB part object may obtain a reference to an SbbPartContext
object by either a class constructor argument or dependency injection.
The SbbPartContext
object remains associated with the SBB part object for the lifetime of that SBB part object.
Note that the information that the SBB part object obtains from the SbbPartContext
object may change as the SLEE assigns the SBB part object to different SBB entities during the SBB part object’s lifecycle.
Modifier and Type | Method and Description |
---|---|
<T extends ActivityContextInterface> |
asSbbPartActivityContextInterface(ActivityContextInterface aci)
Narrow a generic Activity Context Interface object to an object that implements the SBB part’s Activity Context Interface.
|
void |
enableEntityTreePersistence()
Enable key/value store persistence for the SBB entity tree and related transactional state.
|
RhinoActivityContextInterface[] |
getActivities()
Get the set of Activity Contexts that the SBB entity currently associated with the SBB part is currently attached to.
|
RhinoActivityContextInterface[] |
getActivities(Class<?> type)
Get the set of Activity Contexts that the SBB entity currently associated with the SBB part is currently attached to, where the type of the underlying activity object is assignable to the specified type.
|
CMPFields |
getCMPFields()
Get the CMP fields accessor object for this SBB part.
|
ConvergenceName |
getConvergenceName()
Get the convergence name that the SBB entity the SBB part is associated with was created for.
|
Map<String,JndiBinding> |
getJndiBindings()
Get a map describing the JNDI bindings available to the SBB part.
|
com.opencloud.slee.SbbPartID |
getSbbPart()
Get the SBB part component identifier that identifies the SBB part component of the SBB part object.
|
Tracer |
getTracer(String tracerName) |
getEventMask, getRollbackOnly, getSbb, getSbbLocalObject, getService, maskEvent, setRollbackOnly
com.opencloud.slee.SbbPartID getSbbPart() throws SLEEException
Get the SBB part component identifier that identifies the SBB part component of the SBB part object.
This method is a non-transactional method.
SLEEException
- if the SBB part component identifier could not be obtained due to a system-level failure.<T extends ActivityContextInterface> T asSbbPartActivityContextInterface(ActivityContextInterface aci)
Narrow a generic Activity Context Interface object to an object that implements the SBB part’s Activity Context Interface.
This method returns the same object if the SBB part does not define an Activity Context Interface.
This method is a mandatory transactional method.
If it is invoked without a valid transaction context a javax.slee.TransactionRequiredLocalException
will be thrown.
In addition, this method may only be invoked on an SBB part object that has been assigned to an SBB entity.
If the SBB part object is not assigned to an SBB entity, a java.lang.IllegalStateException
is thrown.
T
- a type extending the generic javax.slee.ActivityContextInterface
type.aci
- an Activity Context Interface object.aci
method argument if the SBB part does not define an Activity Context Interface.TransactionRequiredLocalException
- if this method is invoked without a valid transaction context.IllegalStateException
- if the SBB part object invoking this method is not associated with an SBB entity.SLEEException
- if the Activity Context Interface object could not be obtained due to a system-level failure.ConvergenceName getConvergenceName() throws TransactionRolledbackLocalException, IllegalStateException, SLEEException
Get the convergence name that the SBB entity the SBB part is associated with was created for. This method only returns a non-null value if the SBB entity is the root SBB of an SBB entity tree.
This method is a mandatory transactional method. The SBB part object must have an associated SBB entity when it invokes this method.
null
if this SBB part is no associated with a root SBB entity.TransactionRequiredLocalException
- if this method is invoked without a valid transaction context.IllegalStateException
- if the SBB part object invoking this method is not associated with an SBB entity.SLEEException
- if the convergence name could not be obtained due to a system-level failure.TransactionRolledbackLocalException
RhinoActivityContextInterface[] getActivities() throws TransactionRequiredLocalException, IllegalStateException, SLEEException
Get the set of Activity Contexts that the SBB entity currently associated with the SBB part is currently attached to.
The returned array contains generic Activity Context Interface objects that can be converted to the SBB part’s own activity context interface type using the asSbbPartActivityContextInterface(ActivityContextInterface)
method.
This method is a mandatory transactional method. The SBB part object must have an associated SBB entity when it invokes this method.
getActivities
in interface SbbContext
TransactionRequiredLocalException
- if this method is invoked without a valid transaction context.IllegalStateException
- if the SBB part object invoking this method is not associated with an SBB entity.SLEEException
- if the set of attached Activity Contexts could not be obtained due to a system-level failure.Tracer getTracer(String tracerName) throws NullPointerException, IllegalArgumentException, SLEEException
getTracer
in interface SbbContext
NullPointerException
IllegalArgumentException
SLEEException
RhinoActivityContextInterface[] getActivities(Class<?> type) throws NullPointerException, TransactionRequiredLocalException, IllegalStateException, SLEEException
Get the set of Activity Contexts that the SBB entity currently associated with the SBB part is currently attached to, where the type of the underlying activity object is assignable to the specified type.
The returned array contains generic Activity Context Interface objects that can be converted to the SBB part’s own activity context interface type using the asSbbPartActivityContextInterface(ActivityContextInterface)
method.
This method is a mandatory transactional method. The SBB part object must have an associated SBB entity when it invokes this method.
type
- the type of activity object to return Activity Contexts for.
If this parameter is null
, this method behaves the same as getActivities()
.type
.TransactionRequiredLocalException
- if this method is invoked without a valid transaction context.IllegalStateException
- if the SBB part object invoking this method is not associated with an SBB entity.SLEEException
- if the set of attached Activity Contexts could not be obtained due to a system-level failure.NullPointerException
CMPFields getCMPFields() throws SLEEException
Get the CMP fields accessor object for this SBB part.
The object returned from this method implements all CMP interfaces defined by the SBB part, so may be typecast to any of these interfaces as required regardless of whether or not such interface extends from CMPFields.
This method runs in an unspecified transaction context, however the CMP state contained within the object can only be accessed or manipulated in contexts where CMP state is normally accessible.
SLEEException
- if the CMP fields could not be obtained due to a system-level failure.Map<String,JndiBinding> getJndiBindings() throws SLEEException
Get a map describing the JNDI bindings available to the SBB part. The map is keyed on the fully-qualified name of each binding.
This method is a non-transactional method.
SLEEException
- if the JNDI bindings could not be obtained due to a system-level failure.void enableEntityTreePersistence()
Enable key/value store persistence for the SBB entity tree and related transactional state. This method is only useful if the service has disabled the initial persistence of state in the extension service deployment descriptor. <p> This method has no effect if entity tree persistence is or has already been enabled.