javax.rmi.CORBA
Class Util

java.lang.Object sample code for java.lang.Object definition code for java.lang.Object 
  extended by javax.rmi.CORBA.Util

public class Util
extends Object sample code for java.lang.Object definition code for java.lang.Object

Provides utility methods that can be used by stubs and ties to perform common operations.


Method Summary
static Object sample code for java.lang.Object definition code for java.lang.Object copyObject sample code for javax.rmi.CORBA.Util.copyObject(java.lang.Object, org.omg.CORBA.ORB) definition code for javax.rmi.CORBA.Util.copyObject(java.lang.Object, org.omg.CORBA.ORB) (Object sample code for java.lang.Object definition code for java.lang.Object  obj, ORB sample code for org.omg.CORBA.ORB definition code for org.omg.CORBA.ORB  orb)
          Copies or connects an object.
static Object sample code for java.lang.Object definition code for java.lang.Object [] copyObjects sample code for javax.rmi.CORBA.Util.copyObjects(java.lang.Object[], org.omg.CORBA.ORB) definition code for javax.rmi.CORBA.Util.copyObjects(java.lang.Object[], org.omg.CORBA.ORB) (Object sample code for java.lang.Object definition code for java.lang.Object [] obj, ORB sample code for org.omg.CORBA.ORB definition code for org.omg.CORBA.ORB  orb)
          Copies or connects an array of objects.
static ValueHandler sample code for javax.rmi.CORBA.ValueHandler definition code for javax.rmi.CORBA.ValueHandler createValueHandler sample code for javax.rmi.CORBA.Util.createValueHandler() definition code for javax.rmi.CORBA.Util.createValueHandler() ()
          Returns a singleton instance of a class that implements the ValueHandler sample code for javax.rmi.CORBA.ValueHandler definition code for javax.rmi.CORBA.ValueHandler interface.
static String sample code for java.lang.String definition code for java.lang.String getCodebase sample code for javax.rmi.CORBA.Util.getCodebase(java.lang.Class) definition code for javax.rmi.CORBA.Util.getCodebase(java.lang.Class) (Class sample code for java.lang.Class definition code for java.lang.Class  clz)
          Returns the codebase, if any, for the given class.
static Tie sample code for javax.rmi.CORBA.Tie definition code for javax.rmi.CORBA.Tie getTie sample code for javax.rmi.CORBA.Util.getTie(java.rmi.Remote) definition code for javax.rmi.CORBA.Util.getTie(java.rmi.Remote) (Remote sample code for java.rmi.Remote definition code for java.rmi.Remote  target)
          Returns the tie (if any) for a given target object.
static boolean isLocal sample code for javax.rmi.CORBA.Util.isLocal(javax.rmi.CORBA.Stub) definition code for javax.rmi.CORBA.Util.isLocal(javax.rmi.CORBA.Stub) (Stub sample code for javax.rmi.CORBA.Stub definition code for javax.rmi.CORBA.Stub  stub)
          The isLocal method has the same semantics as the ObjectImpl._is_local method, except that it can throw a RemoteException.
static Class sample code for java.lang.Class definition code for java.lang.Class loadClass sample code for javax.rmi.CORBA.Util.loadClass(java.lang.String, java.lang.String, java.lang.ClassLoader) definition code for javax.rmi.CORBA.Util.loadClass(java.lang.String, java.lang.String, java.lang.ClassLoader) (String sample code for java.lang.String definition code for java.lang.String  className, String sample code for java.lang.String definition code for java.lang.String  remoteCodebase, ClassLoader sample code for java.lang.ClassLoader definition code for java.lang.ClassLoader  loader)
          Returns a class instance for the specified class.
static RemoteException sample code for java.rmi.RemoteException definition code for java.rmi.RemoteException mapSystemException sample code for javax.rmi.CORBA.Util.mapSystemException(org.omg.CORBA.SystemException) definition code for javax.rmi.CORBA.Util.mapSystemException(org.omg.CORBA.SystemException) (SystemException sample code for org.omg.CORBA.SystemException definition code for org.omg.CORBA.SystemException  ex)
          Maps a SystemException to a RemoteException.
