@Retention(value=RUNTIME) @Target(value={METHOD,TYPE}) @Documented public @interface PassByReference
inherited
. An individual CMP field may
override any pass-by-reference semantics inherited from a class or interface annotation
by being annotated itself with different pass-by-reference semantics.
If pass-by-reference semantics are desired for a CMP field that holds, either directly
or indirectly, a reference to a SLEE-defined object that is only valid in the transaction
it was materialised (SbbLocalObject, ProfileLocalObject,
ActivityContextInterface, or EventContext), then the reference
scope must be limited to PassByReference.Scope.TRANSACTIONAL
to avoid runtime application failures.
Note that if a CMP field storing one of these types inherits pass-by-reference semantics
from a class or interface annotation, Rhino will automatically limit the scope to
TRANSACTIONAL
for that CMP field. This means it is not necessary to specifically
annotate a CMP field directly storing one of these types if the inherited scope is wider
- the correct scope will be used automatically.
This annotation has no effect on CMP fields of primitive types or of types that Rhino
understands to be immutable, eg. primitive type wrapper classes and String
.
Primitive types are always stored by value and immutable types are always stored by
reference.
Modifier and Type | Optional Element and Description |
---|---|
boolean |
inherited
If the pass-by-reference semantics should be inherited by subclasses.
|
PassByReference.Scope |
scope
The scope that the reference should be maintained.
|
public abstract PassByReference.Scope scope
public abstract boolean inherited