axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From az...@apache.org
Subject svn commit: r419260 - in /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2: deployment/ServiceBuilder.java description/AxisService.java engine/DispatchPhase.java engine/ListenerManager.java transport/njms/JMSUtils.java
Date Wed, 05 Jul 2006 15:42:43 GMT
Author: azeez
Date: Wed Jul  5 08:42:43 2006
New Revision: 419260

URL: http://svn.apache.org/viewvc?rev=419260&view=rev
Log:
1. Changed exposeTransports to exposedTransports
2. Add new transport to axis service
3. Remove transport from axis service


Modified:
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DispatchPhase.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/ListenerManager.java
    webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/njms/JMSUtils.java

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java?rev=419260&r1=419259&r2=419260&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/ServiceBuilder.java
Wed Jul  5 08:42:43 2006
@@ -189,7 +189,7 @@
                     OMElement trsEle = (OMElement) transport_itr.next();
                     trs.add(trsEle.getText());
                 }
-                service.setExposeTransports((String[]) trs.toArray(new String[trs.size()]));
+                service.setExposedTransports((String[]) trs.toArray(new String[trs.size()]));
             }
             // processing operations
             Iterator operationsIterator =
@@ -237,7 +237,7 @@
                 service.removeOperation(new QName(opName));
             }
 
-            // Set the default message receiver for the operations that were 
+            // Set the default message receiver for the operations that were
             // not listed in the services.xml
             Iterator operations = service.getPublishedOperations().iterator();
             while (operations.hasNext()) {

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java?rev=419260&r1=419259&r2=419260&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/description/AxisService.java
Wed Jul  5 08:42:43 2006
@@ -57,15 +57,7 @@
 import java.io.InputStream;
 import java.io.OutputStream;
 import java.net.URL;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Hashtable;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
 
 /**
  * Class AxisService
@@ -124,7 +116,7 @@
             Java2WSDLConstants.SCHEMA_NAMESPACE_PRFIX;
 
     private boolean enableAllTransport = true;
-    private String [] exposeTransports;
+    private List exposedTransports;
 
     /**
      * Keeps track whether the schema locations are adjusted
@@ -412,7 +404,7 @@
         for(int i=0;i<faultActionNames.length;i++){
            operation.addFaultAction(faultActionNames[i],axisOperation.getFaultAction(faultActionNames[i]));
         }
-        
+
         return operation;
     }
 
@@ -510,7 +502,7 @@
         AxisOperation axisOperation = getOperation(new QName(operationName));
         if (axisOperation == null) {
             throw new AxisFault(Messages.getMessage("invalidoperation",
-                    operationName));
+                                                    operationName));
         }
         PolicyUtil.writePolicy(axisOperation.getPolicyInclude(), out);
     }
@@ -547,7 +539,7 @@
                 }
             }
         } else {
-            String trs [] = getExposeTransports();
+            String trs [] = getExposedTransports();
             for (int i = 0; i < trs.length; i++) {
                 String trsName = trs[i];
                 TransportInDescription transportIn = axisConfig.getTransportIn(
@@ -557,7 +549,7 @@
                     if (listener != null) {
                         try {
                             if (listener.getEPRForService(getName(), requestIP)
-                                    != null) {
+                                != null) {
                                 String address = listener.getEPRForService(
                                         getName(), requestIP).getAddress();
                                 if (address != null) {
@@ -599,7 +591,7 @@
     private void getWSDL(OutputStream out, String [] serviceURL, String servicePath) throws
AxisFault {
         if (isWsdlfound()) {
             AxisService2OM axisService2WOM = new AxisService2OM(this,
-                    serviceURL, "document", "literal", servicePath);
+                                                                serviceURL, "document", "literal",
servicePath);
             try {
                 OMElement wsdlElement = axisService2WOM.generateOM();
                 wsdlElement.serialize(out);
@@ -611,10 +603,10 @@
         } else {
             try {
                 String wsdlntfound = "<error>" +
-                        "<description>Unable to generate WSDL for this service</description>"
+
-                        "<reason>Either user has not dropped the wsdl into META-INF
or" +
-                        " operations use message receivers other than RPC.</reason>"
+
-                        "</error>";
+                                     "<description>Unable to generate WSDL for this
service</description>" +
+                                     "<reason>Either user has not dropped the wsdl
into META-INF or" +
+                                     " operations use message receivers other than RPC.</reason>"
+
+                                     "</error>";
                 out.write(wsdlntfound.getBytes());
                 out.flush();
                 out.close();
@@ -652,10 +644,10 @@
         } else {
             try {
                 String wsdlntfound = "<error>" +
-                        "<description>Unable to generate WSDL for this service</description>"
+
-                        "<reason>Either user has not dropped the wsdl into META-INF
or" +
-                        " operations use message receivers other than RPC.</reason>"
+
-                        "</error>";
+                                     "<description>Unable to generate WSDL for this
service</description>" +
+                                     "<reason>Either user has not dropped the wsdl
into META-INF or" +
+                                     " operations use message receivers other than RPC.</reason>"
+
+                                     "</error>";
                 out.write(wsdlntfound.getBytes());
                 out.flush();
                 out.close();
@@ -908,9 +900,9 @@
      */
     public void setScope(String scope) {
         if (Constants.SCOPE_APPLICATION.equals(scope) ||
-                Constants.SCOPE_TRANSPORT_SESSION.equals(scope) ||
-                Constants.SCOPE_SOAP_SESSION.equals(scope) ||
-                Constants.SCOPE_REQUEST.equals(scope)) {
+            Constants.SCOPE_TRANSPORT_SESSION.equals(scope) ||
+            Constants.SCOPE_SOAP_SESSION.equals(scope) ||
+            Constants.SCOPE_REQUEST.equals(scope)) {
             this.scope = scope;
         }
     }
@@ -985,17 +977,28 @@
         return enableAllTransport;
     }
 
