org.marketcetera.util.ws.stateless
Class StatelessRemoteCaller<T>

java.lang.Object
  extended by org.marketcetera.util.ws.stateless.StatelessRemoteCall
      extended by org.marketcetera.util.ws.stateless.StatelessRemoteCaller<T>

public abstract class StatelessRemoteCaller<T>
extends StatelessRemoteCall

An implementation wrapper for stateless services. The wrapped call is implemented by overriding call(StatelessClientContext).

Since:
1.0.0
Version:
$Id: StatelessRemoteCaller.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
StatelessRemoteCaller()
          Creates a new wrapper which applies a single filter to the client context.
StatelessRemoteCaller(TagFilter versionIdFilter, TagFilter appIdFilter, TagFilter clientIdFilter)
          Creates a new wrapper which applies the given filters to the client context.
 
Method Summary
protected abstract  T call(StatelessClientContext context)
          The service implementation, executed on behalf of the client with the given context.
 T execute(StatelessClientContext context)
          Invokes the service implementation on behalf of the client with the given context.
 
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

StatelessRemoteCaller

public StatelessRemoteCaller(TagFilter versionIdFilter,
                             TagFilter appIdFilter,
                             TagFilter clientIdFilter)
Creates a new wrapper 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.

StatelessRemoteCaller

public StatelessRemoteCaller()
Creates a new wrapper which applies a single filter to the client context. That filter ensures that the client's version ID is equal to the server's version ID.

Method Detail

execute

public T execute(StatelessClientContext 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(StatelessClientContext context)
                   throws Exception
The service implementation, executed on behalf of the client with the given context.

Parameters:
context - The context.
Returns:
The result returned by the implementation.
Throws:
Exception - Thrown if the implementation fails.


Copyright © 2012. All Rights Reserved.