KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis > ime > internal > MessageExchangeSendContext


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 package org.apache.axis.ime.internal;
17
18 import org.apache.axis.MessageContext;
19 import org.apache.axis.ime.MessageExchangeCorrelator;
20 import org.apache.axis.ime.MessageExchangeEventListener;
21
22 /**
23  * Note: the only challenge with making this class serializable
24  * is that org.apache.axis.MessageContext is currently NOT
25  * serializable. MessageContext needs to change in order to
26  * take advantage of persistent Channels and CorrelatorServices
27  *
28  * For thread safety, instances of this class are immutable
29  *
30  * @author James M Snell (jasnell@us.ibm.com)
31  * @author Ray Chun (rchun@sonicsoftware.com)
32  */

33 public final class MessageExchangeSendContext
34         extends MessageExchangeReceiveContext {
35
36     public static MessageExchangeSendContext newInstance(
37             MessageExchangeCorrelator correlator,
38             MessageContext context,
39             MessageExchangeEventListener listener) {
40         MessageExchangeSendContext mectx =
41                 new MessageExchangeSendContext();
42         mectx.correlator = correlator;
43         mectx.context = context;
44         mectx.listener = listener;
45         return mectx;
46     }
47
48     protected MessageContext context;
49
50     protected MessageExchangeSendContext() {}
51
52     public MessageContext getMessageContext() {
53         return this.context;
54     }
55
56 }
57
Popular Tags