01: /*
02: * Licensed to the Apache Software Foundation (ASF) under one
03: * or more contributor license agreements. See the NOTICE file
04: * distributed with this work for additional information
05: * regarding copyright ownership. The ASF licenses this file
06: * to you under the Apache License, Version 2.0 (the
07: * "License"); you may not use this file except in compliance
08: * with the License. You may obtain a copy of the License at
09: *
10: * http://www.apache.org/licenses/LICENSE-2.0
11: *
12: * Unless required by applicable law or agreed to in writing,
13: * software distributed under the License is distributed on an
14: * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15: * KIND, either express or implied. See the License for the
16: * specific language governing permissions and limitations
17: * under the License.
18: */
19:
20: package org.apache.axis2.client.async;
21:
22: import org.apache.axiom.soap.SOAPEnvelope;
23: import org.apache.axis2.context.MessageContext;
24:
25: /**
26: * This class holds the results of an asynchronous invocation. The Axis2
27: * engine returns an instance of this class via the {@link
28: * Callback#onComplete(AsyncResult)} method when the operation completes
29: * successfully.
30: *
31: * @deprecated please see org.apache.axis2.client.async.AxisCallback.
32: */
33: public class AsyncResult {
34:
35: /**
36: * Message context that supplies the result information.
37: */
38: private MessageContext result;
39:
40: /**
41: * Constructor.
42: *
43: * @param result message context providing result information
44: * (<code>null</code> if no response)
45: */
46: public AsyncResult(MessageContext result) {
47: this .result = result;
48: }
49:
50: /**
51: * Get the SOAP Envelope for the response message.
52: *
53: * @return Envelope (<code>null</code> if none)
54: */
55: public SOAPEnvelope getResponseEnvelope() {
56: if (result != null) {
57: return result.getEnvelope();
58: } else {
59: return null;
60: }
61: }
62:
63: /**
64: * Get the complete message context for the response.
65: *
66: * @return context (<code>null</code> if none)
67: */
68: public MessageContext getResponseMessageContext() {
69: return result;
70: }
71: }
|