public class Util extends Object
| Modifier and Type | Method and Description |
|---|---|
static Object |
copyObject(Object
Copies or connects an object.
|
static Object |
copyObjects(Object
Copies or connects an array of objects.
|
static ValueHandler |
createValueHandler()
Returns a singleton instance of a class that implements the
ValueHandler interface.
|
static String |
getCodebase(Class
Returns the codebase, if any, for the given class.
|
static Tie |
getTie(Remote
Returns the tie (if any) for a given target object.
|
static boolean |
isLocal(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
Returns a class instance for the specified class.
|
static RemoteException |
mapSystemException(SystemException
Maps a SystemException to a RemoteException.
|
static Object |
readAny(InputStream
Reads a java.lang.Object as a CORBA any.
|
static void |
registerTarget(Tie
Registers a target for a tie.
|
static void |
unexportObject(Remote
Removes the associated tie from an internal table and calls
Tie to deactivate the object.
|
static RemoteException |
wrapException(Throwable
Wraps an exception thrown by an implementation method.
|
static void |
writeAbstractObject(OutputStream
Writes a java.lang.Object as either a value or a CORBA Object.
|
static void |
writeAny(OutputStream
Writes any java.lang.Object as a CORBA any.
|
static void |
writeRemoteObject(OutputStream
Writes a java.lang.Object as a CORBA Object.
|
public static RemoteExceptionmapSystemException(SystemException ex)
ex - the SystemException to map.
public static void writeAny(OutputStreamout, Object obj)
out - the stream in which to write the any.
obj - the object to write as an any.
public static ObjectreadAny(InputStream in)
in - the stream from which to read the any.
public static void writeRemoteObject(OutputStreamout, Object obj)
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).
out - the stream in which to write the object.
obj - the object to write.
public static void writeAbstractObject(OutputStreamout, Object obj)
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).
out - the stream in which to write the object.
obj - the object to write.
public static void registerTarget(Tietie, Remote target)
Tie.setTarget(java.rmi.Remote) on the tie object.
tie - the tie to register.
target - the target for the tie.
public static void unexportObject(Remotetarget) throws NoSuchObjectException
Tie.deactivate() to deactivate the object.
target - the object to unexport.
NoSuchObjectException
public static TiegetTie(Remote target)
public static ValueHandlercreateValueHandler()
ValueHandler interface.
public static StringgetCodebase(Class clz)
clz - the class to get a codebase for.
public static ClassloadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException
The spec for this method is the "Java to IDL language mapping", ptc/00-01-06.
In Java SE Platform, this method works as follows:
className - the name of the class.
remoteCodebase - a space-separated list of URLs at which the class might be found. May be null.
loader - a
ClassLoader that may be used to load the class if all other methods fail.
Class object representing the loaded class.
ClassNotFoundException - if class cannot be loaded.
public static boolean isLocal(Stubstub) throws RemoteException
stub - the stub to test.
RemoteException - The Java to IDL specification does not specify the conditions that cause a
RemoteException to be thrown.
public static RemoteExceptionwrapException(Throwable orig)
orig - the exception to wrap.
public static Object[] copyObjects(Object [] obj, ORB orb) throws RemoteException
obj - the objects to copy or connect.
orb - the ORB.
RemoteException - if any object could not be copied or connected.
public static ObjectcopyObject(Object obj, ORB orb) throws RemoteException
obj - the object to copy.
orb - the ORB.
RemoteException - if the object could not be copied or connected.