JAC project
AOPSYS
CEDRIC & LIP6 labs

org.objectweb.jac.aspects.distribution.consistency
Class ClientServerConsistencyWrapper

java.lang.Object
  |
  +--org.objectweb.jac.core.Wrapper
        |
        +--org.objectweb.jac.aspects.distribution.consistency.ConsistencyWrapper
              |
              +--org.objectweb.jac.aspects.distribution.consistency.ClientServerConsistencyWrapper
All Implemented Interfaces:
Serializable

public class ClientServerConsistencyWrapper
extends ConsistencyWrapper

This wrapper implements a client-server consistency protocol.

It is a special consistency protocol since the wrappee acts as a pure client (a stub) for its known replicas.

Author:
Renaud Pawlak
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.objectweb.jac.aspects.distribution.consistency.ConsistencyWrapper
ALL_GETTERS, ALL_METHODS, ALL_MODIFIERS, knownReplicas, visitedReplicas
 
Fields inherited from class org.objectweb.jac.core.Wrapper
ac
 
Constructor Summary
ClientServerConsistencyWrapper(AspectComponent ac)
          An empty constructor for the Consistency class.
ClientServerConsistencyWrapper(AspectComponent ac, String serverHost)
          A friendly constructor for a client-server consistency wrapper.
 
Method Summary
 Object acceptRemoteCall(Wrappee wrappee, RemoteRef remoteReplica, Object[] data)
          Calls the method on the server.
 Object whenCall(Interaction interaction)
          Forwards the call to the server(s).
 
Methods inherited from class org.objectweb.jac.aspects.distribution.consistency.ConsistencyWrapper
acceptRemoteCall, acceptRemoteRead, acceptRemoteWrite, addKnownReplica, addMember, expandMethods, getConsistencyWrapperType, getKnownReplicas, getVisitedReplicas, invalidateTopology, setCallMethods, setKnownReplicas, setReadMethods, setWriteMethods, toString, whenBindingNewReplica, whenNewReplicaBounded, whenRead, whenWrite, wrap
 
Methods inherited from class org.objectweb.jac.core.Wrapper
attr, attrdef, defines, getAspectComponent, getAspectComponentName, getExceptionHandlers, proceed, setAspectComponent
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ClientServerConsistencyWrapper

public ClientServerConsistencyWrapper(AspectComponent ac,
                                      String serverHost)
A friendly constructor for a client-server consistency wrapper.


ClientServerConsistencyWrapper

public ClientServerConsistencyWrapper(AspectComponent ac)
An empty constructor for the Consistency class.

Method Detail

whenCall

public Object whenCall(Interaction interaction)
Forwards the call to the server(s).

Do not call the replica except if we do not know any server (in this case, we are a server).

Overrides:
whenCall in class ConsistencyWrapper
Returns:
the value returned by the server
See Also:
ConsistencyWrapper.acceptRemoteCall(RemoteRef,Object[])

acceptRemoteCall

public Object acceptRemoteCall(Wrappee wrappee,
                               RemoteRef remoteReplica,
                               Object[] data)
Calls the method on the server.

Parameters:
remoteReplica - the client remote reference
data - the name and the parameters of the server method

Contact JAC development team:
Renaud Pawlak
Lionel Seinturier
Laurent Martelli