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 de...@apache.org on 2005/01/31 07:05:35 UTC

svn commit: r149225 - in webservices/axis/trunk/java/dev/scratch/prototype2/src: java/org/apache/axis/deployment/DeploymentConstants.java java/org/apache/axis/deployment/DeploymentParser.java java/org/apache/axis/deployment/server.xml java/org/apache/axis/description/AxisGlobal.java test-resources/deployment/server.xml

Author: deepal
Date: Sun Jan 30 22:05:33 2005
New Revision: 149225

URL: http://svn.apache.org/viewcvs?view=rev&rev=149225
Log:
added transports tag
<tarnsports>
 <tarnsport name="HTTP"/>
</transports>

Modified:
    webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentConstants.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentParser.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/server.xml
    webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/description/AxisGlobal.java
    webservices/axis/trunk/java/dev/scratch/prototype2/src/test-resources/deployment/server.xml

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentConstants.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentConstants.java?view=diff&r1=149224&r2=149225
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentConstants.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentConstants.java Sun Jan 30 22:05:33 2005
@@ -73,4 +73,7 @@
     String JAVAST = "http://ws.apache.org/axis2/deployment/java";
     String JAVAIMPL = "implementation";
 
+    String TRANSPORTSTAG = "transports";
+    String TRANSPORTTAG ="transport";
+
 }

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentParser.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentParser.java?view=diff&r1=149224&r2=149225
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentParser.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentParser.java Sun Jan 30 22:05:33 2005
@@ -127,8 +127,11 @@
                     if (PARAMETERST.equals(ST)) {
                         Parameter parameter = processParameter();
                         serverMetaData.addParameter(parameter);
+                    } else if (TRANSPORTSTAG.equals(ST)) {
+                        ArrayList trnsportList = processTransport();
+                        serverMetaData.setTransportList(trnsportList);
                     } else if (TYPEMAPPINGST.equals(ST)) {
-                       throw new UnsupportedOperationException("Type Mappings are not allowed in server.xml");
+                        throw new UnsupportedOperationException("Type Mappings are not allowed in server.xml");
                     } else if (MODULEST.equals(ST)) {
                         int attribCount = pullparser.getAttributeCount();
                         if (attribCount > 0) {
@@ -141,9 +144,9 @@
                             }
                         }
                     } else if (PHASE_ORDER.equals(ST)) {
-                      ((EngineRegistryImpl)dpengine.getEngineRegistry()).setPhases(processPhaseOrder());
+                        ((EngineRegistryImpl)dpengine.getEngineRegistry()).setPhases(processPhaseOrder());
                     } else if(SERVERST.equals(ST)){
-                         //TODO process attributes
+                        //TODO process attributes
                     }  else {
                         throw new UnsupportedOperationException(ST + " element is not allowed in the server.xml");
                     }
@@ -156,6 +159,43 @@
         }
     }
 
+
+    public ArrayList processTransport() throws DeploymentException {
+        boolean END_TRANSPORTS = false;
+        ArrayList transportList = new ArrayList();
+        String text = ""; // to store the paramater elemnt
+        try {
+            while (!END_TRANSPORTS) {
+                int eventType = pullparser.next();
+                if (eventType == XMLStreamConstants.END_DOCUMENT) {
+                    END_TRANSPORTS = true;
+                } else if (eventType == XMLStreamConstants.START_ELEMENT) {
+                    String tagnae = pullparser.getLocalName();
+                    if (TRANSPORTTAG.equals(tagnae)) {
+                        String attname = pullparser.getAttributeLocalName(0);
+                        String attvalue = pullparser.getAttributeValue(0);
+                        if (ATTNAME.equals(attname)) {
+                            transportList.add(attvalue);
+                        }
+                    }
+                } else if (eventType == XMLStreamConstants.END_ELEMENT) {
+                    String endtagname = pullparser.getLocalName();
+                    if (TRANSPORTSTAG.equals(endtagname)) {
+                        END_TRANSPORTS = true;
+                        break;
+                    }
+                } else if (eventType == XMLStreamConstants.CHARACTERS) {
+                    text = text + pullparser.getText();
+                }
+            }
+        } catch (XMLStreamException e) {
+            throw new DeploymentException("parser Exception", e);
+        } catch (Exception e) {
+            throw new DeploymentException("Unknown process Exception", e);
+        }
+        return transportList;
+    }
+
     /**
      * to process service.xml
      */
@@ -169,9 +209,9 @@
                     //TODO load the java clss for this
                     //TODO  somtimes Provider should be change
                     dpengine.getCurrentFileItem().setProvideName(attvalue);
-                  //  Provider provider = new SimpleJavaProvider();
-                   // provider. .setName(new QName(getValue(attvalue)));
-                   // axisService.setProvider(provider);
+                    //  Provider provider = new SimpleJavaProvider();
+                    // provider. .setName(new QName(getValue(attvalue)));
+                    // axisService.setProvider(provider);
                 } else if (STYLENAME.equals(attname)) {
                     // axisService.setStyle();
                     //TODO setStyle should be handle latter

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/server.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/server.xml?view=diff&r1=149224&r2=149225
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/server.xml (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/server.xml Sun Jan 30 22:05:33 2005
@@ -1,4 +1,8 @@
 <server name ="AxisJava2.0" >
+     <transports>
+        <transport name ="HTTP"/>
+        <transport name ="SMTP"/>
+    </transports>
    <phaseOrder>
         <phase name="global"/>
         <phase name="transport"/>

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/description/AxisGlobal.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/description/AxisGlobal.java?view=diff&r1=149224&r2=149225
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/description/AxisGlobal.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/description/AxisGlobal.java Sun Jan 30 22:05:33 2005
@@ -40,6 +40,7 @@
     protected ParameterInclude paramInclude;
     protected PhasesInclude phasesInclude;
     protected Vector modules;
+    protected ArrayList transportList;
 
     //TODO provide a way to store name (name attribute value server.xml)
     public AxisGlobal(){
@@ -47,7 +48,15 @@
         phasesInclude = new PhasesIncludeImpl();
         modules = new Vector();
     }
-    
+
+    public ArrayList getTransportList() {
+        return transportList;
+    }
+
+    public void setTransportList(ArrayList transportList) {
+        this.transportList = transportList;
+    }
+
     public void addModule(QName moduleref) {
        modules.add(moduleref);
     }

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test-resources/deployment/server.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test-resources/deployment/server.xml?view=diff&r1=149224&r2=149225
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test-resources/deployment/server.xml (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test-resources/deployment/server.xml Sun Jan 30 22:05:33 2005
@@ -2,6 +2,10 @@
     <parameter name="para1" locked="xsd:true">10</parameter>
     <parameter name="para2" locked="xsd:false">Colombo</parameter>
     <module ref="module1"> </module>
+    <transports>
+        <transport name ="HTTP"/>
+        <transport name ="SMTP"/>
+    </transports>
   <!--
     <module ref="uri">
         <parameter name="para3" locked="xsd:true">10</parameter>