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/24 06:16:26 UTC

svn commit: r123275 - in webservices/axis/trunk/java/dev/scratch/prototype2/src: java/org/apache/axis/deployment java/org/apache/axis/deployment/repository/utill samples/deployment/service1/META-INF samples/deployment/service2/META-INF test/org/apache/axis/deployment

Author: deepal
Date: Thu Dec 23 21:16:24 2004
New Revision: 123275

URL: http://svn.apache.org/viewcvs?view=rev&rev=123275
Log:
added Service ClassLoader , Provider calss
Modified:
   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/HDFileItem.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/test/org/apache/axis/deployment/BuildERWithDeploymentTest.java
   webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/DeploymentotalTest.java

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=123275&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentEngine.java&r1=123274&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentEngine.java&r2=123275
==============================================================================
--- 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	Thu Dec 23 21:16:24 2004
@@ -13,6 +13,7 @@
 import org.apache.axis.engine.AxisFault;
 import org.apache.axis.engine.EngineRegistry;
 import org.apache.axis.engine.Handler;
+import org.apache.axis.engine.Provider;
 import org.apache.axis.impl.description.AxisService;
 import org.apache.axis.impl.engine.EngineRegistryImpl;
 import org.apache.axis.phaseresolver.PhaseException;
@@ -251,8 +252,14 @@
                 }
                 urlsToLoadFrom = new URL[]{file.toURL()};
                 loader1 = new URLClassLoader(urlsToLoadFrom, parent);
