edu.emory.mathcs.rmix.spi
Class AbstractRemoteRef

java.lang.Object
  extended byedu.emory.mathcs.rmix.spi.AbstractRemoteRef
All Implemented Interfaces:
RemoteRef

public abstract class AbstractRemoteRef
extends java.lang.Object
implements RemoteRef

Convenience base class for RMIX providers to implement RemoteRef. This class provides default implementations for all methods of the RemoteRef interface except RemoteRef.bind(edu.emory.mathcs.rmix.Parameters, java.lang.ClassLoader, boolean) and RemoteRef.externalize(). Most implementations will additionally override getParameter(java.lang.String), and setParameter(java.lang.String, java.lang.Object).

Version:
1.0
Author:
Dawid Kurzyniec

Field Summary
protected  Parameters.Binding allowedBinding
           
protected  BasicEndpointParams endpointParams
           
protected  ObjGUID guid
          GUID of the target object
protected  java.lang.String[] interfaces
          names of the remote interfaces available through this ref
protected  java.lang.String providerName
           
protected  AbstractServerRef sref
          Local server ref, or null if remote ref.
 
Constructor Summary
protected AbstractRemoteRef(ObjGUID guid, java.lang.String[] interfaces, AbstractServerRef sref, BasicEndpointParams endpointParams, java.lang.String providerName, Parameters.Binding allowedBinding)
          Creates a new RemoteRef instance.
 
Method Summary
 boolean equals(java.lang.Object other)
          should be overridden by subclasses
 java.lang.String[] getInterfaceNames()
          Returns the names of the remote interfaces which methods may be invoked through this reference.
 Rmix.LocalInvocationContext getLocalInvocationContext()
          Returns handle through which the client can bind locally.
 ObjGUID getObjGUID()
          Returns the GUID of the target object.
 java.lang.Object getParameter(java.lang.String name)
          Gets the value of the provider-specific parameter with a given name.
 java.lang.String getProtocol()
          Returns the RMIX protocol that this reference uses to communicate with the server.
 java.lang.String getProviderName()
          Returns the name of the RMIX provider that handles communication with the server.
 int hashCode()
           
 void setParameter(java.lang.String name, java.lang.Object value)
          Sets the value of the provider-specific parameter given by name.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface edu.emory.mathcs.rmix.RemoteRef
bind, externalize
 

Field Detail

sref

protected final transient AbstractServerRef sref
Local server ref, or null if remote ref. This field plays important role with RMI protocols using distributed garbage collection. In such cases, references local to the server object (e.g. those created by ServerRef.createClientRef() and not deserialized from remote stream) must keep strong reference to the serverRef or else it may become a subject to garbage collection (DGC does not apply to such local references). This field is also used in the implementation of getLocalInvocationContext().


guid

protected final ObjGUID guid
GUID of the target object


interfaces

protected final java.lang.String[] interfaces
names of the remote interfaces available through this ref


endpointParams

protected final BasicEndpointParams endpointParams

providerName

protected final java.lang.String providerName

allowedBinding

protected final Parameters.Binding allowedBinding
Constructor Detail

AbstractRemoteRef

protected AbstractRemoteRef(ObjGUID guid,
                            java.lang.String[] interfaces,
                            AbstractServerRef sref,
                            BasicEndpointParams endpointParams,
                            java.lang.String providerName,
                            Parameters.Binding allowedBinding)
Creates a new RemoteRef instance.

Parameters:
guid - the target object GUID.
interfaces - remote interfaces available through this ref.
Method Detail

getProtocol

public java.lang.String getProtocol()
Description copied from interface: RemoteRef
Returns the RMIX protocol that this reference uses to communicate with the server.

Specified by:
getProtocol in interface RemoteRef
Returns:
the RMIX protocol used

getProviderName

public java.lang.String getProviderName()
Description copied from interface: RemoteRef
Returns the name of the RMIX provider that handles communication with the server.

Specified by:
getProviderName in interface RemoteRef
Returns:
the name of the RMIX provider

getObjGUID

public ObjGUID getObjGUID()
Description copied from interface: RemoteRef
Returns the GUID of the target object.

Specified by:
getObjGUID in interface RemoteRef
Returns:
the GUID of the target object.

getInterfaceNames

public java.lang.String[] getInterfaceNames()
Description copied from interface: RemoteRef
Returns the names of the remote interfaces which methods may be invoked through this reference.

Specified by:
getInterfaceNames in interface RemoteRef
Returns:
remote interface names allowed through this reference.

setParameter

public void setParameter(java.lang.String name,
                         java.lang.Object value)
Description copied from interface: RemoteRef
Sets the value of the provider-specific parameter given by name. Implementations should reject any parameter that they do not support by throwing IllegalParameterException.

Specified by:
setParameter in interface RemoteRef
Parameters:
name - the name of the parameter to set.
value - the value of the parameter.

getParameter

public java.lang.Object getParameter(java.lang.String name)
Description copied from interface: RemoteRef
Gets the value of the provider-specific parameter with a given name.

Specified by:
getParameter in interface RemoteRef
Parameters:
name - the parameter name.
Returns:
the parameter value.

getLocalInvocationContext

public Rmix.LocalInvocationContext getLocalInvocationContext()
Returns handle through which the client can bind locally.

Specified by:
getLocalInvocationContext in interface RemoteRef
Returns:
the context for local binding.

equals

public boolean equals(java.lang.Object other)
should be overridden by subclasses


hashCode

public int hashCode()