org.apache.yoko.rmi.impl
Class UtilImpl

java.lang.Object
  extended by org.apache.yoko.rmi.impl.UtilImpl
All Implemented Interfaces:
UtilDelegate

public class UtilImpl
extends Object
implements UtilDelegate


Constructor Summary
UtilImpl()
           
 
Method Summary
 Object copyObject(Object obj, ORB orb)
          Copy a single object, maintaining internal reference integrity.
 Object[] copyObjects(Object[] objs, ORB orb)
          Copy an array of objects, maintaining internal reference integrity.
 ValueHandler createValueHandler()
           
 String getCodebase(Class clz)
           
 Tie getTie(Remote obj)
           
 boolean isLocal(Stub stub)
           
 Class loadClass(String name, String codebase, ClassLoader loader)
           
static Class loadClass0(String name, String codebase, ClassLoader loader)
           
 RemoteException mapSystemException(SystemException theException)
          Translate a CORBA SystemException to the corresponding RemoteException
 Object readAny(InputStream in)
           
 void registerTarget(Tie tie, Remote obj)
           
protected  Map tie_map()
           
 void unexportObject(Remote obj)
           
 RemoteException wrapException(Throwable ex)
           
 void writeAbstractObject(OutputStream out, Object obj)
           
 void writeAny(OutputStream out, Object obj)
          Write an org.omg.CORBA.Any containing the given object.
 void writeRemoteObject(OutputStream out, Object obj)
          Write a remote object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UtilImpl

public UtilImpl()
Method Detail

mapSystemException

public RemoteException mapSystemException(SystemException theException)
Translate a CORBA SystemException to the corresponding RemoteException

Specified by:
mapSystemException in interface UtilDelegate

writeAny

public void writeAny(OutputStream out,
                     Object obj)
              throws SystemException
Write an org.omg.CORBA.Any containing the given object.

The object is not converted or translated, simply written. Thus, it must be either an IDL-generated entity, a Serializable value or an org.omg.CORBA.Object. Specifically, a Remote objects and Servants cannot be written, but their corresponding Stubs can.

Specified by:
writeAny in interface UtilDelegate
Parameters:
out - The stream to which the value should be written
obj - The object/value to write
Throws:
MARSHAL - if the value cannot be written
SystemException

readAny

public Object readAny(InputStream in)
               throws SystemException
Specified by:
readAny in interface UtilDelegate
Throws:
SystemException

writeRemoteObject

public void writeRemoteObject(OutputStream out,
                              Object obj)
                       throws SystemException
Write a remote object. It must already be exported.

This method accepts values of org.omg.CORBA.Object (including stubs), and instances of java.rmi.Remote for objects that have already been exported.

Specified by:
writeRemoteObject in interface UtilDelegate
Throws:
SystemException

writeAbstractObject

public void writeAbstractObject(OutputStream out,
                                Object obj)
Specified by:
writeAbstractObject in interface UtilDelegate

tie_map

protected Map tie_map()

registerTarget

public void registerTarget(Tie tie,
                           Remote obj)
Specified by:
registerTarget in interface UtilDelegate

getTie

public Tie getTie(Remote obj)
Specified by:
getTie in interface UtilDelegate

createValueHandler

public ValueHandler createValueHandler()
Specified by:
createValueHandler in interface UtilDelegate

getCodebase

public String getCodebase(Class clz)
Specified by:
getCodebase in interface UtilDelegate

loadClass

public Class loadClass(String name,
                       String codebase,
                       ClassLoader loader)
                throws ClassNotFoundException
Specified by:
loadClass in interface UtilDelegate
Throws:
ClassNotFoundException

loadClass0

public static Class loadClass0(String name,
                               String codebase,
                               ClassLoader loader)
                        throws ClassNotFoundException
Throws:
ClassNotFoundException

isLocal

public boolean isLocal(Stub stub)
                throws RemoteException
Specified by:
isLocal in interface UtilDelegate
Throws:
RemoteException

wrapException

public RemoteException wrapException(Throwable ex)
Specified by:
wrapException in interface UtilDelegate

copyObject

public Object copyObject(Object obj,
                         ORB orb)
                  throws RemoteException
Copy a single object, maintaining internal reference integrity.

This is done by writing and reading the object to/from a temporary stream. As such, this should be called after the receiving context's class-loaders etc. have been set up.

Specified by:
copyObject in interface UtilDelegate
Throws:
RemoteException

copyObjects

public Object[] copyObjects(Object[] objs,
                            ORB orb)
                     throws RemoteException
Copy an array of objects, maintaining internal reference integrity.

This is done by writing and reading the object array to/from a temporary stream. As such, this should be called after the receiving context's class-loaders etc. have been set up.

Specified by:
copyObjects in interface UtilDelegate
Throws:
RemoteException

unexportObject

public void unexportObject(Remote obj)
                    throws NoSuchObjectException
Specified by:
unexportObject in interface UtilDelegate
Throws:
NoSuchObjectException


Copyright © 2006-2011 Apache Software Foundation. All Rights Reserved.