| java.lang.Object java.io.InputStream java.io.ObjectInputStream org.springframework.remoting.rmi.CodebaseAwareObjectInputStream
CodebaseAwareObjectInputStream | public class CodebaseAwareObjectInputStream extends ObjectInputStream (Code) | | Special ObjectInputStream subclass that falls back to a specified codebase
to load classes from if not found locally. In contrast to standard RMI
conventions for dynamic class download, it is the client that determines
the codebase URL here, rather than the "java.rmi.server.codebase" system
property on the server.
Uses the JDK's RMIClassLoader to load classes from the specified codebase.
The codebase can consist of multiple URLs, separated by spaces.
Note that RMIClassLoader requires a SecurityManager to be set, like when
using dynamic class download with standard RMI! (See the RMI documentation
for details.)
Despite residing in the RMI package, this class is not used for
RmiClientInterceptor, which uses the standard RMI infrastructure instead
and thus is only able to rely on RMI's standard dynamic class download via
"java.rmi.server.codebase". CodebaseAwareObjectInputStream is used by
HttpInvokerClientInterceptor (see the "codebaseUrl" property there).
Thanks to Lionel Mestre for suggesting the option and providing
a prototype!
author: Juergen Hoeller since: 1.1.3 See Also: java.rmi.server.RMIClassLoader See Also: org.springframework.remoting.httpinvoker.HttpInvokerClientInterceptor.setCodebaseUrl |
Method Summary | |
protected Class | resolveClass(ObjectStreamClass classDesc) Overridden version delegates to super class first,
falling back to the specified codebase if not found locally. | protected Class | resolveProxyClass(String[] interfaces) Overridden version delegates to super class first,
falling back to the specified codebase if not found locally. |
CodebaseAwareObjectInputStream | public CodebaseAwareObjectInputStream(InputStream in, ClassLoader classLoader, String codebaseUrl) throws IOException(Code) | | Create a new CodebaseAwareObjectInputStream for the given InputStream and codebase.
Parameters: in - the InputStream to read from Parameters: classLoader - the ClassLoader to use for loading local classes(may be null to indicate RMI's default ClassLoader) Parameters: codebaseUrl - the codebase URL to load classes from if not found locally(can consist of multiple URLs, separated by spaces) See Also: java.io.ObjectInputStream.ObjectInputStream(java.io.InputStream) |
Methods inherited from java.io.ObjectInputStream | public int available() throws IOException(Code)(Java Doc) public void close() throws IOException(Code)(Java Doc) public void defaultReadObject() throws IOException, ClassNotFoundException(Code)(Java Doc) protected boolean enableResolveObject(boolean enable) throws SecurityException(Code)(Java Doc) public int read() throws IOException(Code)(Java Doc) public int read(byte[] buf, int off, int len) throws IOException(Code)(Java Doc) public boolean readBoolean() throws IOException(Code)(Java Doc) public byte readByte() throws IOException(Code)(Java Doc) public char readChar() throws IOException(Code)(Java Doc) protected ObjectStreamClass readClassDescriptor() throws IOException, ClassNotFoundException(Code)(Java Doc) public double readDouble() throws IOException(Code)(Java Doc) public ObjectInputStream.GetField readFields() throws IOException, ClassNotFoundException(Code)(Java Doc) public float readFloat() throws IOException(Code)(Java Doc) public void readFully(byte[] buf) throws IOException(Code)(Java Doc) public void readFully(byte[] buf, int off, int len) throws IOException(Code)(Java Doc) public int readInt() throws IOException(Code)(Java Doc) public String readLine() throws IOException(Code)(Java Doc) public long readLong() throws IOException(Code)(Java Doc) final public Object readObject() throws IOException, ClassNotFoundException(Code)(Java Doc) protected Object readObjectOverride() throws IOException, ClassNotFoundException(Code)(Java Doc) public short readShort() throws IOException(Code)(Java Doc) protected void readStreamHeader() throws IOException, StreamCorruptedException(Code)(Java Doc) public String readUTF() throws IOException(Code)(Java Doc) public Object readUnshared() throws IOException, ClassNotFoundException(Code)(Java Doc) public int readUnsignedByte() throws IOException(Code)(Java Doc) public int readUnsignedShort() throws IOException(Code)(Java Doc) public void registerValidation(ObjectInputValidation obj, int prio) throws NotActiveException, InvalidObjectException(Code)(Java Doc) protected Class> resolveClass(ObjectStreamClass desc) throws IOException, ClassNotFoundException(Code)(Java Doc) protected Object resolveObject(Object obj) throws IOException(Code)(Java Doc) protected Class> resolveProxyClass(String[] interfaces) throws IOException, ClassNotFoundException(Code)(Java Doc) public int skipBytes(int len) throws IOException(Code)(Java Doc)
|
|
|