org.springframework.remoting.rmi

## Class RemoteInvocationSerializingExporter

- java.lang.Object
- - org.springframework.remoting.support.RemotingSupport
  - - org.springframework.remoting.support.RemoteExporter
    - - org.springframework.remoting.support.RemoteInvocationBasedExporter
      - - org.springframework.remoting.rmi.RemoteInvocationSerializingExporter

- All Implemented Interfaces:
    Aware, BeanClassLoaderAware, InitializingBean
  Direct Known Subclasses:
    HttpInvokerServiceExporter, SimpleHttpInvokerServiceExporter

  Deprecated.
  as of 5.3 (phasing out serialization-based remoting)

      @Deprecated
      public abstract class RemoteInvocationSerializingExporter
      extends RemoteInvocationBasedExporter
      implements InitializingBean

  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.

  Since:
    2.5.1
  Author:
    Juergen Hoeller
  See Also:
    `ObjectInputStream`, `ObjectOutputStream`, `doReadRemoteInvocation(java.io.ObjectInputStream)`, `doWriteRemoteInvocationResult(org.springframework.remoting.support.RemoteInvocationResult, java.io.ObjectOutputStream)`

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `CONTENT_TYPE_SERIALIZED_OBJECT` Deprecated. Default content type: "application/x-java-serialized-object".

    - ### Fields inherited from class org.springframework.remoting.support.RemotingSupport

      `logger`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `RemoteInvocationSerializingExporter()` Deprecated.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `afterPropertiesSet()` Deprecated. Invoked by the containing `BeanFactory` after it has set all bean properties and satisfied `BeanFactoryAware`, `ApplicationContextAware` etc.
    `protected ObjectInputStream` | `createObjectInputStream(InputStream is)` Deprecated. Create an ObjectInputStream for the given InputStream.
    `protected ObjectOutputStream` | `createObjectOutputStream(OutputStream os)` Deprecated. Create an ObjectOutputStream for the given OutputStream.
    `protected RemoteInvocation` | `doReadRemoteInvocation(ObjectInputStream ois)` Deprecated. Perform the actual reading of an invocation result object from the given ObjectInputStream.
    `protected void` | `doWriteRemoteInvocationResult(RemoteInvocationResult result, ObjectOutputStream oos)` Deprecated. Perform the actual writing of the given invocation result object to the given ObjectOutputStream.
    `String` | `getContentType()` Deprecated. Return the content type to use for sending remote invocation responses.
    `protected Object` | `getProxy()` Deprecated.
    `boolean` | `isAcceptProxyClasses()` Deprecated. Return whether to accept deserialization of proxy classes.
    `void` | `prepare()` Deprecated. Initialize this service exporter.
    `void` | `setAcceptProxyClasses(boolean acceptProxyClasses)` Deprecated. Set whether to accept deserialization of proxy classes.
    `void` | `setContentType(String contentType)` Deprecated. Specify the content type to use for sending remote invocation responses.

    - ### Methods inherited from class org.springframework.remoting.support.RemoteInvocationBasedExporter

      `getRemoteInvocationExecutor, invoke, invokeAndCreateResult, setRemoteInvocationExecutor`

    - ### Methods inherited from class org.springframework.remoting.support.RemoteExporter

      `checkService, checkServiceInterface, getExporterName, getProxyForService, getService, getServiceInterface, setInterceptors, setRegisterTraceInterceptor, setService, setServiceInterface`

    - ### Methods inherited from class org.springframework.remoting.support.RemotingSupport

      `getBeanClassLoader, overrideThreadContextClassLoader, resetThreadContextClassLoader, setBeanClassLoader`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### CONTENT_TYPE_SERIALIZED_OBJECT

          public static final String CONTENT_TYPE_SERIALIZED_OBJECT

      Deprecated.
      Default content type: "application/x-java-serialized-object".
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### RemoteInvocationSerializingExporter

          public RemoteInvocationSerializingExporter()

      Deprecated.

  - ### Method Detail

    - #### setContentType

          public void setContentType(String contentType)

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

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

    - #### getContentType

          public String getContentType()

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

    - #### setAcceptProxyClasses

          public void setAcceptProxyClasses(boolean acceptProxyClasses)

      Deprecated.
      Set whether to accept deserialization of proxy classes.

      Default is "true". May be deactivated as a security measure.

    - #### isAcceptProxyClasses

          public boolean isAcceptProxyClasses()

      Deprecated.
      Return whether to accept deserialization of proxy classes.

    - #### afterPropertiesSet

          public void afterPropertiesSet()

      Deprecated.
      Description copied from interface: `InitializingBean`
      Invoked by the containing `BeanFactory` after it has set all bean properties and satisfied `BeanFactoryAware`, `ApplicationContextAware` etc.

      This method allows the bean instance to perform validation of its overall configuration and final initialization when all bean properties have been set.

      Specified by:
        `afterPropertiesSet` in interface `InitializingBean`

    - #### prepare

          public void prepare()

      Deprecated.
      Initialize this service exporter.

    - #### getProxy

          protected final Object getProxy()

      Deprecated.

    - #### createObjectInputStream

          protected ObjectInputStream createObjectInputStream(InputStream is)
                                                       throws IOException

      Deprecated.
      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

    - #### doReadRemoteInvocation

          protected RemoteInvocation doReadRemoteInvocation(ObjectInputStream ois)
                                                     throws IOException,
                                                            ClassNotFoundException

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

      The default implementation simply calls `ObjectInputStream.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

    - #### createObjectOutputStream

          protected ObjectOutputStream createObjectOutputStream(OutputStream os)
                                                         throws IOException

      Deprecated.
      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

    - #### doWriteRemoteInvocationResult

          protected void doWriteRemoteInvocationResult(RemoteInvocationResult result,
                                                       ObjectOutputStream oos)
                                                throws IOException

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

      The default implementation simply calls `ObjectOutputStream.writeObject(java.lang.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