javax.rmi.CORBA
Class Util

java.lang.Object
  extended by javax.rmi.CORBA.Util

public class Util
extends java.lang.Object

This class provides some utility methods to manage RMI objects and mechanisms over GIOP

Version:
$Revision: 1.3 $ $Date: 2004/02/10 21:02:52 $
Author:
Jerome Daniel

Constructor Summary
Util()
           
 
Method Summary
static java.lang.Object copyObject(java.lang.Object obj, ORB orb)
          This method is used by local stubs to copy an actuel parameter, result object or exception.
static java.lang.Object[] copyObjects(java.lang.Object[] obj, ORB orb)
          This method do the same as above on multiple objects.
static ValueHandler createValueHandler()
          This method returns a singleton instance of a class that implements the ValueHandler interface.
static java.lang.String getCodebase(java.lang.Class clz)
          This method returns a java class object for the Class object clz as a space-separated list of URLs.
static Tie getTie(java.rmi.Remote target)
          This method return the Tie object for an implementation object target, or null if no Tie is registered for the target object.
static boolean isLocal(Stub s)
          This method has the same semantics as the ObjectImpl _is_local() method, except that it can throw a RemoteException
static java.lang.Class loadClass(java.lang.String className, java.lang.String remoteCodebase, java.lang.Class loadingContext)
          This method loads a java class object the java class name, using additional information passed in the remoteCodeBase and loadingContext parameters.
static java.lang.Class loadClass(java.lang.String className, java.lang.String remoteCodebase, java.lang.ClassLoader loadingContext)
          This method loads a java class object the java class name, using additional information passed in the remoteCodeBase and loadingContext parameters.
static java.rmi.RemoteException mapSystemException(SystemException ex)
          This method maps a CORBA system exception to a java.rmi.RemoteException
static java.lang.Object readAny(InputStream in)
          This method reads a GIOP any from the input stream in and unmarshals it as a java object.
static void registerTarget(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.
static void unexportObject(java.rmi.Remote target)
          Thie method deactivates an implementation object and remove its associated Tie from the table mainted by the Util class.
static java.rmi.RemoteException wrapException(java.lang.Throwable obj)
          The wrapException method wraps an exception thrown by an implementation method.
static void writeAbstractObject(OutputStream out, java.lang.Object obj)
          This method is another similar utility method for used by stubs.
static void writeAny(OutputStream out, java.lang.Object obj)
          This method writes the java object obj to the output stream out in the form of a GIOP any.
static void writeRemoteObject(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

Util

public Util()
Method Detail

mapSystemException

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


writeAny

public static void writeAny(OutputStream out,
                            java.lang.Object obj)
This method writes the java object obj to the output stream out in the form of a GIOP any.


readAny

public static java.lang.Object readAny(InputStream in)
This method reads a GIOP any from the input stream in and unmarshals it as a java object.


writeRemoteObject

public static void writeRemoteObject(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.


writeAbstractObject

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


registerTarget

public static void registerTarget(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.


unexportObject

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


getTie

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


createValueHandler

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


wrapException

public static 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.


copyObject

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

Throws:
java.rmi.RemoteException

copyObjects

public static java.lang.Object[] copyObjects(java.lang.Object[] obj,
                                             ORB orb)
                                      throws java.rmi.RemoteException
This method do the same as above on multiple objects.

Throws:
java.rmi.RemoteException

isLocal

public static boolean isLocal(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

Throws:
java.rmi.RemoteException

getCodebase

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


loadClass

public static java.lang.Class loadClass(java.lang.String className,
                                        java.lang.String remoteCodebase,
                                        java.lang.Class loadingContext)
                                 throws java.lang.ClassNotFoundException
This method loads a java class object the java class name, using additional information passed in the remoteCodeBase and loadingContext parameters.

Throws:
java.lang.ClassNotFoundException

loadClass

public static java.lang.Class loadClass(java.lang.String className,
                                        java.lang.String remoteCodebase,
                                        java.lang.ClassLoader loadingContext)
                                 throws java.lang.ClassNotFoundException
This method loads a java class object the java class name, using additional information passed in the remoteCodeBase and loadingContext parameters.

Throws:
java.lang.ClassNotFoundException