org.objectweb.jac.core.dist
Class StubWrapper

java.lang.Object
  |
  +--org.objectweb.jac.core.Wrapper
        |
        +--org.objectweb.jac.core.dist.StubWrapper
All Implemented Interfaces:
Advice, ConstructorInterceptor, Interceptor, MethodInterceptor, Serializable
Direct Known Subclasses:
NonBlockingStubWrapper

public class StubWrapper
extends Wrapper

StubWrapper is a dynamic client stub for org.objectweb.jac. Every method called on an object wrapped by such a wrapper is forwarded to a remote reference. The call is blocking. For non-blocking calls see NonBlockingStubWrapper. This a wrapper class. The invoke method wraps all the methods of a wrappee.

Author:
Lionel Seinturier
See Also:
NonBlockingStubWrapper, Serialized Form

Field Summary
protected  RemoteRef remoteRef
          The remote reference attached to this stub
 
Fields inherited from class org.objectweb.jac.core.Wrapper
ac, cr
 
Constructor Summary
StubWrapper(AspectComponent ac, RemoteRef remoteRef)
          Construct a new dynamic stub.
StubWrapper(AspectComponent ac, String serverContainer)
          A more user-friendly constructor.
 
Method Summary
 Object _invoke(Interaction interaction)
          Forward a call to the remote reference.
 Object construct(ConstructorInvocation invocation)
           
 RemoteRef getRemoteRef()
          The getter method for the remoteRef field.
 Object invoke(MethodInvocation invocation)
           
 
Methods inherited from class org.objectweb.jac.core.Wrapper
attr, attrdef, defines, getAspectComponent, getAspectComponentName, getExceptionHandlers, proceed, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

remoteRef

protected RemoteRef remoteRef
The remote reference attached to this stub

Constructor Detail

StubWrapper

public StubWrapper(AspectComponent ac,
                   RemoteRef remoteRef)
Construct a new dynamic stub.

Parameters:
remoteRef - the remote reference associated to the stub

StubWrapper

public StubWrapper(AspectComponent ac,
                   String serverContainer)
A more user-friendly constructor.

Parameters:
serverContainer - the name of the container where the server is deployed (can be a regular expression)
Method Detail

getRemoteRef

public RemoteRef getRemoteRef()
The getter method for the remoteRef field.

Returns:
the remoteRef field

_invoke

public Object _invoke(Interaction interaction)
Forward a call to the remote reference.


invoke

public Object invoke(MethodInvocation invocation)
              throws Throwable
Specified by:
invoke in interface MethodInterceptor
Overrides:
invoke in class Wrapper
Throwable

construct

public Object construct(ConstructorInvocation invocation)
                 throws Throwable
Specified by:
construct in interface ConstructorInterceptor
Overrides:
construct in class Wrapper
Throwable