org.objectweb.carol.rmi.jrmp.server
Class JUnicastRef

java.lang.Object
  |
  +--sun.rmi.server.UnicastRef
        |
        +--org.objectweb.carol.rmi.jrmp.server.JUnicastRef
All Implemented Interfaces:
java.io.Externalizable, java.rmi.server.RemoteRef, java.io.Serializable
Direct Known Subclasses:
JUnicastRefSf

public class JUnicastRef
extends sun.rmi.server.UnicastRef

Class JUnicastRef is the CAROL JRMP UnicastRef with context propagation

Version:
1.0, 15/07/2002 Unicast Reference ensuring context propagation
Author:
Guillaume Riviere (Guillaume.Riviere@inrialpes.fr)
See Also:
Serialized Form

Field Summary
protected  JClientRequestInterceptor[] cis
          Client Interceptor for context propagation
 
Fields inherited from class sun.rmi.server.UnicastRef
clientCallLog, clientRefLog, ref
 
Fields inherited from interface java.rmi.server.RemoteRef
packagePrefix, serialVersionUID
 
Constructor Summary
JUnicastRef()
          empty constructor
JUnicastRef(sun.rmi.transport.LiveRef liveRef)
          Constructor without Interceptor
JUnicastRef(sun.rmi.transport.LiveRef liveRef, JClientRequestInterceptor[] cis)
          Constructor with interceptor
 
Method Summary
 java.lang.String getRefClass(java.io.ObjectOutput out)
          get the ref class always return null
 void invoke(java.rmi.server.RemoteCall call)
          v1.1 style of Stubs call this invoke
 java.lang.Object invoke(java.rmi.Remote obj, java.lang.reflect.Method method, java.lang.Object[] params, long opnum)
          wrap the call to send the contexts
protected  void marshalCustomCallData(java.io.ObjectOutput out)
          override marshalCustomCallData to pass and disociate contexts on the client
 java.rmi.server.RemoteCall newCall(java.rmi.server.RemoteObject obj, java.rmi.server.Operation[] ops, int opnum, long hash)
          override v1.1 RemoteCall instanciation to wrap the call and send the context
 void readExternal(java.io.ObjectInput in)
          override readExternal to initialise localRef We could actually receive anything from the server on lookup
 void readExternal(java.io.ObjectInput in, boolean newFormat)
          override readExternal to initialise localRef We could actually receive anything from the server on lookup
 void writeExternal(java.io.ObjectOutput out)
          override writeExternal to send spaceID We could actually send anything to the client on lookup
 void writeExternal(java.io.ObjectOutput out, boolean newFormat)
          override writeExternal to send spaceID And the interceptor We could actually send anything to the client on lookup
 
Methods inherited from class sun.rmi.server.UnicastRef
done, marshalValue, remoteEquals, remoteHashCode, remoteToString, unmarshalValue
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cis

protected JClientRequestInterceptor[] cis
Client Interceptor for context propagation

Constructor Detail

JUnicastRef

public JUnicastRef()
empty constructor


JUnicastRef

public JUnicastRef(sun.rmi.transport.LiveRef liveRef)
Constructor without Interceptor

Parameters:
liveRef - the live reference

JUnicastRef

public JUnicastRef(sun.rmi.transport.LiveRef liveRef,
                   JClientRequestInterceptor[] cis)
Constructor with interceptor

Parameters:
liveRef - the live reference
cis - the client interceptor array
Method Detail

getRefClass

public java.lang.String getRefClass(java.io.ObjectOutput out)
get the ref class always return null

Specified by:
getRefClass in interface java.rmi.server.RemoteRef
Overrides:
getRefClass in class sun.rmi.server.UnicastRef
Parameters:
out - the output stream

invoke

public java.lang.Object invoke(java.rmi.Remote obj,
                               java.lang.reflect.Method method,
                               java.lang.Object[] params,
                               long opnum)
                        throws java.lang.Exception
wrap the call to send the contexts

Specified by:
invoke in interface java.rmi.server.RemoteRef
Overrides:
invoke in class sun.rmi.server.UnicastRef
Parameters:
obj - the remote object to invoke
method - the method to invoque
params - the methid parametters
opnum - the operation number
java.lang.Exception

invoke

public void invoke(java.rmi.server.RemoteCall call)
            throws java.lang.Exception
v1.1 style of Stubs call this invoke

Specified by:
invoke in interface java.rmi.server.RemoteRef
Overrides:
invoke in class sun.rmi.server.UnicastRef
Parameters:
call - the remote call
java.lang.Exception

newCall

public java.rmi.server.RemoteCall newCall(java.rmi.server.RemoteObject obj,
                                          java.rmi.server.Operation[] ops,
                                          int opnum,
                                          long hash)
                                   throws java.rmi.RemoteException
override v1.1 RemoteCall instanciation to wrap the call and send the context

Specified by:
newCall in interface java.rmi.server.RemoteRef
Overrides:
newCall in class sun.rmi.server.UnicastRef
Parameters:
obj - the remote object
ops - the operation
opnum - the operation number
hash - the hash code
java.rmi.RemoteException

marshalCustomCallData

protected void marshalCustomCallData(java.io.ObjectOutput out)
                              throws java.io.IOException
override marshalCustomCallData to pass and disociate contexts on the client

Overrides:
marshalCustomCallData in class sun.rmi.server.UnicastRef
Parameters:
out - the ObjectOutput for the call marchalling
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
override readExternal to initialise localRef We could actually receive anything from the server on lookup

Specified by:
readExternal in interface java.io.Externalizable
Overrides:
readExternal in class sun.rmi.server.UnicastRef
Parameters:
in - the ObjectInput
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
override writeExternal to send spaceID We could actually send anything to the client on lookup

Specified by:
writeExternal in interface java.io.Externalizable
Overrides:
writeExternal in class sun.rmi.server.UnicastRef
Parameters:
out - the object output stream
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in,
                         boolean newFormat)
                  throws java.io.IOException,
                         java.lang.ClassNotFoundException
override readExternal to initialise localRef We could actually receive anything from the server on lookup

Parameters:
in - the objject imput
newFormat - the new format boolean
java.io.IOException
java.lang.ClassNotFoundException

writeExternal

public void writeExternal(java.io.ObjectOutput out,
                          boolean newFormat)
                   throws java.io.IOException
override writeExternal to send spaceID And the interceptor We could actually send anything to the client on lookup

Parameters:
out - the object output
newFormat - the boolean new format
java.io.IOException