+                service.setClassLoader(loader1);
                 if(! currentFileItem.getClassName().equals("")){
                     serviceclass = Class.forName(currentFileItem.getClassName(), true, loader1);
+                }
+                service.setServiceClass(serviceclass);
+                if(! currentFileItem.getProvideName().equals("")){
+                    Class provider =Class.forName(currentFileItem.getProvideName(), true, loader1);
+                    service.setProvider((Provider)provider.newInstance());
                 }
                 service.setServiceClass(serviceclass);
             } catch (MalformedURLException e) {

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=123275&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentParser.java&r1=123274&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/DeploymentParser.java&r2=123275
==============================================================================
--- 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	Thu Dec 23 21:16:24 2004
@@ -2,6 +2,7 @@
 
 import org.apache.axis.description.*;
 import org.apache.axis.engine.AxisFault;
+import org.apache.axis.engine.Provider;
 import org.apache.axis.impl.description.AxisService;
 import org.apache.axis.impl.description.FlowImpl;
 import org.apache.axis.impl.description.ParameterImpl;
@@ -169,9 +170,10 @@
                 if (attname.equals(PROVIDERNAME)) {
                     //TODO load the java clss for this
                     //TODO  somtimes Provider should be change
-                    SimpleJavaProvider provider = new SimpleJavaProvider();
-                    provider.setName(new QName(getValue(attvalue)));
-                    axisService.setProvider(provider);
+                    dpengine.getCurrentFileItem().setProvideName(attvalue);
+                  //  Provider provider = new SimpleJavaProvider();
+                   // provider. .setName(new QName(getValue(attvalue)));
+                   // axisService.setProvider(provider);
                 } else if (attname.equals(STYLENAME)) {
                     // axisService.setStyle();
                     //TODO setStyle should be handle latter

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/HDFileItem.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/HDFileItem.java?view=diff&rev=123275&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/HDFileItem.java&r1=123274&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/HDFileItem.java&r2=123275
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/HDFileItem.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/deployment/repository/utill/HDFileItem.java	Thu Dec 23 21:16:24 2004
@@ -27,6 +27,7 @@
     private File file;
     private int type;
     private String className;
+    private String provideName;
 
     public String getClassName() {
         return className;
@@ -34,6 +35,14 @@
 
     public void setClassName(String className) {
         this.className = className;
+    }
+
+    public String getProvideName() {
+        return provideName;
+    }
+
+    public void setProvideName(String provideName) {
+        this.provideName = provideName;
     }
 
     public HDFileItem(File file, int 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=123275&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/deployment/service1/META-INF/service.xml&r1=123274&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/deployment/service1/META-INF/service.xml&r2=123275
==============================================================================
--- 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	Thu Dec 23 21:16:24 2004
@@ -1,4 +1,4 @@
-<service provider="xsd:anyprovider" style="xsd:anyURI" contextPath="xsd:anycontextPath" >
+<service provider="org.apache.axis.impl.providers.RawXMLProvider" style="xsd:anyURI" contextPath="xsd:anycontextPath" >
     <java:implementation class="Echo1" xmlns:java="http://ws.apache.org/axis2/deployment/java"/>
 
     <!-- these are Service Parameters -->

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=123275&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/deployment/service2/META-INF/service.xml&r1=123274&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/deployment/service2/META-INF/service.xml&r2=123275
==============================================================================
--- 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	Thu Dec 23 21:16:24 2004
@@ -1,4 +1,4 @@
-<service provider="xsd:anyprovider" style="xsd:anyURI" contextPath="xsd:anycontextPath" >
+<service provider="org.apache.axis.impl.providers.RawXMLProvider" style="xsd:anyURI" contextPath="xsd:anycontextPath" >
     <java:implementation class="Echo2" xmlns:java="http://ws.apache.org/axis2/deployment/java"/>
 
     <!-- these are Service Parameters -->

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BuildERWithDeploymentTest.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BuildERWithDeploymentTest.java?view=diff&rev=123275&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BuildERWithDeploymentTest.java&r1=123274&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BuildERWithDeploymentTest.java&r2=123275
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BuildERWithDeploymentTest.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BuildERWithDeploymentTest.java	Thu Dec 23 21:16:24 2004
@@ -1,18 +1,18 @@
 /*
- * Copyright 2003,2004 The Apache Software Foundation.
- * 
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2003,2004 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 package org.apache.axis.deployment;
 
 import javax.xml.namespace.QName;
@@ -34,33 +34,37 @@
         super(testName);
     }
 
-    public void testDeployment() throws Exception{
-        String filename = "./target/test-resources/deployment" ;
-        DeploymentEngine deploymentEngine = new DeploymentEngine(filename);
-        EngineRegistry er = deploymentEngine.start();
-        assertNotNull(er);
-        assertNotNull(er.getGlobal());
-        
-        AxisService service = er.getService(new QName("echo"));
-        assertNotNull(service);
-        Provider provider = service.getProvider();
-        assertNotNull(provider);
-        assertTrue(provider instanceof RawXMLProvider);
-        ClassLoader cl = service.getClassLoader();
-        assertNotNull(cl);
-        Class.forName("org.apache.axis.engine.Echo",true,cl);
-        assertNotNull(service.getName());
-        assertEquals(service.getContextPath(),"axis/service/echo");
-        
-        Flow flow = service.getFaultFlow();
-        assertTrue(flow == null || flow.getHandlerCount() == 0);
-        flow = service.getInFlow();
-        assertTrue(flow == null || flow.getHandlerCount() == 0);
-        flow = service.getOutFlow();
-        assertTrue(flow == null || flow.getHandlerCount() == 0);
-        assertNull(service.getParameter("hello"));
-        
-        AxisOperation op = service.getOperation(new QName("echo"));
-        assertNotNull(op);
+    public void testDeployment(){
+        try{
+            String filename = "./target/test-resources/deployment" ;
+            DeploymentEngine deploymentEngine = new DeploymentEngine(filename);
+            EngineRegistry er = deploymentEngine.start();
+            assertNotNull(er);
+            assertNotNull(er.getGlobal());
+
+            AxisService service = er.getService(new QName("echo"));
+            assertNotNull(service);
+            Provider provider = service.getProvider();
+            assertNotNull(provider);
+            assertTrue(provider instanceof RawXMLProvider);
+            ClassLoader cl = service.getClassLoader();
+            assertNotNull(cl);
+            Class.forName("org.apache.axis.engine.Echo",true,cl);
+            assertNotNull(service.getName());
+            assertEquals(service.getContextPath(),"axis/service/echo");
+
+            Flow flow = service.getFaultFlow();
+            assertTrue(flow == null || flow.getHandlerCount() == 0);
+            flow = service.getInFlow();
+            assertTrue(flow == null || flow.getHandlerCount() == 0);
+            flow = service.getOutFlow();
+            assertTrue(flow == null || flow.getHandlerCount() == 0);
+            assertNull(service.getParameter("hello"));
+
+            AxisOperation op = service.getOperation(new QName("echo"));
+            assertNotNull(op);
+        }catch (Exception e){
+            e.printStackTrace();
+        }
     }
 }

Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/DeploymentotalTest.java
Url: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/DeploymentotalTest.java?view=diff&rev=123275&p1=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/DeploymentotalTest.java&r1=123274&p2=webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/DeploymentotalTest.java&r2=123275
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/DeploymentotalTest.java	(original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/DeploymentotalTest.java	Thu Dec 23 21:16:24 2004
@@ -29,11 +29,11 @@
         String filename = "./target/test-resources/deployment" ;
         DeploymentEngine deploymentEngine = new DeploymentEngine(filename);
         er = deploymentEngine.start();
-       try {
-            Thread.sleep(11000);
-        } catch (InterruptedException e) {
-            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
-        }
+//       try {
+//            Thread.sleep(11000);
+//        } catch (InterruptedException e) {
+//            e.printStackTrace();  //To change body of catch statement use File | Settings | File Templates.
+//        }
     }
 
 }