source: java/main/src/main/java/com/framsticks/communication/ClientSideResponseFuture.java @ 193

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
RevLine 
[97]1package com.framsticks.communication;
2
[105]3import com.framsticks.util.ExceptionHandler;
[97]4import com.framsticks.util.FramsticksException;
[105]5import com.framsticks.util.dispatching.Future;
[97]6
[105]7public abstract class ClientSideResponseFuture extends Future<Response> {
[97]8
[105]9        public ClientSideResponseFuture(ExceptionHandler handler) {
[97]10                super(handler);
11        }
12
[98]13        protected Request request;
14
[97]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 {
[98]22                        handle(new FramsticksException().msg("invalid response").arg("comment", response.getComment()).arg("request", request));
[97]23                }
24        }
25
[98]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
[97]40}
Note: See TracBrowser for help on using the repository browser.