Last change
on this file since 193 was
193,
checked in by Maciej Komosinski, 10 years ago
|
Set svn:eol-style native for all textual files
|
-
Property svn:eol-style set to
native
|
File size:
887 bytes
|
Line | |
---|
1 | package com.framsticks.communication; |
---|
2 | |
---|
3 | import com.framsticks.util.ExceptionHandler; |
---|
4 | import com.framsticks.util.FramsticksException; |
---|
5 | import com.framsticks.util.dispatching.Future; |
---|
6 | |
---|
7 | public abstract class ClientSideResponseFuture extends Future<Response> { |
---|
8 | |
---|
9 | public ClientSideResponseFuture(ExceptionHandler handler) { |
---|
10 | super(handler); |
---|
11 | } |
---|
12 | |
---|
13 | protected Request request; |
---|
14 | |
---|
15 | protected abstract void processOk(Response response); |
---|
16 | |
---|
17 | @Override |
---|
18 | protected final void result(Response response) { |
---|
19 | if (response.getOk()) { |
---|
20 | processOk(response); |
---|
21 | } else { |
---|
22 | handle(new FramsticksException().msg("invalid response").arg("comment", response.getComment()).arg("request", request)); |
---|
23 | } |
---|
24 | } |
---|
25 | |
---|
26 | /** |
---|
27 | * @return the request |
---|
28 | */ |
---|
29 | public Request getRequest() { |
---|
30 | return request; |
---|
31 | } |
---|
32 | |
---|
33 | /** |
---|
34 | * @param request the request to set |
---|
35 | */ |
---|
36 | public void setRequest(Request request) { |
---|
37 | this.request = request; |
---|
38 | } |
---|
39 | |
---|
40 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.