-    public String[] getExposeTransports() {
-        return exposeTransports;
+    public String[] getExposedTransports() {
+        return (String[]) (exposedTransports.toArray(new String[exposedTransports.size()]));
     }
 
-    public void setExposeTransports(String[] exposeTransports) {
-        if (exposeTransports.length > 0) {
+    public void setExposedTransports(String[] transports) {
+        if (transports.length > 0) {
             enableAllTransport = false;
-            this.exposeTransports = exposeTransports;
+            this.exposedTransports = new Vector();
+            for (int i = 0; i < transports.length; i++) {
+                this.exposedTransports.add(transports[i]);
+            }
         }
     }
 
+    public void addExposedTransport(String transport){
+        this.exposedTransports.add(transport);
+    }
+
+    public void removeExposedTransport(String transport){
+        this.exposedTransports.remove(transport);
+    }
+
     public void disEngageModule(AxisModule module) {
         AxisConfiguration axisConfig = getAxisConfiguration();
         if (axisConfig != null) {
@@ -1143,8 +1146,8 @@
         SchemaGenerator schemaGenerator;
         try {
             schemaGenerator = new SchemaGenerator(serviceClassLoader,
-                    implClass, axisService.getSchematargetNamespace(),
-                    axisService.getSchematargetNamespacePrefix());
+                                                  implClass, axisService.getSchematargetNamespace(),
+                                                  axisService.getSchematargetNamespacePrefix());
             ArrayList excludedMethods = new ArrayList();
             excludedMethods.add("init");
             excludedMethods.add("setOperationContext");
@@ -1177,10 +1180,10 @@
                 operation.setMessageReceiver(messageReceiver);
             } catch (IllegalAccessException e) {
                 throw new AxisFault("IllegalAccessException occured during message receiver
loading"
-                        + e.getMessage());
+                                    + e.getMessage());
             } catch (InstantiationException e) {
                 throw new AxisFault("InstantiationException occured during message receiver
loading"
-                        + e.getMessage());
+                                    + e.getMessage());
             }
             pinfo.setOperationPhases(operation);
             axisService.addOperation(operation);
@@ -1229,8 +1232,8 @@
         SchemaGenerator schemaGenerator;
         try {
             schemaGenerator = new SchemaGenerator(serviceClassLoader,
-                    implClass, schemaNameSpace,
-                    axisService.getSchematargetNamespacePrefix());
+                                                  implClass, schemaNameSpace,
+                                                  axisService.getSchematargetNamespacePrefix());
             ArrayList excludeOpeartion = new ArrayList();
             excludeOpeartion.add("init");
             excludeOpeartion.add("setOperationContext");
@@ -1266,10 +1269,10 @@
                 operation.setMessageReceiver(messageReceiver);
             } catch (IllegalAccessException e) {
                 throw new AxisFault("IllegalAccessException occured during message receiver
loading"
-                        + e.getMessage());
+                                    + e.getMessage());
             } catch (InstantiationException e) {
                 throw new AxisFault("InstantiationException occured during message receiver
loading"
-                        + e.getMessage());
+                                    + e.getMessage());
             }
             pinfo.setOperationPhases(operation);
             axisService.addOperation(operation);
