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 2006/09/11 09:05:55 UTC

svn commit: r442115 - in /webservices/axis2/trunk/java/modules: integration/test/org/apache/axis2/integration/ kernel/src/org/apache/axis2/deployment/ kernel/src/org/apache/axis2/deployment/util/ saaj/test/org/apache/axis2/saaj/integration/

Author: deepal
Date: Mon Sep 11 00:05:54 2006
New Revision: 442115

URL: http://svn.apache.org/viewvc?view=rev&rev=442115
Log:
-moving buildService and buildService into DeploymentEngine

Modified:
    webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
    webservices/axis2/trunk/java/modules/saaj/test/org/apache/axis2/saaj/integration/UtilServer.java

Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java?view=diff&rev=442115&r1=442114&r2=442115
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java Mon Sep 11 00:05:54 2006
@@ -24,18 +24,11 @@
 import org.apache.axis2.context.ServiceContext;
 import org.apache.axis2.context.ServiceGroupContext;
 import org.apache.axis2.deployment.DeploymentEngine;
-import org.apache.axis2.deployment.DeploymentException;
-import org.apache.axis2.deployment.DeploymentConstants;
-import org.apache.axis2.deployment.util.Utils;
-import org.apache.axis2.deployment.repository.util.ArchiveFileData;
-import org.apache.axis2.deployment.repository.util.ArchiveReader;
 import org.apache.axis2.description.AxisModule;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.AxisServiceGroup;
 import org.apache.axis2.description.TransportInDescription;
-import org.apache.axis2.description.Flow;
 import org.apache.axis2.engine.ListenerManager;
-import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.transport.http.SimpleHTTPServer;
 
 import javax.xml.namespace.QName;
@@ -96,9 +89,7 @@
                         + TESTING_PORT + ".....");
             } catch (Exception e) {
                 e.printStackTrace();
-            } finally {
             }
-
         }
 
         try {
@@ -121,8 +112,8 @@
                 receiver.start();
                 System.out.print("Server started on port "
                         + TESTING_PORT + ".....");
-            } finally {
-
+            } catch (Exception e) {
+                throw new AxisFault(e);
             }
 
             try {
@@ -164,6 +155,7 @@
                 try {
                     Thread.sleep(1000);
                 } catch (InterruptedException e1) {
+                    //nothing to do here
                 }
             }
             count = 0;