static Object sample code for java.lang.Object definition code for java.lang.Object readAny sample code for javax.rmi.CORBA.Util.readAny(org.omg.CORBA.portable.InputStream) definition code for javax.rmi.CORBA.Util.readAny(org.omg.CORBA.portable.InputStream) (InputStream sample code for org.omg.CORBA.portable.InputStream definition code for org.omg.CORBA.portable.InputStream  in)
          Reads a java.lang.Object as a CORBA any.
static void registerTarget sample code for javax.rmi.CORBA.Util.registerTarget(javax.rmi.CORBA.Tie, java.rmi.Remote) definition code for javax.rmi.CORBA.Util.registerTarget(javax.rmi.CORBA.Tie, java.rmi.Remote) (Tie sample code for javax.rmi.CORBA.Tie definition code for javax.rmi.CORBA.Tie  tie, Remote sample code for java.rmi.Remote definition code for java.rmi.Remote  target)
          Registers a target for a tie.
static void unexportObject sample code for javax.rmi.CORBA.Util.unexportObject(java.rmi.Remote) definition code for javax.rmi.CORBA.Util.unexportObject(java.rmi.Remote) (Remote sample code for java.rmi.Remote definition code for java.rmi.Remote  target)
          Removes the associated tie from an internal table and calls Tie.deactivate() sample code for javax.rmi.CORBA.Tie.deactivate() definition code for javax.rmi.CORBA.Tie.deactivate() to deactivate the object.
static RemoteException sample code for java.rmi.RemoteException definition code for java.rmi.RemoteException wrapException sample code for javax.rmi.CORBA.Util.wrapException(java.lang.Throwable) definition code for javax.rmi.CORBA.Util.wrapException(java.lang.Throwable) (Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable  orig)
          Wraps an exception thrown by an implementation method.
