J2EEObjectStreamFactoryImplpublic class J2EEObjectStreamFactoryImpl extends Object implements com.sun.ejb.spi.io.J2EEObjectStreamFactoryA Factory class for creating EJBObject input/output Stream |
Fields Summary |
---|
private static final Logger | _ejbLogger |
Constructors Summary |
---|
public J2EEObjectStreamFactoryImpl()
|
Methods Summary |
---|
public java.io.ObjectInputStream | createObjectInputStream(java.io.InputStream is, boolean resolveObject, java.lang.ClassLoader loader)Obtain an ObjectInputStream that allows de-serialization
of a graph of objects.
ObjectInputStream ois = null;
if ( loader != null ) {
// Need privileged block here because EJBObjectInputStream
// does enableResolveObject
if(System.getSecurityManager() == null) {
ois = new EJBObjectInputStream(is, loader, resolveObject);
} else {
try {
ois = (ObjectInputStream)AccessController.doPrivileged(
new PrivilegedExceptionAction() {
public java.lang.Object run()
throws Exception {
return new EJBObjectInputStream(
is, loader, resolveObject);
}
});
} catch ( PrivilegedActionException ex ) {
throw (IOException) ex.getException();
}
}
} else {
ois = new ObjectInputStream(is);
}
return ois;
| public java.io.ObjectOutputStream | createObjectOutputStream(java.io.OutputStream os, boolean replaceObject, com.sun.ejb.spi.io.NonSerializableObjectHandler handler)Obtain an ObjectOutputStream that allows serialization
of a graph of objects. The objects can be plain Serializable objects
or can be converted into Serializable objects using
the handler
// Need privileged block here because EJBObjectOutputStream
// does enableReplaceObject
ObjectOutputStream oos = null;
if(System.getSecurityManager() == null) {
oos = new EJBObjectOutputStream(os, replaceObject, handler);
} else {
try {
oos = (ObjectOutputStream)AccessController.doPrivileged(
new PrivilegedExceptionAction() {
public java.lang.Object run()
throws Exception {
return new EJBObjectOutputStream(
os, replaceObject, handler);
}
});
} catch ( PrivilegedActionException ex ) {
throw (IOException) ex.getException();
}
}
return oos;
|
|