Created
May 30, 2014 16:01
-
-
Save jsanda/f671e94ae41ec0d31c67 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void addData(final AsyncResponse asyncResponse, Set<RawNumericMetric> rawData) { | |
ListenableFuture<Map<RawNumericMetric,Throwable>> future = metricsService.addData(rawData); | |
Futures.addCallback(future, new FutureCallback<Map<RawNumericMetric, Throwable>>() { | |
@Override | |
public void onSuccess(Map<RawNumericMetric, Throwable> errors) { | |
Response jaxrs = Response.ok().type(MediaType.APPLICATION_JSON_TYPE).build(); | |
asyncResponse.resume(jaxrs); | |
} | |
@Override | |
public void onFailure(Throwable t) { | |
asyncResponse.resume(t); | |
} | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment