*/
public Object copyObject (Object obj, org.omg.CORBA.ORB orb)
throws RemoteException
{
if (orb instanceof ORB) {
ORB lorb = (ORB)orb ;
try {
try {
// This gets the copier for the current invocation, which was
// previously set by preinvoke.
return lorb.peekInvocationInfo().getCopierFactory().make().copy( obj ) ;
} catch (java.util.EmptyStackException exc) {
// copyObject was invoked outside of an invocation, probably by
// a test. Get the default copier from the ORB.
// XXX should we just make the default copier available directly
// and avoid constructing one on each call?
CopierManager cm = lorb.getCopierManager() ;
ObjectCopier copier = cm.getDefaultObjectCopierFactory().make() ;
return copier.copy( obj ) ;
}
} catch (ReflectiveCopyException exc) {
RemoteException rexc = new RemoteException() ;