Novell exteNd Messaging Platform 5.2

javax.rmi.CORBA
Class Util

java.lang.Object
  extended byjavax.rmi.CORBA.Util

public class Util
extends Object

The javax.rmi.CORBA.Util provides methods that can be used by the stubs to perform common operations.


Method Summary
static Object copyObject(Object obj, ORB orb)
          The copyObject method is used by local stubs to copy an actual parameter, result object, or exception.
static Object[] copyObjects(Object[] objs, ORB orb)
          The copyObjects method is used by local stubs to copy any number of actual parameters, preserving sharing across parameters as necessary to support RMI/IDL semantics.
static ValueHandler createValueHandler()
          The createValueHandler method returns a singleton instance of a class that implements the ValueHandler interface.
static String getCodebase(Class clz)
          The getCodebase method returns the Java codebase for the Class object clz as a space-separated list of URLs.
static Tie getTie(Remote target)
          Get a Tie for the given Remote object implementation.
static boolean isLocal(Stub stub)
          The isLocal method has the same semantics as the ObjectImpl._is_local method, except that it can throw a RemoteException.
static Class loadClass(String className, String remoteCodebase, ClassLoader loader)
          The loadClass method loads a Java class object for the Java class name className, using additional information passed in the remoteCodebase and loadingContext parameters.
static RemoteException mapSystemException(SystemException sex)
          Map a CORBA SystemException to a java.rmi.RemoteException or a java.lang.RuntimeException.
static Object readAny(InputStream is)
          Read a CORBA any as a Java object.
static void registerTarget(Tie tie, Remote target)
          The registerTarget method is needed to support unexportObject.
static void unexportObject(Remote target)
          The unexportObject method deactivates an implementation object and removes its associated Tie from the table maintained by the Util class.
static RemoteException wrapException(Throwable ex)
          The wrapException method wraps an exception thrown by an implementation method.
static void writeAbstractObject(OutputStream os, Object obj)
          Utility method for use by stubs when writing a RMI/IDL object reference to an output stream.
static void writeAny(OutputStream os, Object obj)
          Write a Java Object as a CORBA Any.
static void writeRemoteObject(OutputStream out, Object obj)
          Utility method for use by stubswhen writing a RMI/IDL object reference to an output stream.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

mapSystemException

public static RemoteException mapSystemException(SystemException sex)
Map a CORBA SystemException to a java.rmi.RemoteException or a java.lang.RuntimeException. If the mapped exception is an instance of java.rmi.RemoteException or a subclass, the mapped exception is returned; otherwise, it is thrown.


wrapException

public static RemoteException wrapException(Throwable ex)
The wrapException method wraps an exception thrown by an implementation method. It returns the corresponding client-side exception.


writeAny

public static void writeAny(OutputStream os,
                            Object obj)
Write a Java Object as a CORBA Any.


readAny

public static Object readAny(InputStream is)
Read a CORBA any as a Java object.


writeRemoteObject

public static void writeRemoteObject(OutputStream out,
                                     Object obj)
Utility method for use by stubswhen writing a RMI/IDL object reference to an output stream. If object is a stub object, it simply writes the object using output stream's write_object method. However, if object is an RMI/IDL implementation object, then a suitable Tie is allocated (or reused) and they are plugged together and then the object reference of the Tie is written instead.


writeAbstractObject

public static void writeAbstractObject(OutputStream os,
                                       Object obj)
Utility method for use by stubs when writing a RMI/IDL object reference to an output stream. If obj is a value object, or a stub object, writeAbstractObject simply writes obj using out.write_abstract_interface. However, if obj is an exported RMI/IDL implementation object, then writeAbstractObject allocates (or reuses) a suitable Tie, plugs together the tie with obj, and writes the object reference for the tie to the out.write_abstract_interface.


registerTarget

public static void registerTarget(Tie tie,
                                  Remote target)
The registerTarget method is needed to support unexportObject. Because unexportObject 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.

It is the responsibility of the code that allocates a Tie to also call the registerTarget method to notify the Util class of the target object for a given tie. The registerTarget method will call the Tie.setTarget method to notify the tie object of its target object.


unexportObject

public static void unexportObject(Remote target)
The unexportObject method deactivates an implementation object and removes its associated Tie from the table maintained by the Util class.


getTie

public static Tie getTie(Remote target)
Get a Tie for the given Remote object implementation. If the object is not exported null is returned.


createValueHandler

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


isLocal

public static boolean isLocal(Stub stub)
                       throws RemoteException
The isLocal method has the same semantics as the ObjectImpl._is_local method, except that it can throw a RemoteException.

Throws:
RemoteException
See Also:
ObjectImpl._is_local()

copyObject

public static Object copyObject(Object obj,
                                ORB orb)
                         throws RemoteException
The copyObject method is used by local stubs to copy an actual parameter, result object, or exception.

Throws:
RemoteException
See Also:
copyObjects(java.lang.Object[], org.omg.CORBA.ORB)

copyObjects

public static Object[] copyObjects(Object[] objs,
                                   ORB orb)
                            throws RemoteException
The copyObjects method is used by local stubs to copy any number of actual parameters, preserving sharing across parameters as necessary to support RMI/IDL semantics. The actual parameter Object[] array holds the method parameter objects that need to be copied, and the result Object[] array holds the copied results.

The copyObject and copyObjects methods ensure that remote call semantics are observed for local calls. They observe copy semantics for value objects that are equivalent to marshaling, and they handle remote objects correctly. Stubs must either call these methods or generate inline code to provide equivalent semantics.

Throws:
RemoteException
See Also:
copyObject(java.lang.Object, org.omg.CORBA.ORB)

getCodebase

public static String getCodebase(Class clz)
The getCodebase method returns the Java codebase for the Class object clz as a space-separated list of URLs.


loadClass

public static Class loadClass(String className,
                              String remoteCodebase,
                              ClassLoader loader)
                       throws ClassNotFoundException
The loadClass method loads a Java class object for the Java class name className, using additional information passed in the remoteCodebase and loadingContext parameters.

Throws:
ClassNotFoundException

Novell exteNd Messaging Platform 5.2

exteNd is a registered trademark of Novell, Inc.
Copyright 1998-2004 Novell, Inc. All Rights Reserved.