org.objectweb.david.libs.helpers
Class RMIUtilDelegate

java.lang.Object
  extended byorg.objectweb.david.libs.helpers.RMIUtilDelegate
All Implemented Interfaces:
Constants, javax.rmi.CORBA.UtilDelegate

public class RMIUtilDelegate
extends java.lang.Object
implements javax.rmi.CORBA.UtilDelegate, Constants

Delegate class for javax.rmi.CORBA.Util.

This class is parameterized using elements of the bootstrap context:


Field Summary
 
Fields inherited from interface org.objectweb.david.libs.binding.orbs.Constants
corba_object_id, corba_prefix, TC_any, TC_boolean, TC_char, TC_double, TC_float, TC_long, TC_longdouble, TC_longlong, TC_null, TC_Object, TC_octet, TC_Principal, TC_short, TC_string, tc_table, TC_TypeCode, TC_ulong, TC_ulonglong, TC_ushort, TC_void, TC_wchar, TC_wstring
 
Constructor Summary
RMIUtilDelegate()
          Constructs a new RMIUtilDelegate.
 
Method Summary
 java.lang.Object copyObject(java.lang.Object obj, org.omg.CORBA.ORB orb)
          This method is used by local stubs to copy an actual parameter, result object or exception.
 java.lang.Object[] copyObjects(java.lang.Object[] obj_array, org.omg.CORBA.ORB orb)
          This method do the same as above on multiple objects,preserving sharing among these objects.
 javax.rmi.CORBA.ValueHandler createValueHandler()
          This method returns a singleton instance of a class that implements the ValueHandler interface.
 java.lang.String getCodebase(java.lang.Class classe)
          This method returns the codebase for the Class object classe as a space-separated list of URLs.
 javax.rmi.CORBA.Tie getTie(java.rmi.Remote target)
          This method returns the Tie object for an implementation object target, or null if no Tie is registered for the target object.
 boolean isLocal(javax.rmi.CORBA.Stub s)
          This method has the same semantics as the ObjectImpl._is_local() method, except that it can throw a RemoteException.
 java.lang.Class loadClass(java.lang.String name, java.lang.String code_base, java.lang.ClassLoader context)
          This method loads a java class of the provided name, using additional information passed in the code_base and context parameters.
 java.rmi.RemoteException mapSystemException(org.omg.CORBA.SystemException ex)
          This method maps a CORBA system exception to a RemoteException
 java.lang.Object readAny(org.omg.CORBA.portable.InputStream in)
          This method reads a GIOP any from the input stream inand unmarshals it as a java object.
 void registerTarget(javax.rmi.CORBA.Tie tie, java.rmi.Remote target)
          This method is needed to support unexportObject, because it takes a target implementation object as its parameter, it is necessary for the Util class to maintain a table mapping target objects back to their associated Ties.
 void unexportObject(java.rmi.Remote target)
          This method deactivates an implementation object and remove its associated Tie from the table maintained by the Util class.
 java.rmi.RemoteException wrapException(java.lang.Throwable obj)
          The wrapException method wraps an exception thrown by an implementation method.
 void writeAbstractObject(org.omg.CORBA.portable.OutputStream out, java.lang.Object obj)
          This method is another similar utility method for used by stubs.
 void writeAny(org.omg.CORBA.portable.OutputStream out, java.lang.Object object)
          This method writes the java object object to the output stream out in the form of a CORBA any.
 void writeRemoteObject(org.omg.CORBA.portable.OutputStream out, java.lang.Object obj)
          This method is an utility method for use by stubs when writing an RMI/IDL object reference to an output stream.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RMIUtilDelegate

public RMIUtilDelegate()
Constructs a new RMIUtilDelegate.

Method Detail

mapSystemException

public java.rmi.RemoteException mapSystemException(org.omg.CORBA.SystemException ex)
This method maps a CORBA system exception to a RemoteException

Specified by:
mapSystemException in interface javax.rmi.CORBA.UtilDelegate
Parameters:
ex - a CORBA system exception.
Returns:
an RMI RemoteException.

writeAny

public void writeAny(org.omg.CORBA.portable.OutputStream out,
                     java.lang.Object object)
This method writes the java object object to the output stream out in the form of a CORBA any.

Specified by:
writeAny in interface javax.rmi.CORBA.UtilDelegate
Parameters:
out - a CORBA output stream;
object - a java object.

readAny

public java.lang.Object readAny(org.omg.CORBA.portable.InputStream in)
This method reads a GIOP any from the input stream inand unmarshals it as a java object.

Specified by:
readAny in interface javax.rmi.CORBA.UtilDelegate
Parameters:
in - a CORBA input stream.
Returns:
a java object.

writeRemoteObject

public void writeRemoteObject(org.omg.CORBA.portable.OutputStream out,
                              java.lang.Object obj)
