org.objectweb.jac.aspects.distribution.consistency
Class WeakConsistencyWrapper
java.lang.Object
org.objectweb.jac.core.Wrapper
org.objectweb.jac.aspects.distribution.consistency.ConsistencyWrapper
org.objectweb.jac.aspects.distribution.consistency.WeakConsistencyWrapper
- All Implemented Interfaces:
- Advice, ConstructorInterceptor, Interceptor, MethodInterceptor, Serializable
- public class WeakConsistencyWrapper
- extends ConsistencyWrapper
This wrapper class implements a weak consistency protocol for a set
of replicas.
The semantics of this protocol is that the readed data can be
inconsistent with the other replicas. When a write event occurs,
the currently written replicas asks for the consistent state to the
valid replica (the owner) and becomes itself the valid
replica. This protocol ensures that the set of modifications are
finally done in at least one replica.
- Author:
- Renaud Pawlak
- See Also:
- Serialized Form
Fields inherited from class org.objectweb.jac.core.Wrapper |
ac, cr |
Methods inherited from class org.objectweb.jac.aspects.distribution.consistency.ConsistencyWrapper |
acceptRemoteCall, acceptRemoteRead, addKnownReplica, addMember, construct, expandMethods, getConsistencyWrapperType, getKnownReplicas, getVisitedReplicas, invalidateTopology, invoke, setCallMethods, setKnownReplicas, setReadMethods, setWriteMethods, toString, whenBindingNewReplica, whenCall, whenNewReplicaBounded, whenRead, wrap |
WeakConsistencyWrapper
public WeakConsistencyWrapper(AspectComponent ac)
whenWrite
public Object whenWrite(Interaction interaction)
- Update the wrappee state with the owner replica state before
proceeding the writing method.
The wrappee then becomes the owner.
- Overrides:
whenWrite
in class ConsistencyWrapper
- Returns:
- the value returned by the wrapped method
- See Also:
ConsistencyWrapper.acceptRemoteWrite(Wrappee,RemoteRef,Object[])
acceptRemoteWrite
public Object acceptRemoteWrite(Wrappee wrappee,
RemoteRef remoteReplica,
Object[] data)
- The current object is not the owner anymore and returns the
object state so that the new owner can be consistent
- Overrides:
acceptRemoteWrite
in class ConsistencyWrapper
- Parameters:
remoteReplica
- the replica that is beeing writtendata
- this parameter is not used in this protocol (its
value is null)
- Returns:
- the state of the object so that the written object can
become a consistent owner
- See Also:
ConsistencyWrapper.whenWrite(Interaction)
setOwner
public Object setOwner(RemoteRef newOwner)
- This role method sets a new owner.
- Parameters:
newOwner
- a remote reference on the new owner
- Returns:
- null