Class RemoteRunner<S>


  • public abstract class RemoteRunner<S>
    extends RemoteCall<S>
    An implementation wrapper for stateful services. The wrapped call is implemented by overriding run(ClientContext,SessionHolder).
    Since:
    1.0.0
    Version:
    $Id: RemoteRunner.java 16154 2012-07-14 16:34:05Z colin $
    Author:
    tlerios@marketcetera.com
    • Constructor Detail

      • RemoteRunner

        public RemoteRunner​(TagFilter versionIdFilter,
                            TagFilter appIdFilter,
                            TagFilter clientIdFilter,
                            SessionManager<S> sessionManager,
                            TagFilter sessionIdFilter)
        Creates a new wrapper which uses the given (optional) session manager for session ID mappings, and which applies the given filters to the client context.
        Parameters:
        versionIdFilter - The version ID filter, which may be null.
        appIdFilter - The application ID filter, which may be null.
        clientIdFilter - The client ID filter, which may be null.
        sessionManager - The session manager, which may be null.
        sessionIdFilter - The session ID filter, which may be null.
      • RemoteRunner

        public RemoteRunner​(SessionManager<S> sessionManager)
        Creates a new wrapper which uses the given (optional) session manager for session ID mappings, and which applies two filters to the client context. The first filter ensures that the client's version ID is equal to the server's version ID; the second ensures that the session ID maps to an active session.
        Parameters:
        sessionManager - The session manager, which may be null.
    • Method Detail

      • execute

        public void execute​(ClientContext context)
                     throws RemoteException
        Invokes the service implementation on behalf of the client with the given context.
        Parameters:
        context - The context.
        Throws:
        RemoteException - Thrown if the implementation fails; it wraps the throwable thrown by the actual implementation.
      • run

        protected abstract void run​(ClientContext context,
                                    SessionHolder<S> sessionHolder)
                             throws Exception
        The service implementation, executed on behalf of the client with the given context and associated session holder.
        Parameters:
        context - The context.
        sessionHolder - The holder, which may be null.
        Throws:
        Exception - Thrown if the implementation fails.