Methods Summary |
---|
public static javax.ejb.spi.HandleDelegate | getHandleDelegate()
HandleDelegate handleDelegate =
(HandleDelegate) java.security.AccessController.doPrivileged(
new java.security.PrivilegedAction() {
public Object run() {
try {
ClassLoader cl = new HandleDelegateClassLoader();
Class c = cl.loadClass(
"com.sun.enterprise.iiop.IIOPHandleDelegate");
return c.newInstance();
} catch ( Exception ex ) {
ex.printStackTrace();
return null;
}
}
}
);
return handleDelegate;
|
private java.lang.Object | getStub(java.io.ObjectInputStream istream, java.lang.Class stubClass)
// deserialize obj
Object obj = istream.readObject();
if( StubAdapter.isStub(obj) ) {
try {
// Check if it is already connected to the ORB by getting
// the delegate. If BAD_OPERATION is not thrown, then the
// stub is connected. This will happen if istream is an
// IIOP input stream.
Delegate delegate = StubAdapter.getDelegate(obj);
} catch(org.omg.CORBA.BAD_OPERATION bo) {
// Stub is not connected. This can happen if istream is
// not an IIOP input stream (e.g. it's a File stream).
StubAdapter.connect
(obj, (com.sun.corba.ee.spi.orb.ORB) ORBManager.getORB());
}
} else {
throw new IOException("Unable to create stub for class " +
stubClass.getName() +
", object deserialized is not a CORBA object, it's type is " +
obj.getClass().getName());
}
// narrow it
Object stub = PortableRemoteObject.narrow(obj, stubClass);
return stub;
|
public javax.ejb.EJBHome | readEJBHome(java.io.ObjectInputStream istream)
return (EJBHome)getStub(istream, EJBHome.class);
|
public javax.ejb.EJBObject | readEJBObject(java.io.ObjectInputStream istream)
return (EJBObject)getStub(istream, EJBObject.class);
|
public void | writeEJBHome(javax.ejb.EJBHome ejbHome, java.io.ObjectOutputStream ostream)
ostream.writeObject(ejbHome); // IIOP stubs are Serializable
|
public void | writeEJBObject(javax.ejb.EJBObject ejbObject, java.io.ObjectOutputStream ostream)
ostream.writeObject(ejbObject); // IIOP stubs are Serializable
|