Class Receiver<V>
- java.lang.Object
-
- com.google.web.bindery.requestfactory.shared.Receiver<V>
-
- Type Parameters:
V- value type
- Direct Known Subclasses:
FanoutReceiver
public abstract class Receiver<V> extends java.lang.ObjectCallback object forRequest.fire(Receiver)andRequestContext.fire(Receiver).
-
-
Constructor Summary
Constructors Constructor Description Receiver()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Deprecated Methods Modifier and Type Method Description voidonConstraintViolation(java.util.Set<ConstraintViolation<?>> violations)Called if an object sent to the server could not be validated.voidonFailure(ServerFailure error)Receives general failure notifications.abstract voidonSuccess(V response)Called when a Request has been successfully executed on the server.voidonViolation(java.util.Set<Violation> errors)Deprecated.UseonConstraintViolation(Set)instead
-
-
-
Method Detail
-
onFailure
public void onFailure(ServerFailure error)
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.- Parameters:
error- aServerFailureinstance
-
onSuccess
public abstract void onSuccess(V response)
Called when a Request has been successfully executed on the server.- Parameters:
response- a response of type V
-
onViolation
@Deprecated public void onViolation(java.util.Set<Violation> errors)
Deprecated.UseonConstraintViolation(Set)insteadCalled if an object sent to the server could not be validated. The default implementation callsonFailure(ServerFailure)iferrorsis not empty.- Parameters:
errors- a Set ofViolationinstances
-
onConstraintViolation
public void onConstraintViolation(java.util.Set<ConstraintViolation<?>> violations)
Called if an object sent to the server could not be validated. The default implementation callsonViolation(Set), converting theConstraintViolationobjects to the deprecatedViolationtype.- Parameters:
violations- a Set ofConstraintViolationinstances
-
-