org.springframework.remoting.rmi

Class RemoteInvocationSerializingExporter

    • Field Detail

      • CONTENT_TYPE_SERIALIZED_OBJECT

        public static final java.lang.String CONTENT_TYPE_SERIALIZED_OBJECT
        Default content type: "application/x-java-serialized-object".
        See Also:
        Constant Field Values
    • Constructor Detail

      • RemoteInvocationSerializingExporter

        public RemoteInvocationSerializingExporter()
    • Method Detail

      • setContentType

        public void setContentType(java.lang.String contentType)
        Specify the content type to use for sending remote invocation responses.

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

      • getContentType

        public java.lang.String getContentType()
        Return the content type to use for sending remote invocation responses.
      • setAcceptProxyClasses

        public void setAcceptProxyClasses(boolean acceptProxyClasses)
        Set whether to accept deserialization of proxy classes.

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

      • isAcceptProxyClasses

        public boolean isAcceptProxyClasses()
        Return whether to accept deserialization of proxy classes.
      • afterPropertiesSet

        public void afterPropertiesSet()
        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()
        Initialize this service exporter.
      • getProxy

        protected final java.lang.Object getProxy()
      • createObjectInputStream

        protected java.io.ObjectInputStream createObjectInputStream(java.io.InputStream is)
                                                             throws java.io.IOException
        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:
        java.io.IOException - if creation of the ObjectInputStream failed
      • doReadRemoteInvocation

        protected RemoteInvocation doReadRemoteInvocation(java.io.ObjectInputStream ois)
                                                   throws java.io.IOException,
                                                          java.lang.ClassNotFoundException
        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:
        java.io.IOException - in case of I/O failure
        java.lang.ClassNotFoundException - if case of a transferred class not being found in the local ClassLoader
      • createObjectOutputStream

        protected java.io.ObjectOutputStream createObjectOutputStream(java.io.OutputStream os)
                                                               throws java.io.IOException
        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:
        java.io.IOException - if creation of the ObjectOutputStream failed
      • doWriteRemoteInvocationResult

        protected void doWriteRemoteInvocationResult(RemoteInvocationResult result,
                                                     java.io.ObjectOutputStream oos)
                                              throws java.io.IOException
        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:
        java.io.IOException - if thrown by I/O methods