You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by du...@apache.org on 2001/08/13 19:53:23 UTC
cvs commit: xml-axis/java/src/org/apache/axis/transport/local LocalTransport.java
dug 01/08/13 10:53:23
Modified: java/src/org/apache/axis/client ServiceClient.java
Transport.java
java/src/org/apache/axis/transport/http HTTPTransport.java
java/src/org/apache/axis/transport/local LocalTransport.java
Log:
Per Glen's suggestion added a transportName field to Transport class
but still allow client-apps to override it.
Revision Changes Path
1.41 +4 -3 xml-axis/java/src/org/apache/axis/client/ServiceClient.java
Index: ServiceClient.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/ServiceClient.java,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- ServiceClient.java 2001/08/13 16:21:39 1.40
+++ ServiceClient.java 2001/08/13 17:53:23 1.41
@@ -174,7 +174,7 @@
// Our Transport, if any
private Transport transport;
- private String transportName ;
+ private String transportName;
/**
* Basic, no-argument constructor.
@@ -266,6 +266,8 @@
*/
public void setTransportName(String name) {
transportName = name ;
+ if ( transport != null )
+ transport.setTransportName( name );
}
/** Get the Transport registered for the given protocol.
@@ -546,8 +548,7 @@
if (transport != null) {
transport.setupMessageContext(msgContext, this, this.engine);
}
- // Pass along the transport chain name if given
- if ( transportName != null )
+ else
msgContext.setTransportName( transportName );
try {
1.7 +21 -0 xml-axis/java/src/org/apache/axis/client/Transport.java
Index: Transport.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/client/Transport.java,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- Transport.java 2001/06/26 21:01:01 1.6
+++ Transport.java 2001/08/13 17:53:23 1.7
@@ -70,6 +70,11 @@
*/
public static String USER = MessageContext.USERID;
public static String PASSWORD = MessageContext.PASSWORD;
+
+ /**
+ * Transport Chain Name - so users can change the default.
+ */
+ public static String transportName = null ;
/**
* Set up any transport-specific derived properties in the message context.
@@ -81,6 +86,22 @@
public abstract void setupMessageContext
(MessageContext context, ServiceClient message, AxisEngine engine)
throws AxisFault;
+
+ /**
+ * Sets the transport chain name - to override the default.
+ * @param name the name of the transport chain to use
+ */
+ public void setTransportName(String name) {
+ transportName = name ;
+ }
+
+ /**
+ * Returns the name of the transport chain to use
+ * @return the transport chain name (or null if the default chain)
+ */
+ public String getTransportName() {
+ return( transportName );
+ }
}
1.4 +1 -13 xml-axis/java/src/org/apache/axis/transport/http/HTTPTransport.java
Index: HTTPTransport.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/http/HTTPTransport.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- HTTPTransport.java 2001/08/03 17:17:06 1.3
+++ HTTPTransport.java 2001/08/13 17:53:23 1.4
@@ -84,7 +84,6 @@
private String url;
private String action;
- private String transportName = "http";
public HTTPTransport () {
}
@@ -99,17 +98,6 @@
}
/**
- * Allows the user to set a particular transport Handler for sending this
- * message. Assumes the name passed is in fact a registered transport.
- *
- * @param transportName the name of a transport Handler
- */
- public void setTransportName(String transportName)
- {
- this.transportName = transportName;
- }
-
- /**
* Set up any transport-specific derived properties in the message context.
* @param context the context to set up
* @param message the client service instance
@@ -122,7 +110,7 @@
if (url != null) mc.setProperty(URL, url);
if (action != null) mc.setProperty(ACTION, action);
- mc.setTransportName(transportName);
+ mc.setTransportName(transportName == null ? "http" : transportName);
// Allow the SOAPAction to determine the service, if the service
// (a) has not already been determined, and (b) if a service matching
1.4 +1 -1 xml-axis/java/src/org/apache/axis/transport/local/LocalTransport.java
Index: LocalTransport.java
===================================================================
RCS file: /home/cvs/xml-axis/java/src/org/apache/axis/transport/local/LocalTransport.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- LocalTransport.java 2001/07/12 15:04:47 1.3
+++ LocalTransport.java 2001/08/13 17:53:23 1.4
@@ -109,7 +109,7 @@
*/
public void setupMessageContext (MessageContext mc, ServiceClient serv, AxisEngine engine)
{
- mc.setTransportName("local");
+ mc.setTransportName(transportName == null ? "local" : transportName);
if (server != null)
mc.setProperty(LOCAL_SERVER, server);
}