public class Util extends Object implements UtilDelegate
Constructor and Description |
---|
Util() |
Modifier and Type | Method and Description |
---|---|
protected void |
cleanUpTie(Tie cachedTie) |
Object |
copyObject(Object obj,
ORB orb)
Copies or connects an object.
|
Object[] |
copyObjects(Object[] obj,
ORB orb)
Copies or connects an array of objects.
|
ValueHandler |
createValueHandler()
Returns a singleton instance of a class that implements the
ValueHandler interface. |
String |
getCodebase(Class<?> clz)
Returns the codebase, if any, for the given class.
|
Tie |
getTie(Remote target)
Returns the tie (if any) for a given target object.
|
boolean |
isLocal(Stub stub)
The isLocal method has the same semantics as the ObjectImpl._is_local method, except that it can throw a
RemoteException.
|
Class<?> |
loadClass(String className,
String remoteCodebase,
ClassLoader loader)
Returns a class instance for the specified class.
|
RemoteException |
mapSystemException(SystemException ex)
Maps a SystemException to a RemoteException.
|
Object |
readAny(InputStream in)
Reads a java.lang.Object as a CORBA any.
|
void |
registerTarget(Tie tie,
Remote target)
Registers a target for a tie.
|
void |
unexportObject(Remote target)
Removes the associated tie from an internal table and calls
Tie.deactivate() to deactivate the object. |
void |
unregisterTargetsForORB(ORB orb) |
RemoteException |
wrapException(Throwable orig)
Wraps an exception thrown by an implementation method.
|
void |
writeAbstractObject(OutputStream out,
Object obj)
Writes a java.lang.Object as either a value or a CORBA Object.
|
void |
writeAny(OutputStream out,
Object obj)
Writes any java.lang.Object as a CORBA any.
|
void |
writeRemoteObject(OutputStream out,
Object obj)
Writes a java.lang.Object as a CORBA Object.
|
public static Util instance
public void unregisterTargetsForORB(ORB orb)
public RemoteException mapSystemException(SystemException ex)
mapSystemException
in interface UtilDelegate
ex
- the SystemException to map.public void writeAny(OutputStream out, Object obj)
writeAny
in interface UtilDelegate
out
- the stream in which to write the any.obj
- the object to write as an any.public Object readAny(InputStream in)
readAny
in interface UtilDelegate
in
- the stream from which to read the any.public void writeRemoteObject(OutputStream out, 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)
.writeRemoteObject
in interface UtilDelegate
out
- the stream in which to write the object.obj
- the object to write.public void writeAbstractObject(OutputStream out, 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)
.writeAbstractObject
in interface UtilDelegate
out
- the stream in which to write the object.obj
- the object to write.public void registerTarget(Tie tie, Remote target)
Tie.setTarget(java.rmi.Remote)
on the tie
object.registerTarget
in interface UtilDelegate
tie
- the tie to register.target
- the target for the tie.public void unexportObject(Remote target) throws NoSuchObjectException
Tie.deactivate()
to deactivate the object.unexportObject
in interface UtilDelegate
target
- the object to unexport.NoSuchObjectException
protected void cleanUpTie(Tie cachedTie) throws NoSuchObjectException
NoSuchObjectException
public Tie getTie(Remote target)
getTie
in interface UtilDelegate
public ValueHandler createValueHandler()
ValueHandler
interface.createValueHandler
in interface UtilDelegate
public String getCodebase(Class<?> clz)
getCodebase
in interface UtilDelegate
clz
- the class to get a codebase for.public Class<?> loadClass(String className, String remoteCodebase, ClassLoader loader) throws ClassNotFoundException
loadClass
in interface UtilDelegate
className
- the name of the class.remoteCodebase
- a space-separated list of URLs at which the class might be found. May be null.loadingContext
- a class whose ClassLoader 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 boolean isLocal(Stub stub) throws RemoteException
isLocal
in interface UtilDelegate
stub
- the stub to test.RemoteException
- The Java to IDL specification does to specify the conditions that cause a RemoteException to be
thrown.public RemoteException wrapException(Throwable orig)
wrapException
in interface UtilDelegate
orig
- the exception to wrap.public Object[] copyObjects(Object[] obj, ORB orb) throws RemoteException
copyObjects
in interface UtilDelegate
obj
- the objects to copy or connect.orb
- the ORB.RemoteException
- if any object could not be copied or connected.public Object copyObject(Object obj, ORB orb) throws RemoteException
copyObject
in interface UtilDelegate
obj
- the object to copy.orb
- the ORB.RemoteException
- if the object could not be copied or connected.Copyright © 2012 JBoss by Red Hat. All Rights Reserved.