|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjava.io.InputStream
java.io.ObjectInputStream
org.jboss.remoting.loading.ObjectInputStreamWithClassLoader
ObjectInputStreamWithClassLoader
Nested Class Summary |
Nested classes inherited from class java.io.ObjectInputStream |
ObjectInputStream.GetField |
Field Summary |
Constructor Summary | |
ObjectInputStreamWithClassLoader(InputStream in,
ClassLoader cl)
Create an ObjectInputStream that reads from the specified InputStream. |
Method Summary | |
ClassLoader |
getClassLoader()
Gets the pluggable classloader that will be used for classloading when deserializing objects. |
protected Class |
resolveClass(ObjectStreamClass v)
Load the local class equivalent of the specified stream class description. |
protected Class |
resolveProxyClass(String[] interfaces)
Returns a proxy class that implements the interfaces named in a proxy class descriptor; subclasses may implement this method to read custom data from the stream along with the descriptors for dynamic proxy classes, allowing them to use an alternate loading mechanism for the interfaces and the proxy class. |
void |
setClassLoader(ClassLoader cl)
Set the classloader that the stream will used when deserializing class. |
Methods inherited from class java.io.ObjectInputStream |
available, close, defaultReadObject, enableResolveObject, read, read, readBoolean, readByte, readChar, readClassDescriptor, readDouble, readFields, readFloat, readFully, readFully, readInt, readLine, readLong, readObject, readObjectOverride, readShort, readStreamHeader, readUnshared, readUnsignedByte, readUnsignedShort, readUTF, registerValidation, resolveObject, skipBytes |
Methods inherited from class java.io.InputStream |
mark, markSupported, read, reset, skip |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.io.ObjectInput |
read, skip |
Constructor Detail |
public ObjectInputStreamWithClassLoader(InputStream in, ClassLoader cl) throws IOException, StreamCorruptedException
in
- the underlying InputStream
from which to read
StreamCorruptedException
- The version or magic number are
incorrect.
IOException
- An exception occurred in the underlying stream.Method Detail |
public void setClassLoader(ClassLoader cl)
cl
- public ClassLoader getClassLoader()
protected Class resolveClass(ObjectStreamClass v) throws IOException, ClassNotFoundException
By default the class name is resolved relative to the class that called readObject.
Will use the classloader explicitly set if it exists. If it does not exist, will used its default classloader (that loader this instance).
v
- an instance of class ObjectStreamClass
v
IOException
- Any of the usual Input/Output exceptions.
ClassNotFoundException
- If class of
a serialized object cannot be found.protected Class resolveProxyClass(String[] interfaces) throws IOException, ClassNotFoundException
This method is called exactly once for each unique proxy class descriptor in the stream.
The corresponding method in ObjectOutputStream
is
annotateProxyClass
. For a given subclass of
ObjectInputStream
that overrides this method, the
annotateProxyClass
method in the corresponding
subclass of ObjectOutputStream
must write any data or
objects read by this method.
The default implementation of this method in
ObjectInputStream
returns the result of calling
Proxy.getProxyClass
with the list of
Class
objects for the interfaces that are named in
the interfaces
parameter. The Class
object for each interface name i
is the value
returned by calling
Class.forName(i, false, loader)where
loader
is that of the first non-null class
loader up the execution stack, or null
if no non-null
class loaders are on the stack (the same class loader choice used
by the resolveClass
method). This same value of
loader
is also the class loader passed to
Proxy.getProxyClass
. If Proxy.getProxyClass
throws an IllegalArgumentException
,
resolveProxyClass
will throw a
ClassNotFoundException
containing the
IllegalArgumentException
.
interfaces
- the list of interface names that were
deserialized in the proxy class descriptor
IOException
- any exception thrown by the underlying
InputStream
ClassNotFoundException
- if the proxy class or any of the
named interfaces could not be foundObjectOutputStream.annotateProxyClass(java.lang.Class)
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |