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.Object
Callback 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 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.abstract void
onSuccess(V response)
Called when a Request has been successfully executed on the server.void
onViolation(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
- aServerFailure
instance
-
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)
iferrors
is not empty.- Parameters:
errors
- a Set ofViolation
instances
-
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 theConstraintViolation
objects to the deprecatedViolation
type.- Parameters:
violations
- a Set ofConstraintViolation
instances
-
-