edu.emory.mathcs.rmix
Interface RemoteRef

All Known Implementing Classes:
AbstractRemoteRef

public interface RemoteRef

Client-side remote reference of the remote object. RMIX providers must supply implementations for this interface. The implementations should not attempt to resolve any remote interface classes needed by stubs, since this is the task of the Invoker. Because the interfaces (and remote methods) are not resolved, RemoteRef is not capable of performing remote method invocations.

Version:
1.0
Author:
Dawid Kurzyniec
See Also:
AbstractRemoteRef

Method Summary
 Invoker bind(Parameters bindParams, java.lang.ClassLoader cloader, boolean resolveAll)
          Creates an invoker that is bound to this reference and resolves remote interfaces using supplied class loader, or the system class loader if the cloader is null.
 UnifiedRemoteRef externalize()
          Transforms this reference to the unified format, suitable for serialization by any RMIX provider.
 java.lang.String[] getInterfaceNames()
          Returns the names of the remote interfaces which methods may be invoked through this reference.
 Rmix.LocalInvocationContext getLocalInvocationContext()
          If this reference is local to the target object (that is, if it exists inside the server VM), the RMIX-provider implementation MAY return an Rmix.LocalInvocationContext encapculating this server reference if it wishes to support non-remote bindings.
 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.
 void setParameter(java.lang.String name, java.lang.Object value)
          Sets the value of the provider-specific parameter given by name.
 

Method Detail

getObjGUID

public ObjGUID getObjGUID()
Returns the GUID of the target object.

Returns:
the GUID of the target object.

getInterfaceNames

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

Returns:
remote interface names allowed through this reference.

getProtocol

public java.lang.String getProtocol()
Returns the RMIX protocol that this reference uses to communicate with the server.

Returns:
the RMIX protocol used

getProviderName

public java.lang.String getProviderName()
Returns the name of the RMIX provider that handles communication with the server.

Returns:
the name of the RMIX provider

getLocalInvocationContext

public Rmix.LocalInvocationContext getLocalInvocationContext()
If this reference is local to the target object (that is, if it exists inside the server VM), the RMIX-provider implementation MAY return an Rmix.LocalInvocationContext encapculating this server reference if it wishes to support non-remote bindings. The encapsulation ensures that no additional access (like access to the ServerRef.unexport() method) is granted to unauthorized users via this method.

Returns:
the local invocation context encapsulating direst server reference, or null if this reference is not bound at the server side or if the RMIX provider does not wish to support non-remote bindings.

setParameter

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

Parameters:
name - the name of the parameter to set.
value - the value of the parameter.
Throws:
IllegalParameterException - if the provider does not recognize the parameter with that name, or if the parameter is not of the appropriate type.
java.lang.UnsupportedOperationException - if the parameter cannot be written (for instance, if it is read-only).

getParameter

public java.lang.Object getParameter(java.lang.String name)
                              throws IllegalParameterException,
                                     java.lang.UnsupportedOperationException
Gets the value of the provider-specific parameter with a given name.

Parameters:
name - the parameter name.
Returns:
the parameter value.
Throws:
IllegalParameterException - if the provider does not recognize the parameter with that name.
java.lang.UnsupportedOperationException - if the parameter cannot be read (for instance, if it is write-only).

bind

public Invoker bind(Parameters bindParams,
                    java.lang.ClassLoader cloader,
                    boolean resolveAll)
             throws java.lang.ClassNotFoundException,
                    IllegalParameterException
Creates an invoker that is bound to this reference and resolves remote interfaces using supplied class loader, or the system class loader if the cloader is null. Implementations should parse bindParams and reject any unsupported parameters by throwing IllegalParameterException. This method is usually invoked from Rmix.bind.

Parameters:
bindParams - bind parameters
cloader - the class loader to resolve remote interfaces, or null
resolveAll - if true, failure to resolve a remote interface causes ClassNotFoundException. Otherwise, unresolved interfaces are omitted.
Returns:
newly created Invoker bound to this reference
Throws:
java.lang.ClassNotFoundException - if resolveAll is true and some remote interfaces cannot be resolved.
IllegalParameterException - if bindParams contains unsupported or invalid bind parameters.

externalize

public UnifiedRemoteRef externalize()
Transforms this reference to the unified format, suitable for serialization by any RMIX provider.

Returns:
this reference transformed to the unified format.