org.springframework.remoting.support

Class RemoteInvocationBasedAccessor

    • Constructor Detail

      • RemoteInvocationBasedAccessor

        public RemoteInvocationBasedAccessor()
    • Method Detail

      • setRemoteInvocationFactory

        public void setRemoteInvocationFactory(RemoteInvocationFactory remoteInvocationFactory)
        Set the RemoteInvocationFactory to use for this accessor. Default is a DefaultRemoteInvocationFactory.

        A custom invocation factory can add further context information to the invocation, for example user credentials.

      • getRemoteInvocationFactory

        public RemoteInvocationFactory getRemoteInvocationFactory()
        Return the RemoteInvocationFactory used by this accessor.
      • createRemoteInvocation

        protected RemoteInvocation createRemoteInvocation(MethodInvocation methodInvocation)
        Create a new RemoteInvocation object for the given AOP method invocation.

        The default implementation delegates to the configured RemoteInvocationFactory. This can be overridden in subclasses in order to provide custom RemoteInvocation subclasses, containing additional invocation parameters (e.g. user credentials).

        Note that it is preferable to build a custom RemoteInvocationFactory as a reusable strategy, instead of overriding this method.

        Parameters:
        methodInvocation - the current AOP method invocation
        Returns:
        the RemoteInvocation object
        See Also:
        RemoteInvocationFactory.createRemoteInvocation(org.aopalliance.intercept.MethodInvocation)
      • recreateRemoteInvocationResult

        protected java.lang.Object recreateRemoteInvocationResult(RemoteInvocationResult result)
                                                           throws java.lang.Throwable
        Recreate the invocation result contained in the given RemoteInvocationResult object.

        The default implementation calls the default recreate() method. This can be overridden in subclass to provide custom recreation, potentially processing the returned result object.

        Parameters:
        result - the RemoteInvocationResult to recreate
        Returns:
        a return value if the invocation result is a successful return
        Throws:
        java.lang.Throwable - if the invocation result is an exception
        See Also:
        RemoteInvocationResult.recreate()