@@ -185,13 +177,12 @@
 
     public static ServiceContext createAdressedEnabledClientSide(
             AxisService service) throws AxisFault {
-        DeploymentEngine deploymentEngine = new DeploymentEngine();
         File file = getAddressingMARFile();
         TestCase.assertTrue(file.exists());
         ConfigurationContext configContext = ConfigurationContextFactory
                 .createConfigurationContextFromFileSystem(
                         "target/test-resources/integrationRepo", null);
-        AxisModule axisModule = Utils.buildModule(file, deploymentEngine,
+        AxisModule axisModule = DeploymentEngine.buildModule(file,
                 configContext.getAxisConfiguration());
         configContext.getAxisConfiguration().addModule(axisModule);
 
@@ -219,33 +210,30 @@
     public static ConfigurationContext createClientConfigurationContext() throws AxisFault {
         File file = getAddressingMARFile();
         TestCase.assertTrue(file.exists());
-        DeploymentEngine deploymentEngine = new DeploymentEngine();
 
         ConfigurationContext configContext = ConfigurationContextFactory .createConfigurationContextFromFileSystem(
                 "target/test-resources/integrationRepo",
                 "target/test-resources/integrationRepo/conf/axis2.xml");
-        AxisModule axisModule = Utils.buildModule(file, deploymentEngine,
+        AxisModule axisModule = DeploymentEngine.buildModule(file,
                 configContext.getAxisConfiguration());
         configContext.getAxisConfiguration().addModule(axisModule);
         return configContext;
     }
 
     public static ConfigurationContext createClientConfigurationContext(String repo) throws AxisFault {
-        ConfigurationContext configContext = ConfigurationContextFactory .createConfigurationContextFromFileSystem(
+        return ConfigurationContextFactory .createConfigurationContextFromFileSystem(
                 repo,
                 repo + "/conf/axis2.xml");
-        return configContext;
     }
 
     public static ServiceContext createAdressedEnabledClientSide(
             AxisService service, String clientHome) throws AxisFault {
-        DeploymentEngine deploymentEngine = new DeploymentEngine();
         File file = getAddressingMARFile();
         TestCase.assertTrue(file.exists());
 
         ConfigurationContext configContext = ConfigurationContextFactory
                 .createConfigurationContextFromFileSystem(clientHome, null);
-        AxisModule axisModule = Utils.buildModule(file, deploymentEngine,
+        AxisModule axisModule = DeploymentEngine.buildModule(file,
                 configContext.getAxisConfiguration());
 
         configContext.getAxisConfiguration().addModule(axisModule);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java?view=diff&rev=442115&r1=442114&r2=442115
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentEngine.java Mon Sep 11 00:05:54 2006
@@ -907,4 +907,105 @@
     public void setConfigContext(ConfigurationContext configContext) {
         this.configContext = configContext;
     }
+
+    /**
+     * Builds ModuleDescription for a given module archive file. This does not
+     * called the init method since there is no refernce to configuration context
+     * so who ever create module usieng this has to called module.init if it is
+     * required
+     *
+     * @param modulearchive : Actual module archive file
+     * @param config        : AxisConfiguration : for get classs loders etc..
+     * @return
+     * @throws org.apache.axis2.deployment.DeploymentException
+     *
+     */
+    public static AxisModule buildModule(File modulearchive,
+                                         AxisConfiguration config)
+            throws DeploymentException {
+        AxisModule axismodule;
+        try {
+            ArchiveFileData currentArchiveFile = new ArchiveFileData(modulearchive,
+                    DeploymentConstants.TYPE_MODULE, false);
+            axismodule = new AxisModule();
+            ArchiveReader archiveReader = new ArchiveReader();
+
+            currentArchiveFile.setClassLoader(false, config.getModuleClassLoader());
+            axismodule.setModuleClassLoader(currentArchiveFile.getClassLoader());
+            archiveReader.readModuleArchive(currentArchiveFile, axismodule,
+                    false, config);
+            ClassLoader moduleClassLoader = axismodule.getModuleClassLoader();
+            Flow inflow = axismodule.getInFlow();
+
+            if (inflow != null) {
+                Utils.addFlowHandlers(inflow, moduleClassLoader);
+            }
+
+            Flow outFlow = axismodule.getOutFlow();
+
+            if (outFlow != null) {
+                Utils.addFlowHandlers(outFlow, moduleClassLoader);
+            }
+
+            Flow faultInFlow = axismodule.getFaultInFlow();
+
+            if (faultInFlow != null) {
+                Utils.addFlowHandlers(faultInFlow, moduleClassLoader);
+            }
+
+            Flow faultOutFlow = axismodule.getFaultOutFlow();
+
+            if (faultOutFlow != null) {
+                Utils.addFlowHandlers(faultOutFlow, moduleClassLoader);
+            }
+        } catch (AxisFault axisFault) {
+            throw new DeploymentException(axisFault);
+        }
+        return axismodule;
+    }
+
+    /**
+     * Fills an axisservice object using services.xml. First creates
+     * an axisservice object using WSDL and then fills it using the given services.xml.
+     * Loads all the required class and builds the chains, finally adds the
+     * servicecontext to EngineContext and axisservice into EngineConfiguration.
+     *
+     * @param serviceInputStream
+     * @param classLoader
+     * @return Returns AxisService.
+     * @throws DeploymentException
+     */
+    public static AxisService buildService(InputStream serviceInputStream,
+                                           ClassLoader classLoader,
+                                           AxisConfiguration axisConfig)
+            throws DeploymentException {
+        AxisService axisService = new AxisService();
+        try {
+
+            Parameter parahotupdate = axisConfig.getParameter(TAG_HOT_UPDATE);
+//        Parameter paraantiJARLocking = axisConfig.getParameter(TAG_ANTI_JAR_LOCKING);
+            boolean antiJARLocking = true;
+            if (parahotupdate != null) {
+                String value = (String) parahotupdate.getValue();
+
+                if ("false".equalsIgnoreCase(value)) {
+                    antiJARLocking = false;
+                }
+            }
+            ArchiveFileData currentArchiveFile = new ArchiveFileData(
+                    DeploymentConstants.TYPE_SERVICE, "", antiJARLocking);
+            currentArchiveFile.setClassLoader(classLoader);
+
+            ServiceBuilder builder = new ServiceBuilder(serviceInputStream, axisConfig,
+                    axisService);
+
+            builder.populateService(builder.buildOM());
+        } catch (AxisFault axisFault) {
+            throw new DeploymentException(axisFault);
+        } catch (XMLStreamException e) {
+            throw new DeploymentException(e);
+        }
+
+        return axisService;
+    }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java?view=diff&rev=442115&r1=442114&r2=442115
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java Mon Sep 11 00:05:54 2006
@@ -6,9 +6,7 @@
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.Constants;
 import org.apache.axis2.deployment.DeploymentConstants;
-import org.apache.axis2.deployment.DeploymentEngine;
 import org.apache.axis2.deployment.DeploymentException;
-import org.apache.axis2.deployment.ServiceBuilder;
 import org.apache.axis2.deployment.repository.util.ArchiveFileData;
 import org.apache.axis2.deployment.repository.util.ArchiveReader;
 import org.apache.axis2.description.*;
@@ -23,7 +21,6 @@
 import org.codehaus.jam.JMethod;
 
 import javax.xml.namespace.QName;
-import javax.xml.stream.XMLStreamException;
 import java.io.*;
 import java.lang.reflect.Method;
 import java.net.MalformedURLException;
@@ -428,93 +425,6 @@
         } catch (IOException e) {
             throw new AxisFault(e);
         }
-    }
-
-    /**
-     * Builds ModuleDescription for a given module archive file. This does not
-     * called the init method since there is no refernce to configuration context
-     * so who ever create module usieng this has to called module.init if it is
-     * required
-     *
-     * @param modulearchive : Actual module archive file
-     * @param config        : AxisConfiguration : for get classs loders etc..
-     * @return
-     * @throws org.apache.axis2.deployment.DeploymentException
-     *
-     */
-    public static AxisModule buildModule(File modulearchive, DeploymentEngine engine, AxisConfiguration config)
-            throws DeploymentException {
-        AxisModule axismodule;
-        try {
-            ArchiveFileData currentArchiveFile = new ArchiveFileData(modulearchive, DeploymentConstants.TYPE_MODULE, false);
-            axismodule = new AxisModule();
-            ArchiveReader archiveReader = new ArchiveReader();
-
-            currentArchiveFile.setClassLoader(false, config.getModuleClassLoader());
-            axismodule.setModuleClassLoader(currentArchiveFile.getClassLoader());
-            archiveReader.readModuleArchive(currentArchiveFile, axismodule,
-                    false, config);
-            ClassLoader moduleClassLoader = axismodule.getModuleClassLoader();
-            Flow inflow = axismodule.getInFlow();
-
-            if (inflow != null) {
-                Utils.addFlowHandlers(inflow, moduleClassLoader);
-            }
-
-            Flow outFlow = axismodule.getOutFlow();
-
-            if (outFlow != null) {
-                Utils.addFlowHandlers(outFlow, moduleClassLoader);
-            }
-
-            Flow faultInFlow = axismodule.getFaultInFlow();
-
-            if (faultInFlow != null) {
-                Utils.addFlowHandlers(faultInFlow, moduleClassLoader);
-            }
-
-            Flow faultOutFlow = axismodule.getFaultOutFlow();
-
-            if (faultOutFlow != null) {
-                Utils.addFlowHandlers(faultOutFlow, moduleClassLoader);
-            }
-        } catch (AxisFault axisFault) {
-            throw new DeploymentException(axisFault);
-        }
-        return axismodule;
-    }
-
-    /**
-     * Fills an axisservice object using services.xml. First creates
-     * an axisservice object using WSDL and then fills it using the given services.xml.
-     * Loads all the required class and builds the chains, finally adds the
-     * servicecontext to EngineContext and axisservice into EngineConfiguration.
-     *
-     * @param axisService
-     * @param serviceInputStream
-     * @param classLoader
-     * @return Returns AxisService.
-     * @throws DeploymentException
-     */
-    public AxisService buildService(AxisService axisService, InputStream serviceInputStream,
-                                    ClassLoader classLoader, AxisConfiguration axisConfig,
-                                    boolean antiJARLocking)
-            throws DeploymentException {
-        try {
-            ArchiveFileData currentArchiveFile = new ArchiveFileData(DeploymentConstants.TYPE_SERVICE, "", antiJARLocking);
-            currentArchiveFile.setClassLoader(classLoader);
-
-            ServiceBuilder builder = new ServiceBuilder(serviceInputStream, axisConfig,
-                    axisService);
-
-            builder.populateService(builder.buildOM());
-        } catch (AxisFault axisFault) {
-            throw new DeploymentException(axisFault);
-        } catch (XMLStreamException e) {
-            throw new DeploymentException(e);
-        }
-
-        return axisService;
     }
 
     public static String getPath(String parent, String childPath) {

Modified: webservices/axis2/trunk/java/modules/saaj/test/org/apache/axis2/saaj/integration/UtilServer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/saaj/test/org/apache/axis2/saaj/integration/UtilServer.java?view=diff&rev=442115&r1=442114&r2=442115
==============================================================================
--- webservices/axis2/trunk/java/modules/saaj/test/org/apache/axis2/saaj/integration/UtilServer.java (original)
+++ webservices/axis2/trunk/java/modules/saaj/test/org/apache/axis2/saaj/integration/UtilServer.java Mon Sep 11 00:05:54 2006
@@ -22,7 +22,6 @@
 import org.apache.axis2.context.ServiceContext;
 import org.apache.axis2.context.ServiceGroupContext;
 import org.apache.axis2.deployment.DeploymentEngine;
-import org.apache.axis2.deployment.util.Utils;
 import org.apache.axis2.description.AxisModule;
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.AxisServiceGroup;
@@ -133,13 +132,12 @@
 
     public static ServiceContext createAdressedEnabledClientSide(
             AxisService service) throws AxisFault {
-        DeploymentEngine deploymentEngine = new DeploymentEngine();
         File file = getAddressingMARFile();
         TestCase.assertTrue(file.exists());
 
         ConfigurationContext configContext = ConfigurationContextFactory
                 .createConfigurationContextFromFileSystem("target/test-resources/integrationRepo", null);
-        AxisModule axisModule = Utils.buildModule(file, deploymentEngine,
+        AxisModule axisModule = DeploymentEngine.buildModule(file,
                 configContext.getAxisConfiguration());
         configContext.getAxisConfiguration().addModule(axisModule);
 
@@ -152,10 +150,9 @@
     public static ConfigurationContext createClientConfigurationContext() throws AxisFault {
         File file = getAddressingMARFile();
         TestCase.assertTrue(file.exists());
-        DeploymentEngine deploymentEngine = new DeploymentEngine();
 
         ConfigurationContext configContext = ConfigurationContextFactory .createConfigurationContextFromFileSystem("target/test-resources/integrationRepo", null);
-        AxisModule axisModule = Utils.buildModule(file, deploymentEngine,
+        AxisModule axisModule = DeploymentEngine.buildModule(file,
                 configContext.getAxisConfiguration());
         configContext.getAxisConfiguration().addModule(axisModule);
         configContext.getAxisConfiguration().engageModule(new QName("addressing"));
@@ -164,13 +161,12 @@
 
     public static ServiceContext createAdressedEnabledClientSide(
             AxisService service, String clientHome) throws AxisFault {
-        DeploymentEngine deploymentEngine = new DeploymentEngine();
         File file = getAddressingMARFile();
         TestCase.assertTrue(file.exists());
 
         ConfigurationContext configContext = ConfigurationContextFactory
                 .createConfigurationContextFromFileSystem(clientHome, null);
-        AxisModule axisModule = Utils.buildModule(file, deploymentEngine,
+        AxisModule axisModule = DeploymentEngine.buildModule(file,
                 configContext.getAxisConfiguration());
 
         configContext.getAxisConfiguration().addModule(axisModule);



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