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 2004/12/23 05:54:10 UTC

svn commit: r123165 - in webservices/axis/trunk/java/dev/scratch/prototype2/src: java/org/apache/axis/deployment java/org/apache/axis/deployment/repository/utill java/org/apache/axis/impl/description java/org/apache/axis/phaseresolver samples/deployment/service1/META-INF samples/deployment/service2/META-INF samples/msg/echo/META-INF

Author: deepal
Date: Wed Dec 22 20:54:08 2004
New Revision: 123165

URL: http://svn.apache.org/viewcvs?view=rev&rev=123165
Log:
java:Implemantation modifications
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/DeploymentEngine.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/repository/utill/UnZipJAR.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/description/AxisServiceImpl.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/description/SimpleAxisServiceImpl.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/phaseresolver/PhaseResolver.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/deployment/service1/META-INF/service.xml
   webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/deployment/service2/META-INF/service.xml
   webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/msg/echo/META-INF/service.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&rev=123165&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentConstants.java&r1=123164&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentConstants.java&r2=123165
==============================================================================
--- 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	Wed Dec 22 20:54:08 2004
@@ -69,7 +69,7 @@
     String PHASELAST = "phaseLast";
     String ORDER = "order";  // to resolve the order tag
 
-    String JAVAST = "java";
+    String JAVAST = "http://ws.apache.org/axis2/deployment/java";
     String JAVAIMPL = "implementation";
 
 }

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentEngine.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentEngine.java?view=diff&rev=123165&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentEngine.java&r1=123164&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentEngine.java&r2=123165
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentEngine.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentEngine.java	Wed Dec 22 20:54:08 2004
@@ -213,6 +213,7 @@
 
     private void loadServiceClass(AxisService service, ClassLoader parent) throws AxisFault{
         File file = currentFileItem.getFile();
+        Class serviceclass = null;
         URLClassLoader loader1 = null;
         if (file != null) {
             URL[] urlsToLoadFrom = new URL[0];
@@ -222,7 +223,9 @@
                 }
                 urlsToLoadFrom = new URL[]{file.toURL()};
                 loader1 = new URLClassLoader(urlsToLoadFrom, parent);
-                Class serviceclass = Class.forName(service.getServiceClassName(), true, loader1);
+                if(! service.getServiceClassName().equals("")){
+                    serviceclass = Class.forName(service.getServiceClassName(), true, loader1);
+                }
                 service.setServiceClass(serviceclass);
             } catch (MalformedURLException e) {
                 throw new AxisFault(e.getMessage());
@@ -340,38 +343,41 @@
                 switch (type) {
                     case SERVICE:
                         {
-                            //todo implemnt this in right manner
-                            AxisService service = new SimpleAxisServiceImpl(null);
-                            unZipJAR.unzipService(currentFileItem.getAbsolutePath(), this, service);
                             try {
-                                if (service != null) {
-                                    try {
-                                        addnewService(service);
-                                    } catch (PhaseException e) {
-                                        e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-                                    }
-                                    log.info("Deployement WS Name  " + currentFileItem.getName());
-                                    currentFileItem = null;
-                                    break;
-                                }
+                                AxisService service = new SimpleAxisServiceImpl(null);
+                                unZipJAR.unzipService(currentFileItem.getAbsolutePath(), this, service);
+                                addnewService(service);
+                                log.info("Deployement WS Name  " + currentFileItem.getName());
+                                // currentFileItem = null;
+                                //  break;
+                            }catch (DeploymentException de){
+                                de.printStackTrace();
                             }catch (AxisFault axisFault) {
                                 axisFault.printStackTrace();  //To change body of catch statement use Options | File Templates.
+                            } catch (Exception e){
+                                e.printStackTrace();
+                            } finally{
+                                currentFileItem = null;
                             }
+                            break;
                         }
                     case MODULE:
                         {
-                            AxisModule metaData = new AxisModule();
-                            unZipJAR.unzipModule(currentFileItem.getAbsolutePath(), this,metaData);
                             try {
-                                if (metaData != null) {
-                                    addNewModule(metaData);
-                                    log.info("Moduel WS Name  " + currentFileItem.getName() + " modulename :" + metaData.getName());
-                                    currentFileItem = null;
-                                    break;
-                                }
+                                AxisModule metaData = new AxisModule();
+                                unZipJAR.unzipModule(currentFileItem.getAbsolutePath(), this,metaData);
+                                addNewModule(metaData);
+                                log.info("Moduel WS Name  " + currentFileItem.getName() + " modulename :" + metaData.getName());
+                                // currentFileItem = null;
+                                //  break;
+                            } catch (DeploymentException e) {
+                                e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
                             } catch (AxisFault axisFault) {
-                                axisFault.printStackTrace();  //To change body of catch statement use Options | File Templates.
+                                axisFault.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+                            }finally{
+                                currentFileItem = null;
                             }
+                            break;
                         }
                 }
             }

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&rev=123165&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentParser.java&r1=123164&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentParser.java&r2=123165
==============================================================================
--- 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	Wed Dec 22 20:54:08 2004
@@ -201,11 +201,11 @@
                 } else if (attname.equals(CONTEXTPATHNAME)) {
                     axisService.setContextPath(getValue(attvalue));
                 } else {
-                    throw new DeploymentException("Bad arguments");
+                    throw new DeploymentException("Bad arguments for the service" + axisService.getName());
                 }
             }
         } else