static void writeAbstractObject sample code for javax.rmi.CORBA.Util.writeAbstractObject(org.omg.CORBA.portable.OutputStream, java.lang.Object) definition code for javax.rmi.CORBA.Util.writeAbstractObject(org.omg.CORBA.portable.OutputStream, java.lang.Object) (OutputStream sample code for org.omg.CORBA.portable.OutputStream definition code for org.omg.CORBA.portable.OutputStream  out, Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Writes a java.lang.Object as either a value or a CORBA Object.
static void writeAny sample code for javax.rmi.CORBA.Util.writeAny(org.omg.CORBA.portable.OutputStream, java.lang.Object) definition code for javax.rmi.CORBA.Util.writeAny(org.omg.CORBA.portable.OutputStream, java.lang.Object) (OutputStream sample code for org.omg.CORBA.portable.OutputStream definition code for org.omg.CORBA.portable.OutputStream  out, Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Writes any java.lang.Object as a CORBA any.
static void writeRemoteObject sample code for javax.rmi.CORBA.Util.writeRemoteObject(org.omg.CORBA.portable.OutputStream, java.lang.Object) definition code for javax.rmi.CORBA.Util.writeRemoteObject(org.omg.CORBA.portable.OutputStream, java.lang.Object) (OutputStream sample code for org.omg.CORBA.portable.OutputStream definition code for org.omg.CORBA.portable.OutputStream  out, Object sample code for java.lang.Object definition code for java.lang.Object  obj)
          Writes a java.lang.Object as a CORBA Object.
 
Methods inherited from class java.lang.Object sample code for java.lang.Object definition code for java.lang.Object
clone sample code for java.lang.Object.clone() definition code for java.lang.Object.clone() , equals sample code for java.lang.Object.equals(java.lang.Object) definition code for java.lang.Object.equals(java.lang.Object) , finalize sample code for java.lang.Object.finalize() definition code for java.lang.Object.finalize() , getClass sample code for java.lang.Object.getClass() definition code for java.lang.Object.getClass() , hashCode sample code for java.lang.Object.hashCode() definition code for java.lang.Object.hashCode() , notify sample code for java.lang.Object.notify() definition code for java.lang.Object.notify() , notifyAll sample code for java.lang.Object.notifyAll() definition code for java.lang.Object.notifyAll() , toString sample code for java.lang.Object.toString() definition code for java.lang.Object.toString() , wait sample code for java.lang.Object.wait() definition code for java.lang.Object.wait() , wait sample code for java.lang.Object.wait(long) definition code for java.lang.Object.wait(long) , wait sample code for java.lang.Object.wait(long, int) definition code for java.lang.Object.wait(long, int)
 

Method Detail

mapSystemException sample code for javax.rmi.CORBA.Util.mapSystemException(org.omg.CORBA.SystemException) definition code for javax.rmi.CORBA.Util.mapSystemException(org.omg.CORBA.SystemException)

public static RemoteException sample code for java.rmi.RemoteException definition code for java.rmi.RemoteException  mapSystemException(SystemException sample code for org.omg.CORBA.SystemException definition code for org.omg.CORBA.SystemException  ex)
Maps a SystemException to a RemoteException.

Parameters:
ex - the SystemException to map.
Returns:
the mapped exception.

writeAny sample code for javax.rmi.CORBA.Util.writeAny(org.omg.CORBA.portable.OutputStream, java.lang.Object) definition code for javax.rmi.CORBA.Util.writeAny(org.omg.CORBA.portable.OutputStream, java.lang.Object)

public static void writeAny(OutputStream sample code for org.omg.CORBA.portable.OutputStream definition code for org.omg.CORBA.portable.OutputStream  out,
                            Object sample code for java.lang.Object definition code for java.lang.Object  obj)
Writes any java.lang.Object as a CORBA any.

Parameters:
out - the stream in which to write the any.
obj - the object to write as an any.

readAny sample code for javax.rmi.CORBA.Util.readAny(org.omg.CORBA.portable.InputStream) definition code for javax.rmi.CORBA.Util.readAny(org.omg.CORBA.portable.InputStream)

public static Object sample code for java.lang.Object definition code for java.lang.Object  readAny(InputStream sample code for org.omg.CORBA.portable.InputStream definition code for org.omg.CORBA.portable.InputStream  in)
Reads a java.lang.Object as a CORBA any.

Parameters:
in - the stream from which to read the any.
Returns:
the object read from the stream.

writeRemoteObject sample code for javax.rmi.CORBA.Util.writeRemoteObject(org.omg.CORBA.portable.OutputStream, java.lang.Object) definition code for javax.rmi.CORBA.Util.writeRemoteObject(org.omg.CORBA.portable.OutputStream, java.lang.Object)

public static void writeRemoteObject(OutputStream sample code for org.omg.CORBA.portable.OutputStream definition code for org.omg.CORBA.portable.OutputStream  out,
                                     Object sample code for java.lang.Object definition code for java.lang.Object  obj)
Writes a java.lang.Object as a CORBA Object. If obj is an exported RMI-IIOP server object, the tie is found and wired to obj, then written to out.write_Object(org.omg.CORBA.Object). If obj is a CORBA Object, it is written to out.write_Object(org.omg.CORBA.Object).

Parameters:
out - the stream in which to write the object.
obj - the object to write.

writeAbstractObject sample code for javax.rmi.CORBA.Util.writeAbstractObject(org.omg.CORBA.portable.OutputStream, java.lang.Object) definition code for javax.rmi.CORBA.Util.writeAbstractObject(org.omg.CORBA.portable.OutputStream, java.lang.Object)

public static void writeAbstractObject(OutputStream sample code for org.omg.CORBA.portable.OutputStream definition code for org.omg.CORBA.portable.OutputStream  out,
                                       Object sample code for java.lang.Object definition code for java.lang.Object  obj)
Writes a java.lang.Object as either a value or a CORBA Object. If obj is a value object or a stub object, it is written to out.write_abstract_interface(java.lang.Object). If obj is an exported RMI-IIOP server object, the tie is found and wired to obj, then written to out.write_abstract_interface(java.lang.Object).

Parameters:
out - the stream in which to write the object.
obj - the object to write.

registerTarget sample code for javax.rmi.CORBA.Util.registerTarget(javax.rmi.CORBA.Tie, java.rmi.Remote) definition code for javax.rmi.CORBA.Util.registerTarget(javax.rmi.CORBA.Tie, java.rmi.Remote)

public static void registerTarget(Tie sample code for javax.rmi.CORBA.Tie definition code for javax.rmi.CORBA.Tie  tie,
                                  Remote sample code for java.rmi.Remote definition code for java.rmi.Remote  target)
Registers a target for a tie. Adds the tie to an internal table and calls Tie.setTarget(java.rmi.Remote) sample code for javax.rmi.CORBA.Tie.setTarget(java.rmi.Remote) definition code for javax.rmi.CORBA.Tie.setTarget(java.rmi.Remote) on the tie object.

Parameters:
tie - the tie to register.
target - the target for the tie.

unexportObject sample code for javax.rmi.CORBA.Util.unexportObject(java.rmi.Remote) definition code for javax.rmi.CORBA.Util.unexportObject(java.rmi.Remote)

public static void unexportObject(Remote sample code for java.rmi.Remote definition code for java.rmi.Remote  target)
                           throws NoSuchObjectException sample code for java.rmi.NoSuchObjectException definition code for java.rmi.NoSuchObjectException 
Removes the associated tie from an internal table and calls Tie.deactivate() sample code for javax.rmi.CORBA.Tie.deactivate() definition code for javax.rmi.CORBA.Tie.deactivate() to deactivate the object.

Parameters:
target - the object to unexport.
Throws:
NoSuchObjectException sample code for java.rmi.NoSuchObjectException definition code for java.rmi.NoSuchObjectException

getTie sample code for javax.rmi.CORBA.Util.getTie(java.rmi.Remote) definition code for javax.rmi.CORBA.Util.getTie(java.rmi.Remote)

public static Tie sample code for javax.rmi.CORBA.Tie definition code for javax.rmi.CORBA.Tie  getTie(Remote sample code for java.rmi.Remote definition code for java.rmi.Remote  target)
Returns the tie (if any) for a given target object.

Returns:
the tie or null if no tie is registered for the given target.

createValueHandler sample code for javax.rmi.CORBA.Util.createValueHandler() definition code for javax.rmi.CORBA.Util.createValueHandler()

public static ValueHandler sample code for javax.rmi.CORBA.ValueHandler definition code for javax.rmi.CORBA.ValueHandler  createValueHandler()
Returns a singleton instance of a class that implements the ValueHandler sample code for javax.rmi.CORBA.ValueHandler definition code for javax.rmi.CORBA.ValueHandler interface.

Returns:
a class which implements the ValueHandler interface.

getCodebase sample code for javax.rmi.CORBA.Util.getCodebase(java.lang.Class) definition code for javax.rmi.CORBA.Util.getCodebase(java.lang.Class)

public static String sample code for java.lang.String definition code for java.lang.String  getCodebase(Class sample code for java.lang.Class definition code for java.lang.Class  clz)
Returns the codebase, if any, for the given class.

Parameters:
clz - the class to get a codebase for.
Returns:
a space-separated list of URLs, or null.

loadClass sample code for javax.rmi.CORBA.Util.loadClass(java.lang.String, java.lang.String, java.lang.ClassLoader) definition code for javax.rmi.CORBA.Util.loadClass(java.lang.String, java.lang.String, java.lang.ClassLoader)

public static Class sample code for java.lang.Class definition code for java.lang.Class  loadClass(String sample code for java.lang.String definition code for java.lang.String  className,
                              String sample code for java.lang.String definition code for java.lang.String  remoteCodebase,
                              ClassLoader sample code for java.lang.ClassLoader definition code for java.lang.ClassLoader  loader)
                       throws ClassNotFoundException sample code for java.lang.ClassNotFoundException definition code for java.lang.ClassNotFoundException 
Returns a class instance for the specified class.

The spec for this method is the "Java to IDL language mapping", ptc/00-01-06.

In Java 2 Platform, this method works as follows:


isLocal sample code for javax.rmi.CORBA.Util.isLocal(javax.rmi.CORBA.Stub) definition code for javax.rmi.CORBA.Util.isLocal(javax.rmi.CORBA.Stub)

public static boolean isLocal(Stub sample code for javax.rmi.CORBA.Stub definition code for javax.rmi.CORBA.Stub  stub)
                       throws RemoteException sample code for java.rmi.RemoteException definition code for java.rmi.RemoteException 
The isLocal method has the same semantics as the ObjectImpl._is_local method, except that it can throw a RemoteException. The _is_local() method is provided so that stubs may determine if a particular object is implemented by a local servant and hence local invocation APIs may be used.

Parameters:
stub - the stub to test.
Returns:
The _is_local() method returns true if the servant incarnating the object is located in the same process as the stub and they both share the same ORB instance. The _is_local() method returns false otherwise. The default behavior of _is_local() is to return false.
Throws:
RemoteException sample code for java.rmi.RemoteException definition code for java.rmi.RemoteException - The Java to IDL specification does not specify the conditions that cause a RemoteException to be thrown.

wrapException sample code for javax.rmi.CORBA.Util.wrapException(java.lang.Throwable) definition code for javax.rmi.CORBA.Util.wrapException(java.lang.Throwable)

public static RemoteException sample code for java.rmi.RemoteException definition code for java.rmi.RemoteException  wrapException(Throwable sample code for java.lang.Throwable definition code for java.lang.Throwable  orig)
Wraps an exception thrown by an implementation method. It returns the corresponding client-side exception.

Parameters:
orig - the exception to wrap.
Returns:
the wrapped exception.

copyObjects sample code for javax.rmi.CORBA.Util.copyObjects(java.lang.Object[], org.omg.CORBA.ORB) definition code for javax.rmi.CORBA.Util.copyObjects(java.lang.Object[], org.omg.CORBA.ORB)

public static Object sample code for java.lang.Object definition code for java.lang.Object [] copyObjects(Object sample code for java.lang.Object definition code for java.lang.Object [] obj,
                                   ORB sample code for org.omg.CORBA.ORB definition code for org.omg.CORBA.ORB  orb)
                            throws RemoteException sample code for java.rmi.RemoteException definition code for java.rmi.RemoteException 
Copies or connects an array of objects. Used by local stubs to copy any number of actual parameters, preserving sharing across parameters as necessary to support RMI semantics.

Parameters:
obj - the objects to copy or connect.
orb - the ORB.
Returns:
the copied or connected objects.
Throws:
RemoteException sample code for java.rmi.RemoteException definition code for java.rmi.RemoteException - if any object could not be copied or connected.

copyObject sample code for javax.rmi.CORBA.Util.copyObject(java.lang.Object, org.omg.CORBA.ORB) definition code for javax.rmi.CORBA.Util.copyObject(java.lang.Object, org.omg.CORBA.ORB)

public static Object sample code for java.lang.Object definition code for java.lang.Object  copyObject(Object sample code for java.lang.Object definition code for java.lang.Object  obj,
                                ORB sample code for org.omg.CORBA.ORB definition code for org.omg.CORBA.ORB  orb)
                         throws RemoteException sample code for java.rmi.RemoteException definition code for java.rmi.RemoteException 
Copies or connects an object. Used by local stubs to copy an actual parameter, result object, or exception.

Parameters:
obj - the object to copy.
orb - the ORB.
Returns:
the copy or connected object.
Throws:
RemoteException sample code for java.rmi.RemoteException definition code for java.rmi.RemoteException - if the object could not be copied or connected.