Provides utility methods that can be used by stubs and ties to
perform common operations.
| Method from javax.rmi.CORBA.Util Detail: |
public static Object copyObject(Object obj,
ORB orb) throws RemoteException {
if (utilDelegate != null) {
return utilDelegate.copyObject(obj, orb);
}
return null;
}
Copies or connects an object. Used by local stubs to copy
an actual parameter, result object, or exception. |
public static Object[] copyObjects(Object[] obj,
ORB orb) throws RemoteException {
if (utilDelegate != null) {
return utilDelegate.copyObjects(obj, orb);
}
return null;
}
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. |
public static ValueHandler createValueHandler() {
if (utilDelegate != null) {
return utilDelegate.createValueHandler();
}
return null;
}
Returns a singleton instance of a class that implements the
ValueHandler interface. |
public static String getCodebase(Class clz) {
if (utilDelegate != null) {
return utilDelegate.getCodebase(clz);
}
return null;
}
Returns the codebase, if any, for the given class. |
public static Tie getTie(Remote target) {
if (utilDelegate != null) {
return utilDelegate.getTie(target);
}
return null;
}
Returns the tie (if any) for a given target object. |
public static boolean isLocal(Stub stub) throws RemoteException {
if (utilDelegate != null) {
return utilDelegate.isLocal(stub);
}
return false;
}
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. |
public static Class loadClass(String className,
String remoteCodebase,
ClassLoader loader) throws ClassNotFoundException {
if (utilDelegate != null) {
return utilDelegate.loadClass(className,remoteCodebase,loader);
}
return null ;
}
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 SE Platform, this method works as follows:
- Find the first non-null ClassLoader on the
call stack and attempt to load the class using this
ClassLoader.
- If the first step fails, and if remoteCodebase
is non-null and
useCodebaseOnly is false, then call
java.rmi.server.RMIClassLoader.loadClass(remoteCodebase, className).
- If remoteCodebase is null or useCodebaseOnly
is true, then call java.rmi.server.RMIClassLoader.loadClass(className).
- If a class was not successfully loaded by step 1, 2, or 3,
and loader is non-null, then call loader.loadClass(className).
- If a class was successfully loaded by step 1, 2, 3, or 4, then
return the loaded class, else throw ClassNotFoundException.
|
public static RemoteException mapSystemException(SystemException ex) {
if (utilDelegate != null) {
return utilDelegate.mapSystemException(ex);
}
return null;
}
Maps a SystemException to a RemoteException. |
public static Object readAny(InputStream in) {
if (utilDelegate != null) {
return utilDelegate.readAny(in);
}
return null;
}
Reads a java.lang.Object as a CORBA any. |
public static void registerTarget(Tie tie,
Remote target) {
if (utilDelegate != null) {
utilDelegate.registerTarget(tie, target);
}
}
Registers a target for a tie. Adds the tie to an internal table and calls
Tie#setTarget on the tie object. |
public static void unexportObject(Remote target) throws NoSuchObjectException {
if (utilDelegate != null) {
utilDelegate.unexportObject(target);
}
}
Removes the associated tie from an internal table and calls Tie#deactivate
to deactivate the object. |
public static RemoteException wrapException(Throwable orig) {
if (utilDelegate != null) {
return utilDelegate.wrapException(orig);
}
return null;
}
Wraps an exception thrown by an implementation
method. It returns the corresponding client-side exception. |
public static void writeAbstractObject(OutputStream out,
Object obj) {
if (utilDelegate != null) {
utilDelegate.writeAbstractObject(out, 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). |
public static void writeAny(OutputStream out,
Object obj) {
if (utilDelegate != null) {
utilDelegate.writeAny(out, obj);
}
}
Writes any java.lang.Object as a CORBA any. |
public static void writeRemoteObject(OutputStream out,
Object obj) {
if (utilDelegate != null) {
utilDelegate.writeRemoteObject(out, 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). |