org.springframework.remoting.support

Class RemoteInvocationBasedExporter

    • Constructor Detail

      • RemoteInvocationBasedExporter

        public RemoteInvocationBasedExporter()
    • Method Detail

      • setRemoteInvocationExecutor

        public void setRemoteInvocationExecutor(RemoteInvocationExecutor remoteInvocationExecutor)
        Set the RemoteInvocationExecutor to use for this exporter. Default is a DefaultRemoteInvocationExecutor.

        A custom invocation executor can extract further context information from the invocation, for example user credentials.

      • getRemoteInvocationExecutor

        public RemoteInvocationExecutor getRemoteInvocationExecutor()
        Return the RemoteInvocationExecutor used by this exporter.
      • invoke

        protected java.lang.Object invoke(RemoteInvocation invocation,
                                          java.lang.Object targetObject)
                                   throws java.lang.NoSuchMethodException,
                                          java.lang.IllegalAccessException,
                                          java.lang.reflect.InvocationTargetException
        Apply the given remote invocation to the given target object. The default implementation delegates to the RemoteInvocationExecutor.

        Can be overridden in subclasses for custom invocation behavior, possibly for applying additional invocation parameters from a custom RemoteInvocation subclass. Note that it is preferable to use a custom RemoteInvocationExecutor which is a reusable strategy.

        Parameters:
        invocation - the remote invocation
        targetObject - the target object to apply the invocation to
        Returns:
        the invocation result
        Throws:
        java.lang.NoSuchMethodException - if the method name could not be resolved
        java.lang.IllegalAccessException - if the method could not be accessed
        java.lang.reflect.InvocationTargetException - if the method invocation resulted in an exception
        See Also:
        RemoteInvocationExecutor.invoke(org.springframework.remoting.support.RemoteInvocation, java.lang.Object)
      • invokeAndCreateResult

        protected RemoteInvocationResult invokeAndCreateResult(RemoteInvocation invocation,
                                                               java.lang.Object targetObject)
        Apply the given remote invocation to the given target object, wrapping the invocation result in a serializable RemoteInvocationResult object. The default implementation creates a plain RemoteInvocationResult.

        Can be overridden in subclasses for custom invocation behavior, for example to return additional context information. Note that this is not covered by the RemoteInvocationExecutor strategy!

        Parameters:
        invocation - the remote invocation
        targetObject - the target object to apply the invocation to
        Returns:
        the invocation result
        See Also:
        invoke(org.springframework.remoting.support.RemoteInvocation, java.lang.Object)