@@ -1285,7 +1288,7 @@
             clazz = Class.forName("org.apache.axis2.rpc.receivers.RPCMessageReceiver");
         } catch (ClassNotFoundException e) {
             throw new AxisFault("ClassNotFoundException occured during message receiver loading"
-                    + e.getMessage());
+                                + e.getMessage());
         }
 
         return createService(implClass, axisConfig, clazz);
@@ -1378,12 +1381,12 @@
                     if (s != null) {
                         calcualteSchemaNames(Arrays.asList(
                                 new XmlSchema[]{s}),
-                                nameTable);
+                                             nameTable);
                         nameTable.put(s,
-                                ("xsd" + count++)
-                                        + (customSchemaNameSuffix != null ?
-                                        customSchemaNameSuffix :
-                                        ""));
+                                      ("xsd" + count++)
+                                      + (customSchemaNameSuffix != null ?
+                                         customSchemaNameSuffix :
+                                         ""));
                     }
 
                 }
@@ -1413,13 +1416,13 @@
                                 new XmlSchema[]{s}), nameTable);
                         xmlSchemaExternal.setSchemaLocation(
                                 customSchemaNamePrefix == null ?
-                                        //use the default mode
-                                        (getName() +
-                                                "?xsd=" +
-                                                nameTable.get(s)) :
-                                        //custom prefix is present - add the custom prefix
-                                        (customSchemaNamePrefix +
-                                                nameTable.get(s)));
+                                //use the default mode
+                                (getName() +
+                                 "?xsd=" +
+                                 nameTable.get(s)) :
+                                                   //custom prefix is present - add the custom
prefix
+                                                   (customSchemaNamePrefix +
+                                                    nameTable.get(s)));
                     }
                 }
             }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DispatchPhase.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DispatchPhase.java?rev=419260&r1=419259&r2=419260&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DispatchPhase.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/DispatchPhase.java
Wed Jul  5 08:42:43 2006
@@ -79,7 +79,7 @@
         if (service.isEnableAllTransport()) {
             return;
         } else {
-            String trs [] = service.getExposeTransports();
+            String trs [] = service.getExposedTransports();
             String incommingTrs = msgctx.getIncomingTransportName();
             for (int i = 0; i < trs.length; i++) {
                 String tr = trs[i];

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/ListenerManager.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/ListenerManager.java?rev=419260&r1=419259&r2=419260&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/ListenerManager.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/engine/ListenerManager.java
Wed Jul  5 08:42:43 2006
@@ -73,12 +73,12 @@
                 Iterator itr_st = startedTransports.values().iterator();
                 if (itr_st.hasNext()) {
                     TransportListener transportListener = (TransportListener) itr_st.next();
-                    return transportListener.getEPRForService(serviceName + "/" + opName,
null);
+                    return transportListener.getEPRForService(serviceName, null);
                 } else {
                     return null;
                 }
             } else {
-                String exposeTransport [] = service.getExposeTransports();
+                String exposeTransport [] = service.getExposedTransports();
                 TransportListener listener = (TransportListener)
                         startedTransports.get(exposeTransport[0]);
                 if (opName == null) {

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/njms/JMSUtils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/njms/JMSUtils.java?rev=419260&r1=419259&r2=419260&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/njms/JMSUtils.java
(original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/transport/njms/JMSUtils.java
Wed Jul  5 08:42:43 2006
@@ -62,7 +62,7 @@
             return true;
 
         } else {
-            String[] transports = service.getExposeTransports();
+            String[] transports = service.getExposedTransports();
             for (int i=0; i<transports.length; i++) {
                 if (Constants.TRANSPORT_JMS.equals(transports[i])) {
                     return true;



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message