Class RemoteCaller<S,T>
- java.lang.Object
-
- org.marketcetera.util.ws.stateless.StatelessRemoteCall
-
- org.marketcetera.util.ws.stateful.RemoteCall<S>
-
- org.marketcetera.util.ws.stateful.RemoteCaller<S,T>
-
public abstract class RemoteCaller<S,T> extends RemoteCall<S>
An implementation wrapper for stateful services. The wrapped call is implemented by overridingcall(ClientContext,SessionHolder).- Since:
- 1.0.0
- Version:
- $Id: RemoteCaller.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
Constructors Constructor Description RemoteCaller(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.RemoteCaller(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
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract Tcall(ClientContext context, SessionHolder<S> sessionHolder)The service implementation, executed on behalf of the client with the given context and associated session holder.Texecute(ClientContext context)Invokes the service implementation on behalf of the client with the given context.-
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
-
-
-
-
Constructor Detail
-
RemoteCaller
public RemoteCaller(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.
-
RemoteCaller
public RemoteCaller(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 T execute(ClientContext context) throws RemoteException
Invokes the service implementation on behalf of the client with the given context.- Parameters:
context- The context.- Returns:
- The result returned by the implementation.
- Throws:
RemoteException- Thrown if the implementation fails; it wraps the throwable thrown by the actual implementation.
-
call
protected abstract T call(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.- Returns:
- The result returned by the implementation.
- Throws:
Exception- Thrown if the implementation fails.
-
-