public abstract class

RemoteInvocationSerializingExporter

extends RemoteInvocationBasedExporter
implements InitializingBean
java.lang.Object
   ↳ org.springframework.remoting.support.RemotingSupport
     ↳ org.springframework.remoting.support.RemoteExporter
       ↳ org.springframework.remoting.support.RemoteInvocationBasedExporter
         ↳ org.springframework.remoting.rmi.RemoteInvocationSerializingExporter
Known Direct Subclasses

Class Overview

Abstract base class for remote service exporters that explicitly deserialize RemoteInvocation objects and serialize RemoteInvocationResult objects, for example Spring's HTTP invoker.

Provides template methods for ObjectInputStream and ObjectOutputStream handling.

Summary

Constants
String CONTENT_TYPE_SERIALIZED_OBJECT Default content type: "application/x-java-serialized-object"
[Expand]
Inherited Fields
From class org.springframework.remoting.support.RemotingSupport
Public Constructors
RemoteInvocationSerializingExporter()
Public Methods
void afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).
String getContentType()
Return the content type to use for sending remote invocation responses.
void prepare()
Initialize this service exporter.
void setContentType(String contentType)
Specify the content type to use for sending remote invocation responses.
Protected Methods
ObjectInputStream createObjectInputStream(InputStream is)
Create an ObjectInputStream for the given InputStream.
ObjectOutputStream createObjectOutputStream(OutputStream os)
Create an ObjectOutputStream for the given OutputStream.
RemoteInvocation doReadRemoteInvocation(ObjectInputStream ois)
Perform the actual reading of an invocation result object from the given ObjectInputStream.
void doWriteRemoteInvocationResult(RemoteInvocationResult result, ObjectOutputStream oos)
Perform the actual writing of the given invocation result object to the given ObjectOutputStream.
final Object getProxy()
[Expand]
Inherited Methods
From class org.springframework.remoting.support.RemoteInvocationBasedExporter
From class org.springframework.remoting.support.RemoteExporter
From class org.springframework.remoting.support.RemotingSupport
From class java.lang.Object
From interface org.springframework.beans.factory.BeanClassLoaderAware
From interface org.springframework.beans.factory.InitializingBean

Constants

public static final String CONTENT_TYPE_SERIALIZED_OBJECT

Default content type: "application/x-java-serialized-object"

Constant Value: "application/x-java-serialized-object"

Public Constructors

public RemoteInvocationSerializingExporter ()

Public Methods

public void afterPropertiesSet ()

Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied BeanFactoryAware and ApplicationContextAware).

This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.

public String getContentType ()

Return the content type to use for sending remote invocation responses.

public void prepare ()

Initialize this service exporter.

public void setContentType (String contentType)

Specify the content type to use for sending remote invocation responses.

Default is "application/x-java-serialized-object".

Protected Methods

protected ObjectInputStream createObjectInputStream (InputStream is)

Create an ObjectInputStream for the given InputStream.

The default implementation creates a Spring CodebaseAwareObjectInputStream.

Parameters
is the InputStream to read from
Returns
  • the new ObjectInputStream instance to use
Throws
IOException if creation of the ObjectInputStream failed

protected ObjectOutputStream createObjectOutputStream (OutputStream os)

Create an ObjectOutputStream for the given OutputStream.

The default implementation creates a plain ObjectOutputStream.

Parameters
os the OutputStream to write to
Returns
  • the new ObjectOutputStream instance to use
Throws
IOException if creation of the ObjectOutputStream failed

protected RemoteInvocation doReadRemoteInvocation (ObjectInputStream ois)

Perform the actual reading of an invocation result object from the given ObjectInputStream.

The default implementation simply calls readObject(). Can be overridden for deserialization of a custom wrapper object rather than the plain invocation, for example an encryption-aware holder.

Parameters
ois the ObjectInputStream to read from
Returns
  • the RemoteInvocationResult object
Throws
IOException in case of I/O failure
ClassNotFoundException if case of a transferred class not being found in the local ClassLoader

protected void doWriteRemoteInvocationResult (RemoteInvocationResult result, ObjectOutputStream oos)

Perform the actual writing of the given invocation result object to the given ObjectOutputStream.

The default implementation simply calls writeObject(Object). Can be overridden for serialization of a custom wrapper object rather than the plain invocation, for example an encryption-aware holder.

Parameters
result the RemoteInvocationResult object
oos the ObjectOutputStream to write to
Throws
IOException if thrown by I/O methods

protected final Object getProxy ()