public interface ChildRelationFacility
The Child Relation Facility is used by SBBs to gain access to child SBB relations specified declaratively in the SBB deployment descriptor. Using this facility the SBB abstract class does not need to declare child relation methods for each child relation it wants to use.
An instance of the Child Relation Facility can be obtained from the SbbContext
.
All methods of the Child Relation Facility itself, unless otherwise stated, require a transaction.
If a facility method is invoked without a valid transaction context, a javax.slee.TransactionRequiredLocalException
will be thrown.
In addition, these methods may only be invoked by an SBB object that has been assigned to an SBB entity, or is in the process of being assigned to an SBB entity via the sbbCreate()
method.
If the SBB object is not assigned to an SBB entity (with the exclusion of the sbbCreate
method), a java.lang.IllegalStateException
is thrown.
Modifier and Type | Method and Description |
---|---|
ChildRelation |
getChildRelation(String name)
Get a Child Relation object for the child relation declared with the specified name.
|
Collection<String> |
getChildRelationNames()
Get the names of all child relations recognised by this facility.
|
RhinoSbbLocalHome |
getChildSbbLocalHome(String name)
Get an SBB local home object for the SBB declared with the specified child relation name.
|
Collection<SbbLocalObject> |
getChildSbbs()
Get a collection containing all child SBBs created by the SBB.
|
<T> Collection<T> |
getChildSbbs(Class<T> type)
Get a collection containing the child SBBs created by the SBB where the child SBB’s local interface is assignable to the specified interface.
|
Collection<String> getChildRelationNames() throws FacilityException
Get the names of all child relations recognised by this facility.
This method is a non-transactional method and may be invoked by an SBB object in any state.
FacilityException
- if a system-level failure occurs.ChildRelation getChildRelation(String name) throws NullPointerException, TransactionRequiredLocalException, IllegalStateException, UnrecognizedChildRelationException, FacilityException
Get a Child Relation object for the child relation declared with the specified name.
name
- the name of the child relation.NullPointerException
- if name
is null
.TransactionRequiredLocalException
- if this method is invoked without a valid transaction context.IllegalStateException
- if this method is invoked by an SBB object that is not assigned to an SBB entity.UnrecognizedChildRelationException
- if name
is not recognised as a declared child relation.FacilityException
- if a system-level failure occurs.Collection<SbbLocalObject> getChildSbbs() throws TransactionRequiredLocalException, IllegalStateException, FacilityException
Get a collection containing all child SBBs created by the SBB.
The returned collection includes child SBBs created from both child relations defined in the standard SLEE way as well as declarative child relations defined in the extension deployment descriptor.
TransactionRequiredLocalException
- if this method is invoked without a valid transaction context.IllegalStateException
- if this method is invoked by an SBB object that is not assigned to an SBB entity.FacilityException
- if a system-level failure occurs.<T> Collection<T> getChildSbbs(Class<T> type) throws NullPointerException, TransactionRequiredLocalException, IllegalStateException, FacilityException
Get a collection containing the child SBBs created by the SBB where the child SBB’s local interface is assignable to the specified interface.
The returned collection includes relevant child SBBs created from both child relations defined in the standard SLEE way as well as declarative child relations defined in the extension deployment descriptor.
NullPointerException
- if type
is null
.TransactionRequiredLocalException
- if this method is invoked without a valid transaction context.IllegalStateException
- if this method is invoked by an SBB object that is not assigned to an SBB entity.FacilityException
- if a system-level failure occurs.RhinoSbbLocalHome getChildSbbLocalHome(String name) throws NullPointerException, UnrecognizedChildRelationException, FacilityException
Get an SBB local home object for the SBB declared with the specified child relation name.
This method is a non-transactional method and may be invoked by an SBB object in any state.
name
- the name of the child relation.null
if the child SBB has not defined a local home interface.NullPointerException
- if name
is null
.UnrecognizedChildRelationException
- if name
is not recognised as a declared child relation.FacilityException
- if a system-level failure occurs.