|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.rmi.CORBA.Util
public class Util
Provides utility methods used by stubs and ties to perform common operations.
The functionality is forwarded to the enclosed UtilDelegate. This delegate
can be altered by setting the system property "javax.rmi.CORBA.UtilClass" to
the name of the alternative class that must implement UtilDelegate
.
Method Summary | |
---|---|
static Object |
copyObject(Object object,
ORB orb)
Used by local stubs to create a copy of the object. |
static Object[] |
copyObjects(Object[] object,
ORB orb)
Used by local stubs to create a multiple copies of the object, preserving sharing accross the parameters if necessary. |
static ValueHandler |
createValueHandler()
Get the value handler that Serializes Java objects to and from CDR (GIOP) streams. |
static String |
getCodebase(Class clz)
This call is finally delegated to RMIClassLoader.getClassAnnotation(java.lang.Class>) ; |
static Tie |
getTie(Remote target)
Get the Tie that handles invocations on the given target. |
static boolean |
isLocal(Stub stub)
Checks if the given stub is local. |
static Class |
loadClass(String className,
String remoteCodebase,
ClassLoader loader)
Load the class. |
static RemoteException |
mapSystemException(SystemException ex)
Converts CORBA SystemException into RMI RemoteException . |
static Object |
readAny(InputStream input)
Read Any from the input stream. |
static void |
registerTarget(Tie tie,
Remote target)
Register the Tie-target pair. |
static void |
unexportObject(Remote target)
Deactivate the associated Tie, if it is found and is not connected to other registered targets. |
static RemoteException |
wrapException(Throwable exception)
Converts the exception that was thrown by the implementation method on a server side into RemoteException that can be transferred and re-thrown on a client side. |
static void |
writeAbstractObject(OutputStream output,
Object object)
Write abstract interface to the CORBA output stream. |
static void |
writeAny(OutputStream output,
Object object)
Write the passed java object to the output stream in the form of the CORBA Any . |
static void |
writeRemoteObject(OutputStream output,
Object object)
Write the passed parameter to the output stream as CORBA object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static Object copyObject(Object object, ORB orb) throws RemoteException
RemoteException
public static Object[] copyObjects(Object[] object, ORB orb) throws RemoteException
RemoteException
public static ValueHandler createValueHandler()
ValueHandler
.
public static String getCodebase(Class clz)
RMIClassLoader.getClassAnnotation(java.lang.Class>)
;
public static Tie getTie(Remote target)
registerTarget(javax.rmi.CORBA.Tie, java.rmi.Remote)
,
this method tries to locate a tie class by the name pattern. If this
succeeds, the tie-target pair is also registered.
public static boolean isLocal(Stub stub) throws RemoteException
stub
- a stub to check.
RemoteException
- if the ObjectImpl#_is_local()
throws a
SystemException
.public static Class loadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException
className
- the name of the class.remoteCodebase
- the codebase.loader
- the class loader.
ClassNotFoundException
- of the class cannot be loaded.public static RemoteException mapSystemException(SystemException ex)
SystemException
into RMI RemoteException
.
The exception is converted as defined in the following table:
The exception detailed message always consists of
OMGVMCID
).CompletionStatus
of the exception: "Yes", "No" or "Maybe".; nested exception is: (line feed)(tab)
"For instance, if the Internet connection was refused:
CORBA COMM_FAILURE 0x535500C9 No
The original CORBA exception is set as the cause of the RemoteException being created.
public static void registerTarget(Tie tie, Remote target)
public static void unexportObject(Remote target) throws NoSuchObjectException
NoSuchObjectException
public static RemoteException wrapException(Throwable exception)
Exception to map (or subclass) | Maps into |
---|---|
Error |
ServerError |
RemoteException |
ServerException |
SystemException |
wrapException(mapSystemException(org.omg.CORBA.SystemException) ) |
RuntimeException |
rethrows |
Any other exception | UnexpectedException |
exception
- an exception that was thrown on a server side implementation.
RuntimeException
- the passed exception if it is an instance of
RuntimeException.public static void writeAbstractObject(OutputStream output, Object object)
Remote
s are processed as defined in
writeRemoteObject(org.omg.CORBA.portable.OutputStream, java.lang.Object)
. The written data contains discriminator,
defining, that was written. Another method that writes the same content is
OutputStream.write_abstract_interface(java.lang.Object)
.
output
- a stream to write to, must be
OutputStream
.object
- an object to write, must be CORBA object, Remotepublic static void writeAny(OutputStream output, Object object)
Any
. This includes creating an writing the object TypeCode
first. Such Any can be later read by a non-RMI-IIOP CORBA implementation
and manipulated, for instance, by means, provided in
DynAny
. Depending from the passed value, this
method writes CORBA object, value type or value box. For value types Null
is written with the abstract interface, its typecode having repository id
"IDL:omg.org/CORBA/AbstractBase:1.0" and the empty string name.
output
- the object to write.object
- the java object that must be written in the form of the CORBA
Any
.public static Object readAny(InputStream input)
public static void writeRemoteObject(OutputStream output, Object object)
OutputStream
and also may be called
directly from generated Stubs and Ties.
output
- a stream to write to, must be
org.omg.CORBA_2_3.portable.OutputStreamobject
- an object to write.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |