public static enum PassByReference.Scope extends Enum<PassByReference.Scope>
Enum Constant and Description |
---|
DISABLED
Reference scope indicating that any pass-by-reference semantics should be removed.
|
PERMANENT
Reference scope indicating that pass-by-reference semantics should apply permanently.
|
TRANSACTIONAL
Reference scope indicating that pass-by-reference semantics should apply on a
per-transaction basis only.
|
WHILE_READY
Reference scope indicating that pass-by-reference semantics should apply while the
SBB object is in the READY state.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isWiderScope(PassByReference.Scope s)
Determine if this scope is wider than the specified scope.
|
static PassByReference.Scope |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static PassByReference.Scope[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final PassByReference.Scope DISABLED
public static final PassByReference.Scope TRANSACTIONAL
public static final PassByReference.Scope WHILE_READY
This reference scope is safe to use with any generic CMP object that does not hold, either directly or indirectly, references to SLEE-defined objects that are only valid in the transaction they were materialised in, such as ActivityContextInterface or EventContext.
public static final PassByReference.Scope PERMANENT
Unlike other reference scopes, a permanent reference loses all transactional semantics. Any changes made to the referenced object will persist irrespective of whether the current transaction commits or rolls back. As such, permanent references are best suited to objects that are unlikely to change during the lifetime of an SBB, for example input network messages that need to be retained across event handler transaction boundaries but serialisation of such messages is undesirable.
Replication
A CMP field with permanent pass-by-reference semantics may only be used in a replicated
SBB if the CMP field type is serialisable by some normally supported method, ie. if the
CMP field is still meaningful with standard pass-by-value semantics.
The following conditions apply to permanent pass-by-reference CMP fields that are replicated:
Example:
An SBB containing a permanent pass-by-reference CMP field "foo
" is replicated
across two cluster nodes 101 and 102.
foo
" to the reference X
. The
stored value is replicated to node 102.
Y
from the
CMP field, then updates the CMP field. The update is replicated back to node 101.
X
, but instead returns a reference, Z
, to the
value deserialised from the update that occurred on node 102.
public static PassByReference.Scope[] values()
for (PassByReference.Scope c : PassByReference.Scope.values()) System.out.println(c);
public static PassByReference.Scope valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullpublic boolean isWiderScope(PassByReference.Scope s)
s
- the scope to compare this to.true
if this scope is wider than the specified scope, false
otherwise.