org.marketcetera.util.ws.stateful
Class RemoteRunner<S>

java.lang.Object
  extended by org.marketcetera.util.ws.stateless.StatelessRemoteCall
      extended by org.marketcetera.util.ws.stateful.RemoteCall<S>
          extended by org.marketcetera.util.ws.stateful.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

Field Summary
 
Fields inherited from class org.marketcetera.util.ws.stateless.StatelessRemoteCall
DEFAULT_VERSION_FILTER
 
Constructor Summary
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.
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.
 
Method Summary
 void execute(ClientContext context)
          Invokes the service implementation on behalf of the client with the given context.
protected abstract  void run(ClientContext context, SessionHolder<S> sessionHolder)
          The service implementation, executed on behalf of the client with the given context and associated session holder.
 
Methods inherited from class org.marketcetera.util.ws.stateful.RemoteCall
getDefaultSessionIdFilter, getSessionHolder, getSessionIdFilter, getSessionManager
 
Methods inherited from class org.marketcetera.util.ws.stateless.StatelessRemoteCall
assertFilterMatch, assertFilterMatch, getAppIdFilter, getClientIdFilter, getVersionIdFilter, handleSuccess, startCall, wrapFailure
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

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.


Copyright © 2012. All Rights Reserved.