You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by de...@apache.org on 2005/05/16 07:07:45 UTC

svn commit: r170307 - /webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java

Author: deepal
Date: Sun May 15 22:07:44 2005
New Revision: 170307

URL: http://svn.apache.org/viewcvs?rev=170307&view=rev
Log:
provide a way to add a module proramatically

Modified:
    webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java

Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java?rev=170307&r1=170306&r2=170307&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java Sun May 15 22:07:44 2005
@@ -90,6 +90,12 @@
     private EngineContextFactory factory;
 
     /**
+     * Default constructor is need to deploye module and service programatically
+     */
+    public DeploymentEngine() {
+    }
+
+    /**
      * This the constructor which is used by Engine inorder to start
      * Deploymenat module,
      *
@@ -268,7 +274,7 @@
             }
         } catch (DeploymentException e) {
             throw new DeploymentException("Invalid System predefined inphases , phase order dose not" +
-                        " support\n recheck server.xml");
+                    " support\n recheck server.xml");
         }
         //  ArrayList outPhaes = tempdata.getOUTPhases();
         //TODO do the validation code here
@@ -576,5 +582,39 @@
         }
         return axisService;
     }
+
+    /**
+     * This method can be used to build ModuleDescription for a given module archiev file
+     * @param modulearchive
+     * @return
+     * @throws DeploymentException
+     */
+
+    public ModuleDescription buildModule(File modulearchive) throws DeploymentException {
+        ModuleDescription axismodule = null;
+        try {
+            currentArchiveFile = new ArchiveFileData(modulearchive, MODULE);
+            axismodule = new ModuleDescription();
+            ArchiveReader archiveReader = new ArchiveReader();
+            archiveReader.readModuleArchive(currentArchiveFile.getAbsolutePath(), this, axismodule);
+            currentArchiveFile.setClassLoader();
+            Flow inflow = axismodule.getInFlow();
+            addFlowHandlers(inflow);
+
+            Flow outFlow = axismodule.getOutFlow();
+            addFlowHandlers(outFlow);
+
+            Flow faultInFlow = axismodule.getFaultInFlow();
+            addFlowHandlers(faultInFlow);
+
+            Flow faultOutFlow = axismodule.getFaultOutFlow();
+            addFlowHandlers(faultOutFlow);
+            loadModuleClass(axismodule);
+        } catch (AxisFault axisFault) {
+            throw new DeploymentException(axisFault);
+        }
+        return axismodule;
+    }
+
 
 }