KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis > client > Transport


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;
18
19 import org.apache.axis.AxisEngine;
20 import org.apache.axis.AxisFault;
21 import org.apache.axis.MessageContext;
22
23 public class Transport {
24
25     /**
26      * Transport Chain Name - so users can change the default.
27      */

28     public String JavaDoc transportName = null ;
29
30     /**
31      * Transport URL, if any.
32      */

33     public String JavaDoc url = null;
34
35     public final void setupMessageContext(MessageContext context,
36                                           Call message,
37                                           AxisEngine engine)
38         throws AxisFault
39     {
40         if (url != null)
41             context.setProperty(MessageContext.TRANS_URL, url);
42
43         if (transportName != null)
44             context.setTransportName(transportName);
45
46         setupMessageContextImpl(context, message, engine);
47     }
48
49     public void setupMessageContextImpl(MessageContext context,
50                                         Call message,
51                                         AxisEngine engine)
52         throws AxisFault
53     {
54         // Default impl does nothing
55
}
56
57     /**
58      * Allow the transport to grab any transport-specific stuff it might
59      * want from a returned MessageContext
60      */

61     public void processReturnedMessageContext(MessageContext context)
62     {
63         // Default impl does nothing
64
}
65
66     /**
67      * Sets the transport chain name - to override the default.
68      * @param name the name of the transport chain to use
69      */

70     public void setTransportName(String JavaDoc name) {
71         transportName = name ;
72     }
73
74     /**
75      * Returns the name of the transport chain to use
76      * @return the transport chain name (or null if the default chain)
77      */

78     public String JavaDoc getTransportName() {
79         return( transportName );
80     }
81
82     /**
83      * Get the transport-specific URL
84      */

85     public String JavaDoc getUrl() {
86         return url;
87     }
88
89     /**
90      * Set the transport-specific URL
91      */

92     public void setUrl(String JavaDoc url) {
93         this.url = url;
94     }
95 }
96
97
98
Popular Tags