Errai 3.0.1-SNAPSHOT

org.jboss.errai.common.client.api
Interface BatchCaller


public interface BatchCaller

An interface that can be used as an injection point for batched invocations of remote methods using generated proxies. In contrast to Caller, no remote request will be sent until sendBatch() is called.

Author:
Christian Sadilek

Method Summary
<T> T
call(RemoteCallback<?> callback, Class<T> remoteService)
          Returns an instance of the proxy that can schedule invocations on service methods on the service described by T.
<T> T
call(RemoteCallback<?> callback, ErrorCallback<?> errorCallback, Class<T> remoteService)
          Returns an instance of the proxy that can schedule invocations on service methods on the service described by T.
 void sendBatch()
          Invokes the accumulated remote requests using a single server round trip.
 void sendBatch(ErrorCallback<?> errorCallback)
          Invokes the accumulated remote requests using a single server round trip.
 void sendBatch(RemoteCallback<Void> callback)
          Invokes the accumulated remote requests using a single server round trip.
 void sendBatch(RemoteCallback<Void> callback, ErrorCallback<?> errorCallback)
          Invokes the accumulated remote requests using a single server round trip.
 

Method Detail

call

<T> T call(RemoteCallback<?> callback,
           Class<T> remoteService)
Returns an instance of the proxy that can schedule invocations on service methods on the service described by T.

Parameters:
callback - the callback to be invoked when the remote call has completed in success. In the case of an error, a default error callback will be notified. Which one depends on the proxy implementation.

The provided callback must not be null.

remoteService - The interface describing the remote endpoint.
Returns:
an instance of the proxy that can invoke service methods on the service described by T.

call

<T> T call(RemoteCallback<?> callback,
           ErrorCallback<?> errorCallback,
           Class<T> remoteService)
Returns an instance of the proxy that can schedule invocations on service methods on the service described by T.

Parameters:
callback - the callback to be invoked when the remote call has completed in success. In the case of an error, a default error callback will be notified. Which one depends on the proxy implementation.

The callback must not be null.

errorCallback - the callback to be invoked when the remote call has completed in failure. No callback is invoked in the case of success.

The provided callback must not be null.

remoteService - The interface describing the remote endpoint.
Returns:
an instance of the proxy that can invoke service methods on the service described by T.

sendBatch

void sendBatch()
Invokes the accumulated remote requests using a single server round trip.


sendBatch

void sendBatch(RemoteCallback<Void> callback)
Invokes the accumulated remote requests using a single server round trip.

Parameters:
callback - the callback to be invoked when all remote calls have completed in success. Must not be null.

sendBatch

void sendBatch(ErrorCallback<?> errorCallback)
Invokes the accumulated remote requests using a single server round trip.

Parameters:
errorCallback - the callback to be invoked for all remote calls that have completed in failure. No callback is invoked in the case of success.

sendBatch

void sendBatch(RemoteCallback<Void> callback,
               ErrorCallback<?> errorCallback)
Invokes the accumulated remote requests using a single server round trip.

Parameters:
callback - the callback to be invoked when all remote calls have completed in success. Must not be null.
errorCallback - the callback to be invoked for all remote calls that have completed in failure.

Errai 3.0.1-SNAPSHOT

Copyright © 2013-2014 JBoss, a division of Red Hat. All Rights Reserved.