KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > jdon > bussinessproxy > remote > http > HttpResponse


1 /**
2  * Copyright 2003-2006 the original author or authors.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6
7        http://www.apache.org/licenses/LICENSE-2.0
8
9   * Unless required by applicable law or agreed to in writing, software
10   * distributed under the License is distributed on an "AS IS" BASIS,
11   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12   * See the License for the specific language governing permissions and
13   * limitations under the License.
14   */

15
16 package com.jdon.bussinessproxy.remote.http;
17
18
19 import java.io.Serializable JavaDoc;
20
21 /**
22  * This class holds the result of a client call.
23  * Depending on the server, the response can be a result or an exception.
24  */

25 public class HttpResponse implements Serializable JavaDoc {
26     private Throwable JavaDoc throwable;
27     private Object JavaDoc result;
28
29     public HttpResponse(Throwable JavaDoc throwable) {
30         this.throwable = throwable;
31     }
32
33     public HttpResponse(Object JavaDoc result) {
34         this.result = result;
35     }
36
37     public Throwable JavaDoc getThrowable() {
38         return throwable;
39     }
40
41     public void setThrowable(Throwable JavaDoc throwable) {
42         this.throwable = throwable;
43     }
44
45     public Object JavaDoc getResult() {
46         return result;
47     }
48
49     public void setResult(Object JavaDoc result) {
50         this.result = result;
51     }
52
53     public boolean isExceptionThrown() {
54         if (throwable != null) return true;
55         return false;
56     }
57 }
58
Popular Tags