-            throw new DeploymentException("Bad arguments");
+            throw new DeploymentException("Bad arguments" +  axisService.getName());
 
         //*********************************************************************************************//
         // This is to process remainng part of the document
@@ -485,7 +485,7 @@
         //  String name = pullparser.getLocalName();
         AxisOperation operation = new SimpleAxisOperationImpl();
         int attribCount = pullparser.getAttributeCount();
-        if (attribCount == 4) {  // there should be two attributes
+        if (attribCount < 5) {  // there should be two attributes
             for (int i = 0; i < attribCount; i++) {
                 String attname = pullparser.getAttributeLocalName(i);
                 String attvalue = pullparser.getAttributeValue(i);

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/UnZipJAR.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/UnZipJAR.java?view=diff&rev=123165&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/UnZipJAR.java&r1=123164&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/UnZipJAR.java&r2=123165
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/UnZipJAR.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/UnZipJAR.java	Wed Dec 22 20:54:08 2004
@@ -19,6 +19,7 @@
 import org.apache.axis.deployment.DeploymentConstants;
 import org.apache.axis.deployment.DeploymentEngine;
 import org.apache.axis.deployment.DeploymentParser;
+import org.apache.axis.deployment.DeploymentException;
 import org.apache.axis.description.AxisModule;
 import org.apache.axis.description.AxisService;
 
@@ -36,7 +37,7 @@
      * @param filename
      * @param engine
      */
-    public void unzipService(String filename, DeploymentEngine engine, AxisService service) {
+    public void unzipService(String filename, DeploymentEngine engine, AxisService service) throws DeploymentException {
         // get attribute values
         String strArchive = filename;
         ZipInputStream zin;
@@ -53,11 +54,11 @@
             //  zin.closeEntry();
             zin.close();
         } catch (Exception e) {
-            e.printStackTrace();
+           throw new DeploymentException(e.getMessage());
         }
     }
 
-    public void unzipModule(String filename, DeploymentEngine engine,AxisModule module) {
+    public void unzipModule(String filename, DeploymentEngine engine,AxisModule module) throws DeploymentException {
         // get attribute values
         String strArchive = filename;
         ZipInputStream zin;
@@ -74,7 +75,7 @@
             //  zin.closeEntry();
             zin.close();
         } catch (Exception e) {
-            e.printStackTrace();
+            throw new DeploymentException(e.getMessage());
         }
     }
 }

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/description/AxisServiceImpl.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/description/AxisServiceImpl.java?view=diff&rev=123165&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/description/AxisServiceImpl.java&r1=123164&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/description/AxisServiceImpl.java&r2=123165
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/description/AxisServiceImpl.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/description/AxisServiceImpl.java	Wed Dec 22 20:54:08 2004
@@ -40,6 +40,7 @@
         this.setComponentProperty(MODULEREF_KEY,new ArrayList());
         this.setComponentProperty(PARAMETER_KEY, new ParameterIncludeImpl());
         this.setComponentProperty(PHASES_KEY, new PhasesIncludeImpl());
+        this.serviceClassName = "";
     }
     /* (non-Javadoc)
      * @see org.apache.axis.description.AxisService#addModule(javax.xml.namespace.QName)

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/description/SimpleAxisServiceImpl.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/description/SimpleAxisServiceImpl.java?view=diff&rev=123165&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/description/SimpleAxisServiceImpl.java&r1=123164&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/description/SimpleAxisServiceImpl.java&r2=123165
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/description/SimpleAxisServiceImpl.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/description/SimpleAxisServiceImpl.java	Wed Dec 22 20:54:08 2004
@@ -60,6 +60,7 @@
         flowInclude = new FlowIncludeImpl();
         parameters = new ParameterIncludeImpl();
         phaseInclude = new PhasesIncludeImpl();
+        serviceClassName = "";
     }
 
     /**

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/phaseresolver/PhaseResolver.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/phaseresolver/PhaseResolver.java?view=diff&rev=123165&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/phaseresolver/PhaseResolver.java&r1=123164&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/phaseresolver/PhaseResolver.java&r2=123165
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/phaseresolver/PhaseResolver.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/phaseresolver/PhaseResolver.java	Wed Dec 22 20:54:08 2004
@@ -67,8 +67,8 @@
     private  void buildExcutionChains(int type) throws AxisFault, PhaseException {
         int flowtype =  type;
         Vector allHandlers = new Vector();
-        int count = server.getModuleCount();
-        QName moduleName;
+       // int count = server.getModuleCount();
+      //  QName moduleName;
         AxisModule module;
         Flow flow = null;
         /*
@@ -119,15 +119,16 @@
                     break;
                 }
             }
-            for(int j= 0 ; j < flow.getHandlerCount() ; j++ ){
-                HandlerMetaData metadata = flow.getHandler(j);
-                //todo change this in properway
-                if (metadata.getRules().getPhaseName().equals("") ){
-                    metadata.getRules().setPhaseName("service");
+            if(flow != null ){
+                for(int j= 0 ; j < flow.getHandlerCount() ; j++ ){
+                    HandlerMetaData metadata = flow.getHandler(j);
+                    //todo change this in properway
+                    if (metadata.getRules().getPhaseName().equals("") ){
+                        metadata.getRules().setPhaseName("service");
+                    }
+                    allHandlers.add(metadata);
                 }
-                allHandlers.add(metadata);
             }
-
         }
 
         switch (flowtype){
@@ -144,15 +145,16 @@
                 break;
             }
         }
-        for(int j= 0 ; j < flow.getHandlerCount() ; j++ ){
-            HandlerMetaData metadata = flow.getHandler(j);
-            //todo change this in properway
-            if (metadata.getRules().getPhaseName().equals("")){
-                metadata.getRules().setPhaseName("service");
+        if(flow != null ){
+            for(int j= 0 ; j < flow.getHandlerCount() ; j++ ){
+                HandlerMetaData metadata = flow.getHandler(j);
+                //todo change this in properway
+                if (metadata.getRules().getPhaseName().equals("")){
+                    metadata.getRules().setPhaseName("service");
+                }
+                allHandlers.add(metadata);
             }
-            allHandlers.add(metadata);
         }
-
         phaseHolder = new PhaseHolder(server,axisService);
 
         for (int i = 0; i < allHandlers.size(); i++) {
@@ -188,16 +190,17 @@
                         break;
                     }
                 }
-                for(int j= 0 ; j < flow.getHandlerCount() ; j++ ){
-                    HandlerMetaData metadata = flow.getHandler(j);
-                    //todo change this in properway
-                    if (metadata.getRules().getPhaseName().equals("")){
-                        metadata.getRules().setPhaseName("global");
-                    }
-                    phaseHolder.addHandler(metadata);
+                if(flow != null ){
+                    for(int j= 0 ; j < flow.getHandlerCount() ; j++ ){
+                        HandlerMetaData metadata = flow.getHandler(j);
+                        //todo change this in properway
+                        if (metadata.getRules().getPhaseName().equals("")){
+                            metadata.getRules().setPhaseName("global");
+                        }
+                        phaseHolder.addHandler(metadata);
 
+                    }
                 }
-
             }
             phaseHolder.buildGoblalChain(global, type);
         }

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/deployment/service1/META-INF/service.xml
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/deployment/service1/META-INF/service.xml?view=diff&rev=123165&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/deployment/service1/META-INF/service.xml&r1=123164&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/deployment/service1/META-INF/service.xml&r2=123165
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/deployment/service1/META-INF/service.xml	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/deployment/service1/META-INF/service.xml	Wed Dec 22 20:54:08 2004
@@ -1,5 +1,5 @@
-<service provider="xsd:anyprovider" style="xsd:anyURI" contextPath="xsd:anycontextPath" xmlns:java = "java">
-    <java:implementation class="Echo1"/>
+<service provider="xsd:anyprovider" style="xsd:anyURI" contextPath="xsd:anycontextPath" >
+    <java:implementation class="Echo1" xmlns:java="http://ws.apache.org/axis2/deployment/java"/>
 
     <!-- these are Service Parameters -->
     <parameter name="para1" locked="xsd:true">10</parameter>

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/deployment/service2/META-INF/service.xml
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/deployment/service2/META-INF/service.xml?view=diff&rev=123165&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/deployment/service2/META-INF/service.xml&r1=123164&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/deployment/service2/META-INF/service.xml&r2=123165
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/deployment/service2/META-INF/service.xml	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/deployment/service2/META-INF/service.xml	Wed Dec 22 20:54:08 2004
@@ -1,5 +1,5 @@
-<service provider="xsd:anyprovider" style="xsd:anyURI" contextPath="xsd:anycontextPath" xmlns:java = "java">
-    <java:implementation class="Echo1"/>
+<service provider="xsd:anyprovider" style="xsd:anyURI" contextPath="xsd:anycontextPath" >
+    <java:implementation class="Echo2" xmlns:java="http://ws.apache.org/axis2/deployment/java"/>
 
     <!-- these are Service Parameters -->
     <parameter name="para1" locked="xsd:true">10</parameter>

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/msg/echo/META-INF/service.xml
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/msg/echo/META-INF/service.xml?view=diff&rev=123165&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/msg/echo/META-INF/service.xml&r1=123164&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/msg/echo/META-INF/service.xml&r2=123165
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/msg/echo/META-INF/service.xml	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/msg/echo/META-INF/service.xml	Wed Dec 22 20:54:08 2004
@@ -1,7 +1,6 @@
-<service  style="xsd:msg" contextPath="axis/service/echo">
-	<java:implementation
-         provider="org.apache.axis.impl.providers.RawXMLProvider"
-         class="org.apache.axis.engine.Echo"
-         xmlns:java="http://ws.apache.org/axis2/deployment/java"/>
+<service provider="org.apache.axis.impl.providers.RawXMLProvider"  style="xsd:msg" contextPath="axis/service/echo">
+    <java:implementation
+        class="org.apache.axis.engine.Echo"
+        xmlns:java="http://ws.apache.org/axis2/deployment/java"/>
     <operation name="echo"/>
 </service>