KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis > client > async > AsyncCall


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

16
17 package org.apache.axis.client.async;
18
19 import org.apache.axis.client.Call;
20
21 import javax.xml.namespace.QName JavaDoc;
22
23 /**
24  * Support for Asynchronous call
25  *
26  * @author Davanum Srinivas (dims@yahoo.com)
27  */

28 public class AsyncCall {
29
30     /**
31      * Field call
32      */

33     private Call call = null;
34
35     /**
36      * Field callback
37      */

38     private IAsyncCallback callback = null;
39
40     /**
41      * Constructor AsyncCall
42      *
43      * @param call
44      */

45     public AsyncCall(Call call) {
46         this(call, null);
47     }
48
49     /**
50      * Constructor AsyncCall
51      *
52      * @param call
53      * @param callback
54      */

55     public AsyncCall(Call call, IAsyncCallback callback) {
56         this.call = call;
57         this.callback = callback;
58     }
59
60     /**
61      * Method getCallback
62      *
63      * @return
64      */

65     public IAsyncCallback getCallback() {
66         return callback;
67     }
68
69     /**
70      * Method setCallback
71      *
72      * @param callback
73      */

74     public void setCallback(IAsyncCallback callback) {
75         this.callback = callback;
76     }
77
78     /**
79      * Method invoke
80      *
81      * @param inputParams
82      * @return
83      */

84     public IAsyncResult invoke(Object JavaDoc[] inputParams) {
85         return new AsyncResult(this, null, inputParams);
86     }
87
88     /**
89      * Method invoke
90      *
91      * @param qName
92      * @param inputParams
93      * @return
94      */

95     public IAsyncResult invoke(QName JavaDoc qName, Object JavaDoc[] inputParams) {
96         return new AsyncResult(this, qName, inputParams);
97     }
98
99     /**
100      * Method getCall
101      *
102      * @return
103      */

104     public Call getCall() {
105         return call;
106     }
107 }
108
Popular Tags