edu.emory.mathcs.rmix
Class UnifiedRemoteRef

java.lang.Object
  extended byedu.emory.mathcs.rmix.UnifiedRemoteRef
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class UnifiedRemoteRef
extends java.lang.Object
implements java.io.Externalizable

The unified representation of the remote reference. All RMIX providers must be able to convert their remote references to and back from this representation. The unified representation has five components: protocol, binding, interfaces, location, and GUID. The "protocol" is a protocol name understood by the server reference. The "GUID" is stringified ObjGUID of the target remote object. The "interfaces" component is the list of interfaces available via this reference. The "location" component is a protocol-specific physical address of the server endpoint. The "binding" component is a protocol-specific value denoting miscellaneous properties of the server ref, and the encoding format of the "location" component.

Version:
1.0
Author:
Dawid Kurzyniec
See Also:
Serialized Form

Constructor Summary
UnifiedRemoteRef()
          Creates new, empty unified remote reference.
UnifiedRemoteRef(java.lang.String protocol, java.lang.String binding, java.lang.String[] interfaces, java.lang.String location, ObjGUID objGUID)
          Creates new unified remote reference with specified components.
UnifiedRemoteRef(java.lang.String protocol, java.lang.String binding, java.lang.String[] interfaces, java.lang.String location, java.lang.String objGUID)
          Creates new unified remote reference with specified components.
 
Method Summary
 boolean equals(java.lang.Object obj)
           
static UnifiedRemoteRef fromXML(java.lang.String xml)
          Parses the unified referene from the XML format.
 java.lang.String getBinding()
          Gets the binding component.
 java.lang.String[] getInterfaces()
          Gets the interfaces component.
 java.lang.String getLocation()
          Gets the location component.
 java.lang.String getObjGUID()
          Gets the GUID component.
 java.lang.String getProtocol()
          Gets the protocol component.
 void readExternal(java.io.ObjectInput in)
          Reads fields of this ref from the external form.
 RemoteRef resolve()
          Reconstructs a remote reference out of this unified remote reference.
 RemoteRef resolve(java.lang.String provider)
          Reconstructs a remote reference out of this unified remote reference using the specific provider.
 void setBinding(java.lang.String binding)
          Sets the binding component.
 void setInterfaces(java.lang.String[] interfaces)
          Sets the interfaces component.
 void setLocation(java.lang.String location)
          Sets the location component.
 void setObjGUID(java.lang.String objGUID)
          Sets the GUID component.
 void setProtocol(java.lang.String protocol)
          Sets the protocol component.
 java.lang.String toXML()
          Converts this reference to the XML format.
 void writeExternal(java.io.ObjectOutput out)
          Writes fields of this ref to the external form.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UnifiedRemoteRef

public UnifiedRemoteRef(java.lang.String protocol,
                        java.lang.String binding,
                        java.lang.String[] interfaces,
                        java.lang.String location,
                        ObjGUID objGUID)
Creates new unified remote reference with specified components.

Parameters:
protocol - the protocol component.
binding - the binding component.
interfaces - the interfaces component.
location - the location component.
objGUID - the objGUID component.

UnifiedRemoteRef

public UnifiedRemoteRef(java.lang.String protocol,
                        java.lang.String binding,
                        java.lang.String[] interfaces,
                        java.lang.String location,
                        java.lang.String objGUID)
Creates new unified remote reference with specified components.

Parameters:
protocol - the protocol component.
binding - the binding component.
interfaces - the interfaces component.
location - the location component.
objGUID - the objGUID component.

UnifiedRemoteRef

public UnifiedRemoteRef()
Creates new, empty unified remote reference.

Method Detail

getProtocol

public java.lang.String getProtocol()
Gets the protocol component.


getBinding

public java.lang.String getBinding()
Gets the binding component.


getInterfaces

public java.lang.String[] getInterfaces()
Gets the interfaces component.


getLocation

public java.lang.String getLocation()
Gets the location component.


getObjGUID

public java.lang.String getObjGUID()
Gets the GUID component.


setProtocol

public void setProtocol(java.lang.String protocol)
Sets the protocol component.


setBinding

public void setBinding(java.lang.String binding)
Sets the binding component.


setInterfaces

public void setInterfaces(java.lang.String[] interfaces)
Sets the interfaces component.


setLocation

public void setLocation(java.lang.String location)
Sets the location component.


setObjGUID

public void setObjGUID(java.lang.String objGUID)
Sets the GUID component.


writeExternal

public void writeExternal(java.io.ObjectOutput out)
                   throws java.io.IOException
Writes fields of this ref to the external form. Since the external form uses only XDR-encoded ints and UTF-encoded strings, it can serve as a bridge between Java and non-Java peers.

Specified by:
writeExternal in interface java.io.Externalizable
Throws:
java.io.IOException

readExternal

public void readExternal(java.io.ObjectInput in)
                  throws java.io.IOException
Reads fields of this ref from the external form. Since the external form uses only XDR-encoded ints and UTF-encoded strings, it can serve as a bridge between Java and non-Java peers.

Specified by:
readExternal in interface java.io.Externalizable
Throws:
java.io.IOException

resolve

public RemoteRef resolve(java.lang.String provider)
                  throws ProviderNotFoundException,
                         java.rmi.RemoteException
Reconstructs a remote reference out of this unified remote reference using the specific provider.

Returns:
reconstructed remote reference.
Throws:
ProviderNotFoundException - if the RMIX provider for this reference cannot be found.
RemoteException - if the reconstruction fails.

resolve

public RemoteRef resolve()
                  throws ProviderNotFoundException,
                         java.rmi.RemoteException
Reconstructs a remote reference out of this unified remote reference.

Returns:
reconstructed remote reference.
Throws:
ProviderNotFoundException - if the RMIX provider for this reference cannot be found.
RemoteException - if the reconstruction fails.

toXML

public java.lang.String toXML()
Converts this reference to the XML format.

Returns:
this reference in the XML format.

fromXML

public static UnifiedRemoteRef fromXML(java.lang.String xml)
Parses the unified referene from the XML format.

Parameters:
xml - the xml format of the unified reference.
Returns:
the reconstructed reference.

equals

public boolean equals(java.lang.Object obj)