Class FanoutReceiver<T>
- java.lang.Object
-
- com.google.web.bindery.requestfactory.shared.Receiver<T>
-
- com.google.web.bindery.requestfactory.shared.FanoutReceiver<T>
-
- Type Parameters:
T
- the type of data being received
public class FanoutReceiver<T> extends Receiver<T>
A FanoutReceiver will forward its callbacks to zero or more other Receivers. Any exceptions thrown by the queued Receivers will be re-thrown as anUmbrellaException
after all Receivers have been invoked.
-
-
Constructor Summary
Constructors Constructor Description FanoutReceiver()
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
add(Receiver<? super T> receiver)
Register a receiver to be called by the fanout.protected void
finish()
Called after all Receivers have been executed.void
onConstraintViolation(java.util.Set<ConstraintViolation<?>> violations)
Called if an object sent to the server could not be validated.void
onFailure(ServerFailure error)
Receives general failure notifications.void
onSuccess(T response)
Called when a Request has been successfully executed on the server.protected void
onUncaughtThrowable(java.lang.Throwable t)
Subclasses may override this method to alter how the FanoutReceiver collects exceptions that escape from the queued Receivers.void
onViolation(java.util.Set<Violation> errors)
Deprecated.
-
-
-
Method Detail
-
add
public void add(Receiver<? super T> receiver)
Register a receiver to be called by the fanout.- Throws:
java.lang.IllegalArgumentException
- ifreceiver
isnull
-
onConstraintViolation
public void onConstraintViolation(java.util.Set<ConstraintViolation<?>> violations)
Description copied from class:Receiver
Called if an object sent to the server could not be validated. The default implementation callsReceiver.onViolation(Set)
, converting theConstraintViolation
objects to the deprecatedViolation
type.- Overrides:
onConstraintViolation
in classReceiver<T>
- Parameters:
violations
- a Set ofConstraintViolation
instances
-
onFailure
public void onFailure(ServerFailure error)
Description copied from class:Receiver
Receives general failure notifications. The default implementation looks atServerFailure.isFatal()
, and throws a runtime exception with the failure object's error message if it is true.- Overrides:
onFailure
in classReceiver<T>
- Parameters:
error
- aServerFailure
instance
-
onSuccess
public void onSuccess(T response)
Description copied from class:Receiver
Called when a Request has been successfully executed on the server.
-
onViolation
@Deprecated public void onViolation(java.util.Set<Violation> errors)
Deprecated.Description copied from class:Receiver
Called if an object sent to the server could not be validated. The default implementation callsReceiver.onFailure(ServerFailure)
iferrors
is not empty.- Overrides:
onViolation
in classReceiver<T>
- Parameters:
errors
- a Set ofViolation
instances
-
finish
protected void finish()
Called after all Receivers have been executed.
-
onUncaughtThrowable
protected void onUncaughtThrowable(java.lang.Throwable t)
Subclasses may override this method to alter how the FanoutReceiver collects exceptions that escape from the queued Receivers.
-
-