This method is an utility method for use by stubs when writing an RMI/IDL object reference to an output stream.

Specified by:
writeRemoteObject in interface javax.rmi.CORBA.UtilDelegate
Parameters:
out - a CORBA output stream;
obj - an RMI/IDL object reference.

writeAbstractObject

public void writeAbstractObject(org.omg.CORBA.portable.OutputStream out,
                                java.lang.Object obj)
This method is another similar utility method for used by stubs.

Specified by:
writeAbstractObject in interface javax.rmi.CORBA.UtilDelegate
Parameters:
out - a CORBA output stream;
obj - an RMI/IDL abstract object.

registerTarget

public void registerTarget(javax.rmi.CORBA.Tie tie,
                           java.rmi.Remote target)
This method is needed to support unexportObject, because it takes a target implementation object as its parameter, it is necessary for the Util class to maintain a table mapping target objects back to their associated Ties.

Specified by:
registerTarget in interface javax.rmi.CORBA.UtilDelegate
Parameters:
tie - an RMI/IDL skeleton.
target - an RMI/IDL server implementation.

unexportObject

public void unexportObject(java.rmi.Remote target)
This method deactivates an implementation object and remove its associated Tie from the table maintained by the Util class.

Specified by:
unexportObject in interface javax.rmi.CORBA.UtilDelegate
Parameters:
target - an RMI/IDL server implementation.

getTie

public javax.rmi.CORBA.Tie getTie(java.rmi.Remote target)
This method returns the Tie object for an implementation object target, or null if no Tie is registered for the target object.

Specified by:
getTie in interface javax.rmi.CORBA.UtilDelegate
Parameters:
target - an RMI/IDL server implementation.
Returns:
the associated Tie.

createValueHandler

public javax.rmi.CORBA.ValueHandler createValueHandler()
This method returns a singleton instance of a class that implements the ValueHandler interface.

Specified by:
createValueHandler in interface javax.rmi.CORBA.UtilDelegate
Returns:
an implementation of the ValueHandler interface.

wrapException

public java.rmi.RemoteException wrapException(java.lang.Throwable obj)
The wrapException method wraps an exception thrown by an implementation method. It returns the corresponding client-side exception.

Specified by:
wrapException in interface javax.rmi.CORBA.UtilDelegate
Parameters:
obj - an exception thrown by an implementation method.
Returns:
the corresponding client-side exception.

copyObject

public java.lang.Object copyObject(java.lang.Object obj,
                                   org.omg.CORBA.ORB orb)
                            throws java.rmi.RemoteException
This method is used by local stubs to copy an actual parameter, result object or exception.

Specified by:
copyObject in interface javax.rmi.CORBA.UtilDelegate
Parameters:
obj - a parameter;
orb - a CORBA ORB;
Returns:
a copy of obj.
Throws:
java.rmi.RemoteException - if something goes wrong.

copyObjects

public java.lang.Object[] copyObjects(java.lang.Object[] obj_array,
                                      org.omg.CORBA.ORB orb)
                               throws java.rmi.RemoteException
This method do the same as above on multiple objects,preserving sharing among these objects.

Specified by:
copyObjects in interface javax.rmi.CORBA.UtilDelegate
Parameters:
obj_array - an array of Java objects.
orb - a CORBA ORB.
Returns:
a copy of obj_array.
Throws:
java.rmi.RemoteException - if something goes wrong.

isLocal

public boolean isLocal(javax.rmi.CORBA.Stub s)
                throws java.rmi.RemoteException
This method has the same semantics as the ObjectImpl._is_local() method, except that it can throw a RemoteException.

Specified by:
isLocal in interface javax.rmi.CORBA.UtilDelegate
Parameters:
s - a stub;
Returns:
true if the implementation of the target object may be accessed locally, false otherwise.
Throws:
java.rmi.RemoteException - if something goes wrong.

getCodebase

public java.lang.String getCodebase(java.lang.Class classe)
This method returns the codebase for the Class object classe as a space-separated list of URLs.

Specified by:
getCodebase in interface javax.rmi.CORBA.UtilDelegate
Parameters:
classe - a Class object.
Returns:
a String representing its codebase.

loadClass

public java.lang.Class loadClass(java.lang.String name,
                                 java.lang.String code_base,
                                 java.lang.ClassLoader context)
                          throws java.lang.ClassNotFoundException
This method loads a java class of the provided name, using additional information passed in the code_base and context parameters.

Specified by:
loadClass in interface javax.rmi.CORBA.UtilDelegate
Parameters:
name - the name of the class to load;
code_base - a code base indication;
context - a class loader indication;
Returns:
the loaded Class.
Throws:
java.lang.ClassNotFoundException - if the class could not be found.