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 gd...@apache.org on 2007/04/25 19:50:50 UTC

svn commit: r532422 [1/2] - in /webservices/axis2/trunk/java/modules/kernel: src/org/apache/axis2/context/ src/org/apache/axis2/deployment/ src/org/apache/axis2/deployment/repository/util/ src/org/apache/axis2/deployment/util/ src/org/apache/axis2/desc...

Author: gdaniels
Date: Wed Apr 25 10:50:48 2007
New Revision: 532422

URL: http://svn.apache.org/viewvc?view=rev&rev=532422
Log:
* Refactor deployment a bit to clean things up and get custom deployers actually working.  Get rid of a bunch of code that looked at (via string compares) the "type" field in order to decide what to do, and instead use polymorphism to do deployment.  Essentially this means we figure out which Deployer to use early on for DeploymentFileData/WSInfo, and store that away.  Then we can just call fileData.deploy() and it does the right thing.  Also notice how this simplifies WSInfoList.addWSInfoItem().

* Add a custom Deployer test  

* Refactor DispatchPhase to do the work of InstanceDispatcher, to avoid a separate Handler which has confusing deployment characteristics.  Now at the end of the Dispatch phase, all the contexts and metadata are set up, instead of doing it afterwards in a separate place.  Will remove InstanceDispatcher next.

* Add convenience method addParameter(String, Object) to AxisDescription

* The usual general fixing up of code, spelling, JavaDoc, etc

TODO - This needs a little more cleanup and I'd like to merge WSInfo and DeploymentFileData into a single structure if possible to simplify further

TODO - Consider whether to make Deployers stateless/singletons?

TODO - Remove InstanceDispatcher

Added:
    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/
    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/axis2.xml
    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/
    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/george.svc
    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/
    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/mary.svc
    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/CustomDeployerTest.java
    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/deployers/
    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/deployers/CustomDeployer.java
Modified:
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/Deployer.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.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/DescriptionBuilder.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DispatchPhase.java
    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties
    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/DeploymentTotalTest.java

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java?view=diff&rev=532422&r1=532421&r2=532422
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java Wed Apr 25 10:50:48 2007
@@ -165,13 +165,17 @@
      * @param axis2xml : location of the axis2.xml (configuration) , you can not give
      *                 axis2xml relative to repository.
      * @return Returns the built ConfigurationContext.
-     * @throws DeploymentException
+     * @throws AxisFault in case of problems
      */
     public static ConfigurationContext createConfigurationContextFromFileSystem(
             String path,
             String axis2xml) throws AxisFault {
-    	
         return createConfigurationContext(new FileSystemConfigurator(path, axis2xml));
+    }
+
+    public static ConfigurationContext createConfigurationContextFromFileSystem(String path)
+            throws AxisFault {
+        return createConfigurationContextFromFileSystem(path, null);
     }
 
     public static ConfigurationContext createConfigurationContextFromURIs(

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java?view=diff&rev=532422&r1=532421&r2=532422
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java Wed Apr 25 10:50:48 2007
@@ -248,28 +248,29 @@
         while (deployerItr.hasNext()) {
             OMElement element = (OMElement) deployerItr.next();
             String directory = element.getAttributeValue(new QName(DIRECTORY));
-            if (directory != null) {
-                String extension = element.getAttributeValue(new QName(EXTENSION));
-                if (extension != null) {
-                    try {
-                        String deployerValue = element.getAttributeValue(new QName(TAG_CLASS_NAME));
-                        Class deployerClass;
-                        deployerClass = Loader.loadClass(deployerValue);
-                        Deployer deployer =
-                                (Deployer) deployerClass.newInstance();
-                        deployer.setDirectory(directory);
-                        deployer.setExtension(extension);
-                        directoryToExtensionMappingMap.put(directory, extension);
-                        extensionToDeployerMappingMap.put(extension, deployer);
-                    } catch (ClassNotFoundException e) {
-                        log.error(e);
-                    } catch (InstantiationException e) {
-                        log.error(e);
-                    } catch (IllegalAccessException e) {
-                        log.error(e);
-                    }
-                }
+            if (directory == null) {
+                log.error("Deployer missing 'directory' attribute : " + element.toString());
+            }
+
+            String extension = element.getAttributeValue(new QName(EXTENSION));
+            if (extension == null) {
+                log.error("Deployer missing 'extension' attribute : " + element.toString());
+                return;
+            }
+            String deployerClassName = element.getAttributeValue(new QName(TAG_CLASS_NAME));
+            Deployer deployer;
+            try {
+                Class deployerClass = Loader.loadClass(deployerClassName);
+                deployer = (Deployer) deployerClass.newInstance();
+            } catch (Exception e) {
+                log.error(e);
+                return;
             }
+            deployer.setDirectory(directory);
+            deployer.setExtension(extension);
+            if (directory != null)
+                directoryToExtensionMappingMap.put(directory, extension);
+            extensionToDeployerMappingMap.put(extension, deployer);
         }
         if (deploymentEngine != null) {
             deploymentEngine.setDirectoryToExtensionMappingMap(directoryToExtensionMappingMap);
@@ -384,7 +385,7 @@
 
             while (handlers.hasNext()) {
                 OMElement omElement = (OMElement) handlers.next();
-                HandlerDescription handler = processHandler(omElement, axisConfig);
+                HandlerDescription handler = processHandler(omElement, axisConfig, phaseName);
 
                 handler.getRules().setPhaseName(phaseName);
                 Utils.loadHandler(axisConfig.getSystemClassLoader(), handler);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/Deployer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/Deployer.java?view=diff&rev=532422&r1=532421&r2=532422
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/Deployer.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/Deployer.java Wed Apr 25 10:50:48 2007
@@ -27,15 +27,36 @@
  * a service or a module.
  */
 public interface Deployer {
-    //To initialize the deployer
+    /**
+     * Initialize the Deployer
+     * @param configCtx our ConfigurationContext
+     */
     void init(ConfigurationContext configCtx);
 
-    //Will process the file and add that to axisConfig
+    /**
+     * Process a file and add it to the configuration
+     * @param deploymentFileData the DeploymentFileData object to deploy
+     * @throws DeploymentException if there is a problem
+     */
     void deploy(DeploymentFileData deploymentFileData) throws DeploymentException;
 
+    /**
+     * Set the directory
+     * @param directory directory name
+     */
     void setDirectory(String directory);
 
+    /**
+     * Set the extension to look for
+     * TODO: Support multiple extensions?
+     * @param extension the file extension associated with this Deployer
+     */
     void setExtension(String extension);
 
+    /**
+     * Remove a given file from the configuration
+     * @param fileName name of item to remove
+     * @throws DeploymentException if there is a problem
+     */
     void unDeploy(String fileName) throws DeploymentException;
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java?view=diff&rev=532422&r1=532421&r2=532422
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java Wed Apr 25 10:50:48 2007
@@ -31,10 +31,6 @@
     public static String MODULE_PATH = "modules";
     public static String MODULE_DRI_PATH = "ModulesDirectory";
 
-    String TYPE_SERVICE = "service";                // is it a service
-    String TYPE_DEFAULT = "none";                // is it a service
-    String TYPE_MODULE = "module";                // is it a module
-
     String TAG_AXISCONFIG = "axisconfig";
     String TAG_PHASE_ORDER = "phaseOrder";
     String TAG_PHASE = "phase";

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=532422&r1=532421&r2=532422
==============================================================================
--- 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 Wed Apr 25 10:50:48 2007
@@ -94,6 +94,7 @@
     protected String modulesPath = null;
     protected File modulesDir = null;
     private File repositoryDir = null;
+
     //to deploy service (both aar and expanded)
     protected ServiceDeployer serviceDeployer;
     //To deploy modules (both mar and expanded)
@@ -235,10 +236,10 @@
 
     private void populateModule(AxisModule module, URL moduleUrl) throws DeploymentException {
         try {
-            ClassLoader classLoadere = module.getModuleClassLoader();
-            InputStream moduleStream = classLoadere.getResourceAsStream("META-INF/module.xml");
+            ClassLoader classLoader = module.getModuleClassLoader();
+            InputStream moduleStream = classLoader.getResourceAsStream("META-INF/module.xml");
             if (moduleStream == null) {
-                moduleStream = classLoadere.getResourceAsStream("meta-inf/module.xml");
+                moduleStream = classLoader.getResourceAsStream("meta-inf/module.xml");
             }
             if (moduleStream == null) {
                 throw new DeploymentException(
@@ -571,27 +572,13 @@
         try {
             if (wsToDeploy.size() > 0) {
                 for (int i = 0; i < wsToDeploy.size(); i++) {
-                    DeploymentFileData currentDeploymentFile = (DeploymentFileData) wsToDeploy.get(i);
-                    String type = currentDeploymentFile.getType();
-                    if (TYPE_SERVICE.equals(type)) {
-                        try {
-                            serviceDeployer.deploy(currentDeploymentFile);
-                        } catch (DeploymentException e) {
-                            log.debug(e);
-                        }
-                    } else if (TYPE_MODULE.equals(type)) {
-                        moduleDeployer.deploy(currentDeploymentFile);
-                    } else {
-                        Deployer deployer = (Deployer) extensionToDeployerMappingMap.get(type);
-                        if (deployer != null) {
-                            try {
-                                deployer.deploy(currentDeploymentFile);
-                            } catch (DeploymentException e) {
-                                log.debug(e);
-                            }
-                        }
+                    DeploymentFileData fileToDeploy = (DeploymentFileData) wsToDeploy.get(i);
+                    try {
+                        fileToDeploy.deploy();
+                    } catch (DeploymentException e) {
+                        // TODO : This probably isn't sufficient.  Maybe provide an option to stop?
+                        log.info(e);
                     }
-
                 }
             }
         } finally {
@@ -629,6 +616,7 @@
      *
      * @param in : InputStream to axis2.xml
      * @throws DeploymentException : If something goes wrong
+     * @return a populated AxisConfiguration
      */
     public AxisConfiguration populateAxisConfiguration(InputStream in) throws DeploymentException {
         axisConfig = new AxisConfiguration();
@@ -661,8 +649,7 @@
             if (wsToUnDeploy.size() > 0) {
                 for (int i = 0; i < wsToUnDeploy.size(); i++) {
                     WSInfo wsInfo = (WSInfo) wsToUnDeploy.get(i);
-                    String fileType = wsInfo.getType();
-                    if (TYPE_SERVICE.equals(fileType)) {
+                    if (wsInfo.getType() == WSInfo.TYPE_SERVICE) {
                         if (isHotUpdate()) {
                             serviceDeployer.unDeploy(wsInfo.getFileName());
                         } else {
@@ -670,8 +657,7 @@
                         }
                     } else {
                         if (isHotUpdate()) {
-                            Deployer deployer =
-                                    (Deployer) extensionToDeployerMappingMap.get(fileType);
+                            Deployer deployer = wsInfo.getDeployer();
                             if (deployer != null) {
                                 deployer.unDeploy(wsInfo.getFileName());
                             }
@@ -698,7 +684,7 @@
      * Retrieves service name from the archive file name.
      * If the archive file name is service1.aar , then axis2 service name would be service1
      *
-     * @param fileName
+     * @param fileName the archive file name
      * @return Returns String.
      */
     public static String getAxisServiceName(String fileName) {
@@ -741,7 +727,7 @@
      * SCL  : Service class loader
      *
      * @param axis2repoURI : The repository folder of Axis2
-     * @throws DeploymentException
+     * @throws DeploymentException if there's a problem
      */
     protected void setClassLoaders(String axis2repoURI) throws DeploymentException {
         ClassLoader sysClassLoader =
@@ -794,7 +780,7 @@
     /**
      * Creates directories for modules/services, copies configuration xml from class loader if necessary
      *
-     * @param repositoryName
+     * @param repositoryName the pathname of the repository
      */
 
     protected void prepareRepository(String repositoryName) {
@@ -884,23 +870,31 @@
     }
 
     /**
-     * Builds ModuleDescription for a given module archive file. This does not
+     * Builds an AxisModule for a given module archive file. This does not
      * called the init method since there is no reference to configuration context
      * so who ever create module using this has to called module.init if it is
      * required
      *
      * @param modulearchive : Actual module archive file
      * @param config        : AxisConfiguration : for get classloaders etc..
-     * @throws org.apache.axis2.deployment.DeploymentException
+     * @throws org.apache.axis2.deployment.DeploymentException if there's a problem
      *
+     * @return a complete AxisModule read from the file.
      */
     public static AxisModule buildModule(File modulearchive,
                                          AxisConfiguration config)
             throws DeploymentException {
+        final String MODULE_DEPLOYER = "moduleDeployer";
         AxisModule axismodule;
+        ModuleDeployer deployer = (ModuleDeployer)config.getParameterValue(MODULE_DEPLOYER);
         try {
+            if (deployer == null) {
+                deployer = new ModuleDeployer(config);
+                config.addParameter(MODULE_DEPLOYER, deployer);
+            }
+
             DeploymentFileData currentDeploymentFile = new DeploymentFileData(modulearchive,
-                                                                              DeploymentConstants.TYPE_MODULE);
+                                                                              deployer);
             axismodule = new AxisModule();
             ArchiveReader archiveReader = new ArchiveReader();
 
@@ -944,24 +938,17 @@
      * Loads all the required class and builds the chains, finally adds the
      * servicecontext to EngineContext and axisservice into EngineConfiguration.
      *
-     * @param serviceInputStream
-     * @param classLoader
+     * @param serviceInputStream InputStream containing configuration data
+     * @param configCtx the ConfigurationContext in which we're deploying
      * @return Returns AxisService.
-     * @throws DeploymentException
+     * @throws DeploymentException if there's a problem
      */
     public static AxisService buildService(InputStream serviceInputStream,
-                                           ClassLoader classLoader,
                                            ConfigurationContext configCtx)
             throws DeploymentException {
         AxisService axisService = new AxisService();
         try {
-            DeploymentFileData currentDeploymentFile = new DeploymentFileData(
-                    DeploymentConstants.TYPE_SERVICE, "");
-            currentDeploymentFile.setClassLoader(classLoader);
-
-            ServiceBuilder builder = new ServiceBuilder(serviceInputStream, configCtx,
-                                                        axisService);
-
+            ServiceBuilder builder = new ServiceBuilder(serviceInputStream, configCtx, axisService);
             builder.populateService(builder.buildOM());
         } catch (AxisFault axisFault) {
             throw new DeploymentException(axisFault);
@@ -976,10 +963,14 @@
      * To build a AxisServiceGroup for a given services.xml
      * You have to add the created group into AxisConfig
      *
-     * @param servicesxml      : inpupstream create using services.xml
-     * @param classLoader      : corresponding class loader to load the class
-     * @param serviceGroupName : name of the service group
-     * @throws AxisFault
+     * @param servicesxml InputStream created from services.xml or equivalent
+     * @param classLoader ClassLoader to use
+     * @param serviceGroupName name of the service group
+     * @param configCtx the ConfigurationContext in which we're deploying
+     * @param archiveReader the ArchiveReader we're working with
+     * @param wsdlServices Map of existing WSDL services
+     * @throws AxisFault if there's a problem
+     * @return a fleshed-out AxisServiceGroup
      */
     public static AxisServiceGroup buildServiceGroup(InputStream servicesxml,
                                                      ClassLoader classLoader,
@@ -987,8 +978,7 @@
                                                      ConfigurationContext configCtx,
                                                      ArchiveReader archiveReader,
                                                      HashMap wsdlServices) throws AxisFault {
-        DeploymentFileData currentDeploymentFile = new DeploymentFileData(
-                DeploymentConstants.TYPE_SERVICE, "");
+        DeploymentFileData currentDeploymentFile = new DeploymentFileData(null, null);
         currentDeploymentFile.setClassLoader(classLoader);
         AxisServiceGroup serviceGroup = new AxisServiceGroup();
         serviceGroup.setServiceGroupClassLoader(classLoader);
@@ -1034,5 +1024,18 @@
 
     public RepositoryListener getRepoListener() {
         return repoListener;
+    }
+
+
+    public ServiceDeployer getServiceDeployer() {
+        return serviceDeployer;
+    }
+
+    public ModuleDeployer getModuleDeployer() {
+        return moduleDeployer;
+    }
+
+    public Deployer getDeployerForExtension(String extension) {
+        return (Deployer)extensionToDeployerMappingMap.get(extension);
     }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java?view=diff&rev=532422&r1=532421&r2=532422
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java Wed Apr 25 10:50:48 2007
@@ -219,8 +219,7 @@
                 .getChildrenWithName(new QName(TAG_MESSAGE_BUILDER));
         while (msgBuilders.hasNext()) {
             OMElement msgBuilderElement = (OMElement) msgBuilders.next();
-            OMElement tempMsgBuilder = msgBuilderElement;
-            OMAttribute builderName = tempMsgBuilder.getAttribute(new QName(TAG_CLASS_NAME));
+            OMAttribute builderName = msgBuilderElement.getAttribute(new QName(TAG_CLASS_NAME));
             String className = builderName.getAttributeValue();
             Class builderClass = null;
             Builder builderObject;
@@ -397,7 +396,7 @@
 
         if (name_attribute == null) {
             throw new DeploymentException(Messages.getMessage(
-                    DeploymentErrorMsgs.INVALID_HANDLER, "Name missing"));
+                    DeploymentErrorMsgs.INVALID_HANDLER, "Unknown", "Name missing"));
         } else {
             handler.setName(name_attribute.getAttributeValue());
         }
@@ -408,7 +407,7 @@
 
         if (class_attribute == null) {
             throw new DeploymentException((Messages.getMessage(
-                    DeploymentErrorMsgs.INVALID_HANDLER,
+                    DeploymentErrorMsgs.INVALID_HANDLER, name_attribute.getAttributeValue(),
                     "class name is missing")));
         } else {
             handler.setClassName(class_attribute.getAttributeValue());
@@ -423,7 +422,7 @@
             if (containingPhase == null) {
                 // TODO : Include more information (which handler?) in message!
                 throw new DeploymentException((Messages.getMessage(
-                        DeploymentErrorMsgs.INVALID_HANDLER,
+                        DeploymentErrorMsgs.INVALID_HANDLER, name_attribute.getAttributeValue(),
                         "phase rule has not been specified")));
             }
             rules.setPhaseName(containingPhase);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java?view=diff&rev=532422&r1=532421&r2=532422
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java Wed Apr 25 10:50:48 2007
@@ -67,15 +67,19 @@
                         repoLocation + "'");
             }
         }
+
         // Deal with the config file.  If a filename was specified as an
         // arg to this constructor, just respect it.
         if (axis2xml == null) {
             // If not, check for a system property setting
             axis2xml = System.getProperty(Constants.AXIS2_CONF);
 
-            // And if not that, try at the root of the repository
+            // And if not that, try at the root of the repository if we have one.
+            // It might be nice to default the repository to the current directory, but we don't yet
             if (axis2xml == null) {
-                axis2xml = repoLocation + File.separator + Constants.AXIS2_CONF;
+                if (repoLocation != null) {
+                    axis2xml = repoLocation + File.separator + Constants.AXIS2_CONF;
+                }
             }
 
             // In either case, check that the file exists... if not
@@ -99,15 +103,15 @@
      * @throws AxisFault
      */
     public synchronized AxisConfiguration getAxisConfiguration() throws AxisFault {
-        InputStream axis2xmlSream;
+        InputStream configStream;
         try {
             if (axis2xml != null && !"".equals(axis2xml)) {
-                axis2xmlSream = new FileInputStream(axis2xml);
+                configStream = new FileInputStream(axis2xml);
             } else {
-                axis2xmlSream =
+                configStream =
                         Loader.getResourceAsStream(DeploymentConstants.AXIS2_CONFIGURATION_RESOURCE);
             }
-            axisConfig = populateAxisConfiguration(axis2xmlSream);
+            axisConfig = populateAxisConfiguration(configStream);
         } catch (FileNotFoundException e) {
             throw new AxisFault("System can not find the given axis2.xml " + axis2xml);
         }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java?view=diff&rev=532422&r1=532421&r2=532422
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java Wed Apr 25 10:50:48 2007
@@ -64,7 +64,7 @@
         ClassLoader threadClassLoader = null;
         try {
             threadClassLoader = Thread.currentThread().getContextClassLoader();
-            String extension = deploymentFileData.getType();
+            String extension = DeploymentFileData.getFileExtension(deploymentFileData.getName());
             if (".class".equals(extension)) {
                 File file = deploymentFileData.getFile();
                 if (file != null) {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java?view=diff&rev=532422&r1=532421&r2=532422
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java Wed Apr 25 10:50:48 2007
@@ -49,9 +49,8 @@
      * then creates a WSInfoList to store information about available modules and services.
      *
      * @param deploymentEngine reference to engine registry for updates
+     * @param isClasspath true if this RepositoryListener should scan the classpath for Modules
      */
-
-    //The constructor , which loads modules from class path
     public RepositoryListener(DeploymentEngine deploymentEngine, boolean isClasspath) {
         this.deploymentEngine = deploymentEngine;
         wsInfoList = new WSInfoList(deploymentEngine);
@@ -78,11 +77,11 @@
                 }
                 if (!file.isDirectory()) {
                     if (DeploymentFileData.isModuleArchiveFile(file.getName())) {
-                        wsInfoList.addWSInfoItem(file, TYPE_MODULE);
+                        addFileToDeploy(file, deploymentEngine.getModuleDeployer());
                     }
                 } else {
                     if (!"lib".equalsIgnoreCase(file.getName())) {
-                        wsInfoList.addWSInfoItem(file, TYPE_MODULE);
+                        addFileToDeploy(file, deploymentEngine.getModuleDeployer());
                     }
                 }
             }
@@ -119,7 +118,7 @@
                 if (!file.isDirectory()) {
                     if (DeploymentFileData.isModuleArchiveFile(file.getName())) {
                         //adding modules in the class path
-                        wsInfoList.addWSInfoItem(file, TYPE_MODULE);
+                        addFileToDeploy(file, deploymentEngine.getModuleDeployer());
                     }
                 }
             }
@@ -144,7 +143,7 @@
                     if (file.isFile()) {
                         if (DeploymentFileData.isModuleArchiveFile(file.getName())) {
                             //adding modules in the class path
-                            wsInfoList.addWSInfoItem(file, TYPE_MODULE);
+                            addFileToDeploy(file, deploymentEngine.getModuleDeployer());
                         }
                     }
                 }
@@ -214,18 +213,20 @@
 
     private void findFileForGivenDirectory(String dir, String extension) {
         try {
-            File fileTobeSearch = new File(deploymentEngine.getRepositoryDir(), dir);
-            if (fileTobeSearch.exists()) {
-                File[] files = fileTobeSearch.listFiles();
+            File directory = new File(deploymentEngine.getRepositoryDir(), dir);
+            if (directory.exists()) {
+                File[] files = directory.listFiles();
                 if (files != null && files.length > 0) {
                     for (int i = 0; i < files.length; i++) {
                         File file = files[i];
                         if (isSourceControlDir(file)) {
                             continue;
                         }
-                        if (!file.isDirectory() && DeploymentFileData.getFileExtension(
-                                file.getName()).equals(extension)) {
-                            wsInfoList.addWSInfoItem(file, extension);
+                        // TODO: Should this allow expanded directories like services/modules do?
+                        if (!file.isDirectory() && extension.equals(
+                                DeploymentFileData.getFileExtension(file.getName()))) {
+                            addFileToDeploy(file,
+                                            deploymentEngine.getDeployerForExtension(extension));
                         }
                     }
                 }
@@ -248,16 +249,23 @@
                 }
                 if (!file.isDirectory()) {
                     if (DeploymentFileData.isServiceArchiveFile(file.getName())) {
-                        wsInfoList.addWSInfoItem(file, TYPE_SERVICE);
+                        addFileToDeploy(file, deploymentEngine.getServiceDeployer());
+                    } else {
+                        String ext = DeploymentFileData.getFileExtension(file.getName());
+                        Deployer deployer = deploymentEngine.getDeployerForExtension(ext);
+                        // If we found a deployer for this type of file, use it.  Otherwise
+                        // ignore the file.
+                        if (deployer != null) {
+                            addFileToDeploy(file, deployer);
+                        }
                     }
                 } else {
                     if (!"lib".equalsIgnoreCase(file.getName())) {
-                        wsInfoList.addWSInfoItem(file, TYPE_SERVICE);
+                        addFileToDeploy(file, deploymentEngine.getServiceDeployer());
                     }
                 }
             }
         }
-        wsInfoList.addWSInfoItem(null, TYPE_DEFAULT);
     }
 
     /** Method invoked from the scheduler to start the listener. */
@@ -277,4 +285,7 @@
         update();
     }
 
+    public void addFileToDeploy(File file, Deployer deployer) {
+        wsInfoList.addWSInfoItem(file, deployer);
+    }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java?view=diff&rev=532422&r1=532421&r2=532422
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java Wed Apr 25 10:50:48 2007
@@ -34,11 +34,11 @@
 
     private static final Log log = LogFactory.getLog(URLBasedAxisConfigurator.class);
     private URL axis2xml;
-    private URL repositoy;
+    private URL repository;
 
-    public URLBasedAxisConfigurator(URL axis2xml, URL repositoy) throws AxisFault {
+    public URLBasedAxisConfigurator(URL axis2xml, URL repository) throws AxisFault {
         this.axis2xml = axis2xml;
-        this.repositoy = repositoy;
+        this.repository = repository;
     }
 
     public AxisConfiguration getAxisConfiguration() throws AxisFault {
@@ -51,7 +51,7 @@
                 axis2xmlStream = axis2xml.openStream();
             }
             axisConfig = populateAxisConfiguration(axis2xmlStream);
-            if (repositoy == null) {
+            if (repository == null) {
                 Parameter axis2repoPara = axisConfig.getParameter(DeploymentConstants.AXIS2_REPO);
                 if (axis2repoPara != null) {
                     String repoValue = (String) axis2repoPara.getValue();
@@ -69,7 +69,7 @@
                     loadFromClassPath();
                 }
             } else {
-                loadRepositoryFromURL(repositoy);
+                loadRepositoryFromURL(repository);
             }
 
         } catch (IOException e) {
@@ -81,7 +81,7 @@
     //to load services
     public void loadServices() {
         try {
-            if (repositoy == null) {
+            if (repository == null) {
                 Parameter axis2repoPara = axisConfig.getParameter(DeploymentConstants.AXIS2_REPO);
                 if (axis2repoPara != null) {
                     String repoValue = (String) axis2repoPara.getValue();
@@ -96,7 +96,7 @@
                     }
                 }
             } else {
-                loadServicesFromUrl(repositoy);
+                loadServicesFromUrl(repository);
             }
         } catch (MalformedURLException e) {
             log.info(e);

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java?view=diff&rev=532422&r1=532421&r2=532422
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java Wed Apr 25 10:50:48 2007
@@ -43,11 +43,9 @@
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.namespace.Constants;
 import org.apache.axis2.util.XMLUtils;
-import org.apache.axis2.wsdl.WSDLConstants;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java?view=diff&rev=532422&r1=532421&r2=532422
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java Wed Apr 25 10:50:48 2007
@@ -18,8 +18,9 @@
 package org.apache.axis2.deployment.repository.util;
 
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.deployment.DeploymentClassLoader;
 import org.apache.axis2.deployment.DeploymentErrorMsgs;
+import org.apache.axis2.deployment.Deployer;
+import org.apache.axis2.deployment.DeploymentException;
 import org.apache.axis2.deployment.util.Utils;
 import org.apache.axis2.i18n.Messages;
 
@@ -36,17 +37,15 @@
     private ClassLoader classLoader;
     private String messageReceiver;
 
-    private String name;
-    private String type;
+    private Deployer deployer;
 
-    public DeploymentFileData(File file, String type) {
+    public DeploymentFileData(File file) {
         this.file = file;
-        this.type = type;
     }
 
-    public DeploymentFileData(String type, String name) {
-        this.type = type;
-        this.name = name;
+    public DeploymentFileData(File file, Deployer deployer) {
+        this.file = file;
+        this.deployer = deployer;
     }
 
     public String getAbsolutePath() {
@@ -77,14 +76,10 @@
         if (file != null) {
             return file.getName();
         } else {
-            return name;
+            return null;
         }
     }
 
-    public String getType() {
-        return type;
-    }
-
     public static boolean isModuleArchiveFile(String filename) {
         return (filename.endsWith(".mar"));
     }
@@ -92,7 +87,7 @@
     /**
      * Checks whether a given file is a jar or an aar file.
      *
-     * @param filename
+     * @param filename file to check
      * @return Returns boolean.
      */
     public static boolean isServiceArchiveFile(String filename) {
@@ -101,7 +96,7 @@
 
     public static String getFileExtension(String fileName) {
         int index = fileName.lastIndexOf('.');
-        return fileName.substring(index);
+        return fileName.substring(index + 1);
     }
 
     public void setClassLoader(ClassLoader classLoader) {
@@ -136,5 +131,18 @@
 
     public void setMessageReceiver(String messageReceiver) {
         this.messageReceiver = messageReceiver;
+    }
+
+
+    public Deployer getDeployer() {
+        return deployer;
+    }
+
+    public void setDeployer(Deployer deployer) {
+        this.deployer = deployer;
+    }
+
+    public void deploy() throws DeploymentException {
+        deployer.deploy(this);
     }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java?view=diff&rev=532422&r1=532421&r2=532422
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java Wed Apr 25 10:50:48 2007
@@ -17,26 +17,40 @@
 
 package org.apache.axis2.deployment.repository.util;
 
+import org.apache.axis2.deployment.Deployer;
+
 public class WSInfo {
     private String fileName;
     private long lastModifiedDate;
 
+    public static final int TYPE_SERVICE = 0;
+    public static final int TYPE_MODULE = 1;
+
     /**
      * To check whether the file is a module or a servise
      */
-    private String type;
+    private int type = TYPE_SERVICE;
+
+    private Deployer deployer;
 
     public WSInfo(String filename, long lastmodifieddate) {
         this.fileName = filename;
         this.lastModifiedDate = lastmodifieddate;
     }
 
-    public WSInfo(String filename, long lastmodifieddate, String type) {
-        this.fileName = filename;
-        this.lastModifiedDate = lastmodifieddate;
+
+    public WSInfo(String fileName, long lastModifiedDate, int type) {
+        this.fileName = fileName;
+        this.lastModifiedDate = lastModifiedDate;
         this.type = type;
     }
 
+    public WSInfo(String fileName, long lastModifiedDate, Deployer deployer) {
+        this.fileName = fileName;
+        this.lastModifiedDate = lastModifiedDate;
+        this.deployer = deployer;
+    }
+
     public String getFileName() {
         return fileName;
     }
@@ -45,7 +59,7 @@
         return lastModifiedDate;
     }
 
-    public String getType() {
+    public int getType() {
         return type;
     }
 
@@ -55,5 +69,9 @@
 
     public void setLastModifiedDate(long lastmodifieddate) {
         this.lastModifiedDate = lastmodifieddate;
+    }
+    
+    public Deployer getDeployer() {
+        return deployer;
     }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java?view=diff&rev=532422&r1=532421&r2=532422
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java Wed Apr 25 10:50:48 2007
@@ -19,12 +19,14 @@
 
 import org.apache.axis2.deployment.DeploymentConstants;
 import org.apache.axis2.deployment.DeploymentEngine;
-import org.apache.axis2.deployment.DeploymentException;
+import org.apache.axis2.deployment.Deployer;
 
 import java.io.File;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
+import java.util.Set;
+import java.util.HashSet;
 
 public class WSInfoList implements DeploymentConstants {
 
@@ -36,22 +38,22 @@
     /**
      * All the currently updated jars
      */
-    public List currentJars = new ArrayList();
+    public Set currentJars = new HashSet();
 
     /**
      * Reference to DeploymentEngine to make update
      */
-    private DeploymentEngine deployer;
+    private final DeploymentEngine deploymentEngine;
 
     private boolean check;
 
     public WSInfoList(DeploymentEngine deploy_engine) {
-        deployer = deploy_engine;
+        deploymentEngine = deploy_engine;
     }
 
     /**
      * First checks whether the file is already available by the
-     * system call isFileExist. If it is not deployed yet then adds to the jarList
+     * system call fileExists. If it is not deployed yet then adds to the jarList
      * and to the deployment engine as a new service or module.
      * While adding new item to jarList, first creates the WSInfo object and
      * then adds to the jarlist and actual jar file is added to DeploymentEngine.
@@ -61,76 +63,21 @@
      * DeploymentEngine - one for new deployment and other for undeployment.
      *
      * @param file actual jar files for either Module or service
-     * @param type indicate either Service or Module
      */
-    public synchronized void addWSInfoItem(File file, String type) {
-        if (TYPE_SERVICE.equals(type)) {
-            if (!isFileExist(file.getName())) {    // checking whether the file is already deployed
-                WSInfo wsInfo = new WSInfo(file.getName(), file.lastModified(), TYPE_SERVICE);
-                jarList.add(wsInfo);
-                DeploymentFileData deploymentFileData =
-                        new DeploymentFileData(file, TYPE_SERVICE);
-                deployer.addWSToDeploy(
-                        deploymentFileData);    // inform that new web service is deployed
-            } else {
-                if (deployer.isHotUpdate()) {
-                    WSInfo tempWSInfo = getFileItem(file.getName());
-                    if (isModified(file, tempWSInfo)) {    // check whether file is updated
-                        tempWSInfo.setLastModifiedDate(file.lastModified());
-                        WSInfo wsInfo = new WSInfo(tempWSInfo.getFileName(),
-                                                   tempWSInfo.getLastModifiedDate(), TYPE_SERVICE);
-                        deployer.addWSToUndeploy(wsInfo);           // add entry to undeploy list
-                        DeploymentFileData deploymentFileData = new DeploymentFileData(file,
-                                                                                       TYPE_SERVICE);
-                        deployer.addWSToDeploy(deploymentFileData);    // add entry to deploylist
-                    }
-                }
-            }
-        } else if (TYPE_MODULE.equals(type)) {
-            if (!isFileExist(file.getName()))
-            {                     // checking whether the file is already deployed
-                WSInfo wsInfo = new WSInfo(file.getName(), file.lastModified(), TYPE_MODULE);
-                jarList.add(wsInfo);
-                DeploymentFileData deploymentFileData =
-                        new DeploymentFileData(file, TYPE_MODULE);
-                deployer.addWSToDeploy(
-                        deploymentFileData);    // inform that new web service is deployed
-            }
-        } else {
-            if (file != null) {
-                String extension = DeploymentFileData.getFileExtension(file.getName());
-                if (!isFileExist(file.getName())) {
-                    WSInfo wsInfo = new WSInfo(file.getName(), file.lastModified(), extension);
-                    jarList.add(wsInfo);
-                    DeploymentFileData deploymentFileData =
-                            new DeploymentFileData(file, extension);
-                    deployer.addWSToDeploy(
-                            deploymentFileData);    // inform that new web service is deployed
-                } else {
-                    if (deployer.isHotUpdate()) {
-                        WSInfo tempWSInfo = getFileItem(file.getName());
-                        if (isModified(file, tempWSInfo)) {    // check whether file is updated
-                            tempWSInfo.setLastModifiedDate(file.lastModified());
-                            WSInfo wsInfo = new WSInfo(tempWSInfo.getFileName(),
-                                                       tempWSInfo.getLastModifiedDate(), extension);
-                            deployer.addWSToUndeploy(
-                                    wsInfo);           // add entry to undeploy list
-                            DeploymentFileData deploymentFileData = new DeploymentFileData(file,
-                                                                                           extension);
-                            deployer.addWSToDeploy(
-                                    deploymentFileData);    // add entry to deploylist
-                        }
-                    }
-                }
-            } else {
-                check = true;
-            }
+    public synchronized void addWSInfoItem(File file, Deployer deployer) {
+        WSInfo info = getFileItem(file.getName());
+        if (info == null) {
+            info = new WSInfo(file.getName(), file.lastModified(), deployer);
+            jarList.add(info);
+            DeploymentFileData fileData = new DeploymentFileData(file, deployer);
+            deploymentEngine.addWSToDeploy(fileData);
+        } else if (deploymentEngine.isHotUpdate() && isModified(file, info)) {
+            info.setLastModifiedDate(file.lastModified());
+            WSInfo wsInfo = new WSInfo(info.getFileName(), info.getLastModifiedDate(), deployer);
+            deploymentEngine.addWSToUndeploy(wsInfo);           // add entry to undeploy list
+            DeploymentFileData deploymentFileData = new DeploymentFileData(file, deployer);
+            deploymentEngine.addWSToDeploy(deploymentFileData);    // add entry to deploylist
         }
-        if (file != null) {
-            String jarname = file.getName();
-            currentJars.add(jarname);
-        }
-        check = true;
     }
 
     /**
@@ -147,33 +94,18 @@
         }
 
         Iterator iter = jarList.listIterator();
-        int size = currentJars.size();
         List tempvector = new ArrayList();
 
-        tempvector.clear();
-
-        String filename;
-        boolean exist;
-
         while (iter.hasNext()) {
             WSInfo fileitem = (WSInfo) iter.next();
-            if (TYPE_MODULE.equals(fileitem.getType())) {
+            if (fileitem.getType() == WSInfo.TYPE_MODULE) {
                 continue;
             }
-            exist = false;
-            for (int i = 0; i < size; i++) {
-                filename = (String) currentJars.get(i);
-                if (filename.equals(fileitem.getFileName())) {
-                    exist = true;
-                    break;
-                }
-            }
-            if (!exist) {
+            String itemName = fileitem.getFileName();
+            if (!currentJars.contains(itemName)) {
                 tempvector.add(fileitem);
-                WSInfo wsInfo = new WSInfo(fileitem.getFileName(), fileitem.getLastModifiedDate(),
-                                           fileitem.getType());
-
-                deployer.addWSToUndeploy(wsInfo);    // this is to be undeployed
+                WSInfo wsInfo = new WSInfo(fileitem.getFileName(), fileitem.getLastModifiedDate());
+                deploymentEngine.addWSToUndeploy(wsInfo);    // this is to be undeployed
             }
         }
         for (int i = 0; i < tempvector.size(); i++) {
@@ -195,10 +127,10 @@
      *
      */
     public void update() {
-        synchronized (deployer) {
+        synchronized (deploymentEngine) {
             checkForUndeployedServices();
-            deployer.unDeploy();
-            deployer.doDeploy();
+            deploymentEngine.unDeploy();
+            deploymentEngine.doDeploy();
         }
     }
 
@@ -217,15 +149,6 @@
             }
         }
         return null;
-    }
-
-    /**
-     * Checks whether the file already exists in the list.
-     *
-     * @param filename
-     */
-    private boolean isFileExist(String filename) {
-        return !(getFileItem(filename) == null);
     }
 
     /**

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=532422&r1=532421&r2=532422
==============================================================================
--- 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 Wed Apr 25 10:50:48 2007
@@ -490,8 +490,7 @@
                     File inputFile = Utils.createTempFile(servicename,
                             fin,
                             (File)axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
-                    DeploymentFileData filedata = new DeploymentFileData(inputFile,
-                                                                         DeploymentConstants.TYPE_SERVICE);
+                    DeploymentFileData filedata = new DeploymentFileData(inputFile);
 
                     filedata.setClassLoader(false,
                                             moduleClassLoader,
@@ -509,8 +508,7 @@
                         }
                     }
                     AxisServiceGroup serviceGroup = new AxisServiceGroup(axisConfig);
-                    serviceGroup.setServiceGroupClassLoader(
-                            filedata.getClassLoader());
+                    serviceGroup.setServiceGroupClassLoader(filedata.getClassLoader());
                     ArrayList serviceList = archiveReader.processServiceGroup(
                             filedata.getAbsolutePath(), filedata,
                             serviceGroup, false, wsdlservice,

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java?view=diff&rev=532422&r1=532421&r2=532422
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java Wed Apr 25 10:50:48 2007
@@ -51,7 +51,6 @@
     }
 
     public void addParameter(Parameter param) throws AxisFault {
-
         if (param == null) {
             return;
         }
@@ -62,6 +61,10 @@
         }
 
         parameterInclude.addParameter(param);
+    }
+
+    public void addParameter(String name, Object value) throws AxisFault {
+        addParameter(new Parameter(name, value));
     }
 
     public void removeParameter(Parameter param) throws AxisFault {

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java?view=diff&rev=532422&r1=532421&r2=532422
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java Wed Apr 25 10:50:48 2007
@@ -133,13 +133,13 @@
         soap12 = ele.declareNamespace(URI_WSDL12_SOAP, SOAP12_PREFIX);
         http = ele.declareNamespace(HTTP_NAMESPACE, HTTP_PREFIX);
         mime = ele.declareNamespace(MIME_NAMESPACE, MIME_PREFIX);
-        String prefix = WSDLSerializationUtil.getPrefix(axisService.getTargetNamespace(), namespaceMap);
+        String prefix = WSDLSerializationUtil.getPrefix(axisService.getTargetNamespace(),
+                                                        namespaceMap);
         if (prefix == null || "".equals(prefix)) {
             prefix = DEFAULT_TARGET_NAMESPACE_PREFIX;
         }
 
-        namespaceMap.put(prefix,
-                                           axisService.getTargetNamespace());
+        namespaceMap.put(prefix, axisService.getTargetNamespace());
         tns = ele.declareNamespace(axisService.getTargetNamespace(), prefix);
 
         // adding documentation element

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DispatchPhase.java
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DispatchPhase.java?view=diff&rev=532422&r1=532421&r2=532422
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DispatchPhase.java (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DispatchPhase.java Wed Apr 25 10:50:48 2007
@@ -1,16 +1,30 @@
 package org.apache.axis2.engine;
 
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
+import org.apache.axis2.util.JavaUtils;
 import org.apache.axis2.addressing.AddressingHelper;
 import org.apache.axis2.addressing.EndpointReference;
 import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.SessionContext;
+import org.apache.axis2.context.ServiceGroupContext;
+import org.apache.axis2.context.ContextFactory;
+import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.context.OperationContext;
 import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisServiceGroup;
 import org.apache.axis2.i18n.Messages;
 import org.apache.axis2.transport.RequestResponseTransport;
+import org.apache.axis2.transport.TransportListener;
+import org.apache.axis2.transport.http.HTTPConstants;
 import org.apache.axis2.wsdl.WSDLConstants.WSDL20_2004_Constants;
+import org.apache.axiom.soap.SOAPHeader;
+import org.apache.axiom.om.OMElement;
 
 import java.util.ArrayList;
 import java.util.List;
+import java.util.Iterator;
 
 /*
 * Copyright 2004,2005 The Apache Software Foundation.
@@ -44,13 +58,36 @@
         if (msgContext.getAxisService() == null) {
             throw new AxisFault(Messages.getMessage("servicenotfoundforepr",
                                                     ((toEPR != null) ? toEPR.getAddress() : "")));
-        } else if (msgContext.getAxisOperation() == null) {
+        }
+
+        AxisService service = msgContext.getAxisService();
+        AxisOperation operation = msgContext.getAxisOperation();
+        // If we're configured to do so, check the service for a single op...
+        if (operation == null &&
+                JavaUtils.isTrue(service.getParameterValue("supportSingleOperation"))) {
+            Iterator ops = service.getOperations();
+            // If there's exactly one, that's the one we want.  If there's more, forget it.
+            if (ops.hasNext()) {
+                operation = (AxisOperation)ops.next();
+                if (ops.hasNext()) {
+                    operation = null;
+                }
+            }
+        }
+
+        // If we still don't have an operation, fault.
+        if (operation == null) {
             throw new AxisFault(Messages.getMessage("operationnotfoundforepr",
                                                     ((toEPR != null) ? toEPR.getAddress()
                                                             : ""), msgContext.getWSAAction()));
         }
 
+        msgContext.setAxisOperation(operation);
+        
         validateTransport(msgContext);
+
+        loadContexts(service, msgContext);
+
         if (msgContext.getOperationContext() == null) {
             throw new AxisFault(Messages.getMessage("cannotBeNullOperationContext"));
         }
@@ -59,6 +96,7 @@
             throw new AxisFault(Messages.getMessage("cannotBeNullServiceContext"));
         }
 
+        // TODO - review this
         if ((msgContext.getAxisOperation() == null) && (msgContext.getOperationContext() != null)) {
             msgContext.setAxisOperation(msgContext.getOperationContext().getAxisOperation());
         }
@@ -96,6 +134,59 @@
         msgContext.setExecutionChain((ArrayList) operationChain.clone());
     }
 
+    private void loadContexts(AxisService service, MessageContext msgContext) throws AxisFault {
+        String scope = service == null ? null : service.getScope();
+        ServiceContext serviceContext = msgContext.getServiceContext();
+
+        if ((msgContext.getOperationContext() != null)
+                && (serviceContext != null)) {
+            msgContext.setServiceGroupContextId(
+                    ((ServiceGroupContext) serviceContext.getParent()).getId());
+            return;
+        }
+        if (Constants.SCOPE_TRANSPORT_SESSION.equals(scope)) {
+            fillContextsFromSessionContext(msgContext);
+        }
+
+        AxisOperation axisOperation = msgContext.getAxisOperation();
+        if (axisOperation == null) {
+            return;
+        }
+        OperationContext operationContext =
+                axisOperation.findForExistingOperationContext(msgContext);
+
+        if (operationContext != null) {
+            // register operation context and message context
+//            axisOperation.registerOperationContext(msgContext, operationContext);
+            axisOperation.registerMessageContext(msgContext, operationContext);
+
+            serviceContext = (ServiceContext) operationContext.getParent();
+            ServiceGroupContext serviceGroupContext =
+                    (ServiceGroupContext) serviceContext.getParent();
+
+            msgContext.setServiceContext(serviceContext);
+            msgContext.setServiceGroupContext(serviceGroupContext);
+            msgContext.setServiceGroupContextId(serviceGroupContext.getId());
+        } else {    // 2. if null, create new opCtxt
+            operationContext = ContextFactory.createOperationContext(axisOperation, serviceContext);
+
+            axisOperation.registerMessageContext(msgContext, operationContext);
+            if (serviceContext != null) {
+                // no need to added to configuration conetxt , since we are happy in
+                //  storing in session context
+                operationContext.setParent(serviceContext);
+            } else {
+                // fill the service group context and service context info
+                msgContext.getConfigurationContext().fillServiceContextAndServiceGroupContext(
+                        msgContext);
+            }
+        }
+        serviceContext = msgContext.getServiceContext();
+        if (serviceContext != null) {
+            serviceContext.setMyEPR(msgContext.getTo());
+        }
+    }
+
     /**
      * To check wether the incoming request has come in valid transport , simpley the transports
      * that service author wants to expose
@@ -119,5 +210,57 @@
         EndpointReference toEPR = msgctx.getTo();
         throw new AxisFault(Messages.getMessage("servicenotfoundforepr",
                                                 ((toEPR != null) ? toEPR.getAddress() : "")));
+    }
+
+    private void fillContextsFromSessionContext(MessageContext msgContext) throws AxisFault {
+        AxisService service = msgContext.getAxisService();
+        if (service == null) {
+            throw new AxisFault(Messages.getMessage("unabletofindservice"));
+        }
+        SessionContext sessionContext = msgContext.getSessionContext();
+        if (sessionContext == null) {
+            TransportListener listener = msgContext.getTransportIn().getReceiver();
+            sessionContext = listener.getSessionContext(msgContext);
+            if (sessionContext == null) {
+                createAndFillContexts(service, msgContext, sessionContext);
+                return;
+            }
+        }
+        String serviceGroupName = msgContext.getAxisServiceGroup().getServiceGroupName();
+        ServiceGroupContext serviceGroupContext = sessionContext.getServiceGroupContext(
+                serviceGroupName);
+        if (serviceGroupContext != null) {
+            //setting service group context
+            msgContext.setServiceGroupContext(serviceGroupContext);
+            // setting Service conetxt
+            msgContext.setServiceContext(
+                    ContextFactory.createServiceContext(serviceGroupContext, service));
+        } else {
+            createAndFillContexts(service, msgContext, sessionContext);
+        }
+        ServiceContext serviceContext = sessionContext.getServiceContext(service);
+        //found the serviceContext from session context , so adding that into msgContext
+        if (serviceContext != null) {
+            msgContext.setServiceContext(serviceContext);
+            serviceContext.setProperty(HTTPConstants.COOKIE_STRING, sessionContext.getCookieID());
+        }
+    }
+
+    private void createAndFillContexts(AxisService service,
+                                       MessageContext msgContext,
+                                       SessionContext sessionContext) throws AxisFault {
+        ServiceGroupContext serviceGroupContext;
+        AxisServiceGroup axisServiceGroup = (AxisServiceGroup) service.getParent();
+        serviceGroupContext = ContextFactory.createServiceGroupContext(
+                msgContext.getConfigurationContext(), axisServiceGroup);
+
+        msgContext.setServiceGroupContext(serviceGroupContext);
+        ServiceContext serviceContext =
+                ContextFactory.createServiceContext(serviceGroupContext, service);
+        msgContext.setServiceContext(serviceContext);
+        if (sessionContext != null) {
+            sessionContext.addServiceContext(serviceContext);
+            sessionContext.addServiceGroupContext(serviceGroupContext);
+        }
     }
 }

Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties?view=diff&rev=532422&r1=532421&r2=532422
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties (original)
+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties Wed Apr 25 10:50:48 2007
@@ -160,7 +160,7 @@
 transportSenderError=The TransportSender implementation class is required for the transport {0}
 obsererror=An implemenation class of the Observer object is required.
 invalidmoduleconfig=A module configuration exists that is not valid.
-invalidhandler=The following handler exists is not valid: {0}
+invalidhandler=Invalid handler config!  Name: {0} Reason: {1}
 parameterlockederror=The {0} parameter is locked at the top level and cannot be overridden.
 op_error=Processing Operations Modules with an error of {0}
 servicenameeror=A service name is required.

Added: webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/axis2.xml
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/axis2.xml?view=auto&rev=532422
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/axis2.xml (added)
+++ webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/axis2.xml Wed Apr 25 10:50:48 2007
@@ -0,0 +1,290 @@
+<!--
+/*
+ * Copyright 2001-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.
+ */
+ -->
+
+<axisconfig name="AxisJava2.0">
+    <!-- ================================================= -->
+    <!-- Parameters -->
+    <!-- ================================================= -->
+    <parameter name="hotdeployment">true</parameter>
+    <parameter name="hotupdate">false</parameter>
+    <parameter name="enableMTOM">false</parameter>
+    <parameter name="enableSwA">false</parameter>
+
+    <!--Uncomment if you want to enable file caching for attachments -->
+    <!--parameter name="cacheAttachments">true</parameter>
+    <parameter name="attachmentDIR"></parameter>
+    <parameter name="sizeThreshold">4000</parameter-->
+
+    <!--This will give out the timout of the configuration contexts, in milliseconds-->
+    <parameter name="ConfigContextTimeoutInterval">30000</parameter>
+
+    <!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
+    <!--that behaviour.-->
+    <parameter name="sendStacktraceDetailsWithFaults">false</parameter>
+
+    <!--If there aren't any information available to find out the fault reason, we set the message of the expcetion-->
+    <!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
+    <!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
+    <!--is set then, Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
+    <parameter name="DrillDownToRootCauseForFaultReason">false</parameter>
+
+    <parameter name="userName">admin</parameter>
+    <parameter name="password">axis2</parameter>
+
+    <!--To override repository/services you need to uncomment following parameter and value SHOULD be absolute file path.-->
+    <!--<parameter name="ServicesDirectory">service</parameter>-->
+    <!--To override repository/modules you need to uncomment following parameter and value SHOULD be absolute file path-->
+    <!--<parameter name="ModulesDirectory">modules</parameter>-->
+
+
+
+    <!--Following params will set the proper context paths for invocations. All the endpoints will have a commons context-->
+    <!--root which can configured using the following contextRoot parameter-->
+    <!--<parameter name="contextRoot">axis2</parameter>-->
+
+    <!--Our HTTP endpoints can handle both REST and SOAP. Following parameters can be used to distingiush those endpoints-->
+    <!--In case of a servlet, if you change this you have to manually change the settings of your servlet container to map this -->
+    <!--context path to proper Axis2 servlets-->
+    <!--<parameter name="servicePath">services</parameter>-->
+    <!--<parameter name="restPath">rest</parameter>-->
+
+    <!-- Following parameter will completely disable REST handling in Axis2-->
+    <parameter name="disableREST" locked="true">false</parameter>
+
+    <!-- If you have a frontend host which exposes this webservice using a different public URL  -->
+    <!-- use this parameter to override autodetected url -->
+    <!--<parameter name="httpFrontendHostUrl">https://someotherhost/context</parameter>-->
+
+
+    <!--    The way of adding listener to the system-->
+    <!--    <listener class="org.apache.axis2.ObserverIMPL">-->
+    <!--        <parameter name="RSS_URL">http://127.0.0.1/rss</parameter>-->
+    <!--    </listener>-->
+
+    <!-- ================================================= -->
+    <!-- Message Receivers -->
+    <!-- ================================================= -->
+    <!--This is the Deafult Message Receiver for the system , if you want to have MessageReceivers for -->
+    <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
+    <!--any operation -->
+    <!--Note : You can ovride this for particular service by adding the same element with your requirement-->
+     <messageReceivers>
+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
+                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
+                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-only"
+                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
+        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-out"
+                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+    </messageReceivers>
+
+    <!-- ================================================= -->
+    <!-- Message Formatter -->
+    <!-- ================================================= -->
+    <!--Following content type to message formatter mapping can be used to implement support for different message -->
+    <!--format  serialization in Axis2. These message formats are expected to be resolved based on the content type. -->
+    <messageFormatters>
+        <messageFormatter contentType="application/x-www-form-urlencoded"
+                         class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
+        <messageFormatter contentType="multipart/form-data"
+                         class="org.apache.axis2.transport.http.MultipartFormDataFormatter"/>
+        <messageFormatter contentType="application/xml"
+                         class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
+    </messageFormatters>
+
+    <!-- Test custom deployment by registering for "svc" files, and the "widgets" dir -->
+    <deployer extension="svc" directory="widgets"
+            class="org.apache.axis2.deployment.deployers.CustomDeployer"/>
+
+    <!-- ================================================= -->
+    <!-- Message Builders -->
+    <!-- ================================================= -->
+    <!--Following content type to builder mapping can be used to implement support for different message -->
+    <!--formats in Axis2. These message formats are expected to be resolved based on the content type. -->
+    <messageBuilders>
+        <messageBuilder contentType="application/xml"
+                         class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
+        <messageBuilder contentType="application/x-www-form-urlencoded"
+                         class="org.apache.axis2.builder.XFormURLEncodedBuilder"/>
+        <messageBuilder contentType="multipart/form-data"
+                         class="org.apache.axis2.builder.MultipartFormDataBuilder"/>
+    </messageBuilders>
+
+    <!-- ================================================= -->
+    <!-- Transport Ins -->
+    <!-- ================================================= -->
+    <transportReceiver name="http"
+                       class="org.apache.axis2.transport.http.SimpleHTTPServer">
+        <parameter name="port">8080</parameter>
+        <!-- Here is the complete list of supported parameters (see example settings further below):
+            port: the port to listen on (default 6060)
+            hostname:  if non-null, url prefix used in reply-to endpoint references                                 (default null)
+            originServer:  value of http Server header in outgoing messages                                         (default "Simple-Server/1.1")
+            requestTimeout:  value in millis of time that requests can wait for data                                (default 20000)
+            requestTcpNoDelay:  true to maximize performance and minimize latency                                   (default true)
+                                false to minimize bandwidth consumption by combining segments
+            requestCoreThreadPoolSize:  number of threads available for request processing (unless queue fills up)  (default 25)
+            requestMaxThreadPoolSize:  number of threads available for request processing if queue fills us         (default 150)
+                                       note that default queue never fills up:  see HttpFactory
+            threadKeepAliveTime:  time to keep threads in excess of core size alive while inactive                  (default 180)
+                                  note that no such threads can exist with default unbounded request queue
+            threadKeepAliveTimeUnit:  TimeUnit of value in threadKeepAliveTime (default SECONDS)                    (default SECONDS)
+        -->
+        <!-- <parameter name="hostname">http://www.myApp.com/ws</parameter> -->
+        <!-- <parameter name="originServer">My-Server/1.1</parameter>           -->
+        <!-- <parameter name="requestTimeout">10000</parameter>                   -->
+        <!-- <parameter name="requestTcpNoDelay">false</parameter>                   -->
+        <!-- <parameter name="requestCoreThreadPoolSize">50</parameter>                      -->
+        <!-- <parameter name="RequestMaxThreadPoolSize">100</parameter>                     -->
+        <!-- <parameter name="threadKeepAliveTime">240000</parameter>                  -->
+        <!-- <parameter name="threadKeepAliveTimeUnit">MILLISECONDS</parameter>            -->
+    </transportReceiver>
+
+    <!-- ================================================= -->
+    <!-- Transport Outs -->
+    <!-- ================================================= -->
+
+    <transportSender name="tcp"
+                     class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
+    <transportSender name="local"
+                     class="org.apache.axis2.transport.local.LocalTransportSender"/>
+    <transportSender name="http"
+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL">HTTP/1.1</parameter>
+        <parameter name="Transfer-Encoding">chunked</parameter>
+
+        <!-- If following is set to 'true', optional action part of the Content-Type will not be added to the SOAP 1.2 messages -->
+        <!--  <parameter name="OmitSOAP12Action">true</parameter>  -->
+    </transportSender>
+
+    <transportSender name="https"
+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+        <parameter name="PROTOCOL">HTTP/1.1</parameter>
+        <parameter name="Transfer-Encoding">chunked</parameter>
+    </transportSender>
+    <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
+    <transportSender name="jms"
+                     class="org.apache.axis2.transport.jms.JMSSender"/>
+    -->
+
+    <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
+   <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
+       <parameter name="transport.mail.smtp.host">127.0.0.1</parameter>
+       <parameter name="transport.mail.smtp.user">axis2</parameter>
+       <parameter name="transport.mail.smtp.password">axis2</parameter>
+       <parameter name="transport.mail.smtp.port">25</parameter>
+   </transportSender>
+   -->
+
+    <!-- ================================================= -->
+    <!-- Global Modules  -->
+    <!-- ================================================= -->
+    <!-- Comment this to disable Addressing -->
+    <!--<module ref="addressing"/>-->
+
+    <!--Configuring module , providing parameters for modules whether they refer or not-->
+    <!--<moduleConfig name="addressing">-->
+    <!--<parameter name="addressingPara">N/A</parameter>-->
+    <!--</moduleConfig>-->
+
+    <!-- ================================================= -->
+    <!-- Clustering  -->
+    <!-- ================================================= -->
+    <!-- Configure and uncomment following for preparing Axis2 to a clustered environment -->
+    <!--
+    <cluster class="org.apache.axis2.cluster.tribes.TribesClusterManager">
+        <parameter name="param1">value1</parameter>
+    	<configurationManager class="org.apache.axis2.cluster.tribes.configuration.TribesConfigurationManager">
+    	    <listeners>
+    	    </listeners>
+    	</configurationManager>
+    	<contextManager class="org.apache.axis2.cluster.tribes.context.TribesContextManager">
+    	    <listeners>
+    	    </listeners>
+    	</contextManager>
+    </cluster>
+    -->
+
+    <!-- ================================================= -->
+    <!-- Phases  -->
+    <!-- ================================================= -->
+    <phaseOrder type="InFlow">
+        <!--  System pre defined phases       -->
+        <phase name="Transport">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.engine.RequestURIBasedDispatcher"/>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher"/>
+        </phase>
+        <phase name="Security"/>
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.engine.AddressingBasedDispatcher"/>
+            <handler name="RequestURIOperationDispatcher"
+                     class="org.apache.axis2.engine.RequestURIOperationDispatcher"/>
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher"/>
+            <handler name="HTTPLocationBasedDispatcher"
+                     class="org.apache.axis2.engine.HTTPLocationBasedDispatcher"/>
+        </phase>
+        <!--  System pre defined phases       -->
+        <!--   After Postdispatch phase module author or or service author can add any phase he want      -->
+        <phase name="OperationInPhase"/>
+	<phase name="soapmonitorPhase"/>
+    </phaseOrder>
+    <phaseOrder type="OutFlow">
+        <!--      user can add his own phases to this area  -->
+	<phase name="soapmonitorPhase"/>
+        <phase name="OperationOutPhase"/>
+        <!--system predefined phase-->
+        <!--these phase will run irrespective of the service-->
+        <phase name="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+        <phase name="Security"/>
+    </phaseOrder>
+    <phaseOrder type="InFaultFlow">
+        <phase name="PreDispatch"/>
+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.engine.RequestURIBasedDispatcher"/>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher"/>
+            <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.engine.AddressingBasedDispatcher"/>
+            <handler name="RequestURIOperationDispatcher"
+                     class="org.apache.axis2.engine.RequestURIOperationDispatcher"/>
+            <handler name="SOAPMessageBodyBasedDispatcher"
+                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher"/>
+            <handler name="HTTPLocationBasedDispatcher"
+                     class="org.apache.axis2.engine.HTTPLocationBasedDispatcher"/>
+        </phase>
+        <!--      user can add his own phases to this area  -->
+        <phase name="OperationInFaultPhase"/>
+	<phase name="soapmonitorPhase"/>
+    </phaseOrder>
+    <phaseOrder type="OutFaultFlow">
+        <!--      user can add his own phases to this area  -->
+	<phase name="soapmonitorPhase"/>
+        <phase name="OperationOutFaultPhase"/>
+        <phase name="PolicyDetermination"/>
+        <phase name="MessageOut"/>
+    </phaseOrder>
+</axisconfig>
+

Added: webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/george.svc
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/george.svc?view=auto&rev=532422
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/george.svc (added)
+++ webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/george.svc Wed Apr 25 10:50:48 2007
@@ -0,0 +1 @@
+This is a custom service deployment in the services/ directory.  Its name is George.

Added: webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/mary.svc
URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/mary.svc?view=auto&rev=532422
==============================================================================
--- webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/mary.svc (added)
+++ webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/mary.svc Wed Apr 25 10:50:48 2007
@@ -0,0 +1 @@
+This is a custom service deployment in the widgets/ directory.  Its name is Mary.



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


Re: svn commit: r532422 [1/2] - in /webservices/axis2/trunk/java/modules/kernel: src/org/apache/axis2/context/ src/org/apache/axis2/deployment/ src/org/apache/axis2/deployment/repository/util/ src/org/apache/axis2/deployment/util/ src/org/apache/axis2/desc...

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi Glen,

I did not check but when I go though your changes I found you have
remove hot deployment feature of Axis2.

Can you please wait till I do Axis2 1.2 release ,  I am bit busy with
the release and I do not have enough time to check what you have done.
Believe me I have very good experience when someone else come and modify
Axis2 deployment and break Axis2 functionality without knowing history .
Therefore I relay need to look at carefully when someone change
Deployment code.

I am -1 on this kind of changes , first we need to discuss when we are
going to do a major changes.

Thanks
Deepal

gdaniels@apache.org wrote:

>Author: gdaniels
>Date: Wed Apr 25 10:50:48 2007
>New Revision: 532422
>
>URL: http://svn.apache.org/viewvc?view=rev&rev=532422
>Log:
>* Refactor deployment a bit to clean things up and get custom deployers actually working.  Get rid of a bunch of code that looked at (via string compares) the "type" field in order to decide what to do, and instead use polymorphism to do deployment.  Essentially this means we figure out which Deployer to use early on for DeploymentFileData/WSInfo, and store that away.  Then we can just call fileData.deploy() and it does the right thing.  Also notice how this simplifies WSInfoList.addWSInfoItem().
>
>* Add a custom Deployer test  
>
>* Refactor DispatchPhase to do the work of InstanceDispatcher, to avoid a separate Handler which has confusing deployment characteristics.  Now at the end of the Dispatch phase, all the contexts and metadata are set up, instead of doing it afterwards in a separate place.  Will remove InstanceDispatcher next.
>
>* Add convenience method addParameter(String, Object) to AxisDescription
>
>* The usual general fixing up of code, spelling, JavaDoc, etc
>
>TODO - This needs a little more cleanup and I'd like to merge WSInfo and DeploymentFileData into a single structure if possible to simplify further
>
>TODO - Consider whether to make Deployers stateless/singletons?
>
>TODO - Remove InstanceDispatcher
>
>Added:
>    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/
>    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/axis2.xml
>    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/
>    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/george.svc
>    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/
>    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/mary.svc
>    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/CustomDeployerTest.java
>    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/deployers/
>    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/deployers/CustomDeployer.java
>Modified:
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/Deployer.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.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/DescriptionBuilder.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DispatchPhase.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties
>    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/DeploymentTotalTest.java
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java Wed Apr 25 10:50:48 2007
>@@ -165,13 +165,17 @@
>      * @param axis2xml : location of the axis2.xml (configuration) , you can not give
>      *                 axis2xml relative to repository.
>      * @return Returns the built ConfigurationContext.
>-     * @throws DeploymentException
>+     * @throws AxisFault in case of problems
>      */
>     public static ConfigurationContext createConfigurationContextFromFileSystem(
>             String path,
>             String axis2xml) throws AxisFault {
>-    	
>         return createConfigurationContext(new FileSystemConfigurator(path, axis2xml));
>+    }
>+
>+    public static ConfigurationContext createConfigurationContextFromFileSystem(String path)
>+            throws AxisFault {
>+        return createConfigurationContextFromFileSystem(path, null);
>     }
> 
>     public static ConfigurationContext createConfigurationContextFromURIs(
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java Wed Apr 25 10:50:48 2007
>@@ -248,28 +248,29 @@
>         while (deployerItr.hasNext()) {
>             OMElement element = (OMElement) deployerItr.next();
>             String directory = element.getAttributeValue(new QName(DIRECTORY));
>-            if (directory != null) {
>-                String extension = element.getAttributeValue(new QName(EXTENSION));
>-                if (extension != null) {
>-                    try {
>-                        String deployerValue = element.getAttributeValue(new QName(TAG_CLASS_NAME));
>-                        Class deployerClass;
>-                        deployerClass = Loader.loadClass(deployerValue);
>-                        Deployer deployer =
>-                                (Deployer) deployerClass.newInstance();
>-                        deployer.setDirectory(directory);
>-                        deployer.setExtension(extension);
>-                        directoryToExtensionMappingMap.put(directory, extension);
>-                        extensionToDeployerMappingMap.put(extension, deployer);
>-                    } catch (ClassNotFoundException e) {
>-                        log.error(e);
>-                    } catch (InstantiationException e) {
>-                        log.error(e);
>-                    } catch (IllegalAccessException e) {
>-                        log.error(e);
>-                    }
>-                }
>+            if (directory == null) {
>+                log.error("Deployer missing 'directory' attribute : " + element.toString());
>+            }
>+
>+            String extension = element.getAttributeValue(new QName(EXTENSION));
>+            if (extension == null) {
>+                log.error("Deployer missing 'extension' attribute : " + element.toString());
>+                return;
>+            }
>+            String deployerClassName = element.getAttributeValue(new QName(TAG_CLASS_NAME));
>+            Deployer deployer;
>+            try {
>+                Class deployerClass = Loader.loadClass(deployerClassName);
>+                deployer = (Deployer) deployerClass.newInstance();
>+            } catch (Exception e) {
>+                log.error(e);
>+                return;
>             }
>+            deployer.setDirectory(directory);
>+            deployer.setExtension(extension);
>+            if (directory != null)
>+                directoryToExtensionMappingMap.put(directory, extension);
>+            extensionToDeployerMappingMap.put(extension, deployer);
>         }
>         if (deploymentEngine != null) {
>             deploymentEngine.setDirectoryToExtensionMappingMap(directoryToExtensionMappingMap);
>@@ -384,7 +385,7 @@
> 
>             while (handlers.hasNext()) {
>                 OMElement omElement = (OMElement) handlers.next();
>-                HandlerDescription handler = processHandler(omElement, axisConfig);
>+                HandlerDescription handler = processHandler(omElement, axisConfig, phaseName);
> 
>                 handler.getRules().setPhaseName(phaseName);
>                 Utils.loadHandler(axisConfig.getSystemClassLoader(), handler);
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/Deployer.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/Deployer.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/Deployer.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/Deployer.java Wed Apr 25 10:50:48 2007
>@@ -27,15 +27,36 @@
>  * a service or a module.
>  */
> public interface Deployer {
>-    //To initialize the deployer
>+    /**
>+     * Initialize the Deployer
>+     * @param configCtx our ConfigurationContext
>+     */
>     void init(ConfigurationContext configCtx);
> 
>-    //Will process the file and add that to axisConfig
>+    /**
>+     * Process a file and add it to the configuration
>+     * @param deploymentFileData the DeploymentFileData object to deploy
>+     * @throws DeploymentException if there is a problem
>+     */
>     void deploy(DeploymentFileData deploymentFileData) throws DeploymentException;
> 
>+    /**
>+     * Set the directory
>+     * @param directory directory name
>+     */
>     void setDirectory(String directory);
> 
>+    /**
>+     * Set the extension to look for
>+     * TODO: Support multiple extensions?
>+     * @param extension the file extension associated with this Deployer
>+     */
>     void setExtension(String extension);
> 
>+    /**
>+     * Remove a given file from the configuration
>+     * @param fileName name of item to remove
>+     * @throws DeploymentException if there is a problem
>+     */
>     void unDeploy(String fileName) throws DeploymentException;
> }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java Wed Apr 25 10:50:48 2007
>@@ -31,10 +31,6 @@
>     public static String MODULE_PATH = "modules";
>     public static String MODULE_DRI_PATH = "ModulesDirectory";
> 
>-    String TYPE_SERVICE = "service";                // is it a service
>-    String TYPE_DEFAULT = "none";                // is it a service
>-    String TYPE_MODULE = "module";                // is it a module
>-
>     String TAG_AXISCONFIG = "axisconfig";
>     String TAG_PHASE_ORDER = "phaseOrder";
>     String TAG_PHASE = "phase";
>
>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=532422&r1=532421&r2=532422
>==============================================================================
>--- 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 Wed Apr 25 10:50:48 2007
>@@ -94,6 +94,7 @@
>     protected String modulesPath = null;
>     protected File modulesDir = null;
>     private File repositoryDir = null;
>+
>     //to deploy service (both aar and expanded)
>     protected ServiceDeployer serviceDeployer;
>     //To deploy modules (both mar and expanded)
>@@ -235,10 +236,10 @@
> 
>     private void populateModule(AxisModule module, URL moduleUrl) throws DeploymentException {
>         try {
>-            ClassLoader classLoadere = module.getModuleClassLoader();
>-            InputStream moduleStream = classLoadere.getResourceAsStream("META-INF/module.xml");
>+            ClassLoader classLoader = module.getModuleClassLoader();
>+            InputStream moduleStream = classLoader.getResourceAsStream("META-INF/module.xml");
>             if (moduleStream == null) {
>-                moduleStream = classLoadere.getResourceAsStream("meta-inf/module.xml");
>+                moduleStream = classLoader.getResourceAsStream("meta-inf/module.xml");
>             }
>             if (moduleStream == null) {
>                 throw new DeploymentException(
>@@ -571,27 +572,13 @@
>         try {
>             if (wsToDeploy.size() > 0) {
>                 for (int i = 0; i < wsToDeploy.size(); i++) {
>-                    DeploymentFileData currentDeploymentFile = (DeploymentFileData) wsToDeploy.get(i);
>-                    String type = currentDeploymentFile.getType();
>-                    if (TYPE_SERVICE.equals(type)) {
>-                        try {
>-                            serviceDeployer.deploy(currentDeploymentFile);
>-                        } catch (DeploymentException e) {
>-                            log.debug(e);
>-                        }
>-                    } else if (TYPE_MODULE.equals(type)) {
>-                        moduleDeployer.deploy(currentDeploymentFile);
>-                    } else {
>-                        Deployer deployer = (Deployer) extensionToDeployerMappingMap.get(type);
>-                        if (deployer != null) {
>-                            try {
>-                                deployer.deploy(currentDeploymentFile);
>-                            } catch (DeploymentException e) {
>-                                log.debug(e);
>-                            }
>-                        }
>+                    DeploymentFileData fileToDeploy = (DeploymentFileData) wsToDeploy.get(i);
>+                    try {
>+                        fileToDeploy.deploy();
>+                    } catch (DeploymentException e) {
>+                        // TODO : This probably isn't sufficient.  Maybe provide an option to stop?
>+                        log.info(e);
>                     }
>-
>                 }
>             }
>         } finally {
>@@ -629,6 +616,7 @@
>      *
>      * @param in : InputStream to axis2.xml
>      * @throws DeploymentException : If something goes wrong
>+     * @return a populated AxisConfiguration
>      */
>     public AxisConfiguration populateAxisConfiguration(InputStream in) throws DeploymentException {
>         axisConfig = new AxisConfiguration();
>@@ -661,8 +649,7 @@
>             if (wsToUnDeploy.size() > 0) {
>                 for (int i = 0; i < wsToUnDeploy.size(); i++) {
>                     WSInfo wsInfo = (WSInfo) wsToUnDeploy.get(i);
>-                    String fileType = wsInfo.getType();
>-                    if (TYPE_SERVICE.equals(fileType)) {
>+                    if (wsInfo.getType() == WSInfo.TYPE_SERVICE) {
>                         if (isHotUpdate()) {
>                             serviceDeployer.unDeploy(wsInfo.getFileName());
>                         } else {
>@@ -670,8 +657,7 @@
>                         }
>                     } else {
>                         if (isHotUpdate()) {
>-                            Deployer deployer =
>-                                    (Deployer) extensionToDeployerMappingMap.get(fileType);
>+                            Deployer deployer = wsInfo.getDeployer();
>                             if (deployer != null) {
>                                 deployer.unDeploy(wsInfo.getFileName());
>                             }
>@@ -698,7 +684,7 @@
>      * Retrieves service name from the archive file name.
>      * If the archive file name is service1.aar , then axis2 service name would be service1
>      *
>-     * @param fileName
>+     * @param fileName the archive file name
>      * @return Returns String.
>      */
>     public static String getAxisServiceName(String fileName) {
>@@ -741,7 +727,7 @@
>      * SCL  : Service class loader
>      *
>      * @param axis2repoURI : The repository folder of Axis2
>-     * @throws DeploymentException
>+     * @throws DeploymentException if there's a problem
>      */
>     protected void setClassLoaders(String axis2repoURI) throws DeploymentException {
>         ClassLoader sysClassLoader =
>@@ -794,7 +780,7 @@
>     /**
>      * Creates directories for modules/services, copies configuration xml from class loader if necessary
>      *
>-     * @param repositoryName
>+     * @param repositoryName the pathname of the repository
>      */
> 
>     protected void prepareRepository(String repositoryName) {
>@@ -884,23 +870,31 @@
>     }
> 
>     /**
>-     * Builds ModuleDescription for a given module archive file. This does not
>+     * Builds an AxisModule for a given module archive file. This does not
>      * called the init method since there is no reference to configuration context
>      * so who ever create module using this has to called module.init if it is
>      * required
>      *
>      * @param modulearchive : Actual module archive file
>      * @param config        : AxisConfiguration : for get classloaders etc..
>-     * @throws org.apache.axis2.deployment.DeploymentException
>+     * @throws org.apache.axis2.deployment.DeploymentException if there's a problem
>      *
>+     * @return a complete AxisModule read from the file.
>      */
>     public static AxisModule buildModule(File modulearchive,
>                                          AxisConfiguration config)
>             throws DeploymentException {
>+        final String MODULE_DEPLOYER = "moduleDeployer";
>         AxisModule axismodule;
>+        ModuleDeployer deployer = (ModuleDeployer)config.getParameterValue(MODULE_DEPLOYER);
>         try {
>+            if (deployer == null) {
>+                deployer = new ModuleDeployer(config);
>+                config.addParameter(MODULE_DEPLOYER, deployer);
>+            }
>+
>             DeploymentFileData currentDeploymentFile = new DeploymentFileData(modulearchive,
>-                                                                              DeploymentConstants.TYPE_MODULE);
>+                                                                              deployer);
>             axismodule = new AxisModule();
>             ArchiveReader archiveReader = new ArchiveReader();
> 
>@@ -944,24 +938,17 @@
>      * Loads all the required class and builds the chains, finally adds the
>      * servicecontext to EngineContext and axisservice into EngineConfiguration.
>      *
>-     * @param serviceInputStream
>-     * @param classLoader
>+     * @param serviceInputStream InputStream containing configuration data
>+     * @param configCtx the ConfigurationContext in which we're deploying
>      * @return Returns AxisService.
>-     * @throws DeploymentException
>+     * @throws DeploymentException if there's a problem
>      */
>     public static AxisService buildService(InputStream serviceInputStream,
>-                                           ClassLoader classLoader,
>                                            ConfigurationContext configCtx)
>             throws DeploymentException {
>         AxisService axisService = new AxisService();
>         try {
>-            DeploymentFileData currentDeploymentFile = new DeploymentFileData(
>-                    DeploymentConstants.TYPE_SERVICE, "");
>-            currentDeploymentFile.setClassLoader(classLoader);
>-
>-            ServiceBuilder builder = new ServiceBuilder(serviceInputStream, configCtx,
>-                                                        axisService);
>-
>+            ServiceBuilder builder = new ServiceBuilder(serviceInputStream, configCtx, axisService);
>             builder.populateService(builder.buildOM());
>         } catch (AxisFault axisFault) {
>             throw new DeploymentException(axisFault);
>@@ -976,10 +963,14 @@
>      * To build a AxisServiceGroup for a given services.xml
>      * You have to add the created group into AxisConfig
>      *
>-     * @param servicesxml      : inpupstream create using services.xml
>-     * @param classLoader      : corresponding class loader to load the class
>-     * @param serviceGroupName : name of the service group
>-     * @throws AxisFault
>+     * @param servicesxml InputStream created from services.xml or equivalent
>+     * @param classLoader ClassLoader to use
>+     * @param serviceGroupName name of the service group
>+     * @param configCtx the ConfigurationContext in which we're deploying
>+     * @param archiveReader the ArchiveReader we're working with
>+     * @param wsdlServices Map of existing WSDL services
>+     * @throws AxisFault if there's a problem
>+     * @return a fleshed-out AxisServiceGroup
>      */
>     public static AxisServiceGroup buildServiceGroup(InputStream servicesxml,
>                                                      ClassLoader classLoader,
>@@ -987,8 +978,7 @@
>                                                      ConfigurationContext configCtx,
>                                                      ArchiveReader archiveReader,
>                                                      HashMap wsdlServices) throws AxisFault {
>-        DeploymentFileData currentDeploymentFile = new DeploymentFileData(
>-                DeploymentConstants.TYPE_SERVICE, "");
>+        DeploymentFileData currentDeploymentFile = new DeploymentFileData(null, null);
>         currentDeploymentFile.setClassLoader(classLoader);
>         AxisServiceGroup serviceGroup = new AxisServiceGroup();
>         serviceGroup.setServiceGroupClassLoader(classLoader);
>@@ -1034,5 +1024,18 @@
> 
>     public RepositoryListener getRepoListener() {
>         return repoListener;
>+    }
>+
>+
>+    public ServiceDeployer getServiceDeployer() {
>+        return serviceDeployer;
>+    }
>+
>+    public ModuleDeployer getModuleDeployer() {
>+        return moduleDeployer;
>+    }
>+
>+    public Deployer getDeployerForExtension(String extension) {
>+        return (Deployer)extensionToDeployerMappingMap.get(extension);
>     }
> }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java Wed Apr 25 10:50:48 2007
>@@ -219,8 +219,7 @@
>                 .getChildrenWithName(new QName(TAG_MESSAGE_BUILDER));
>         while (msgBuilders.hasNext()) {
>             OMElement msgBuilderElement = (OMElement) msgBuilders.next();
>-            OMElement tempMsgBuilder = msgBuilderElement;
>-            OMAttribute builderName = tempMsgBuilder.getAttribute(new QName(TAG_CLASS_NAME));
>+            OMAttribute builderName = msgBuilderElement.getAttribute(new QName(TAG_CLASS_NAME));
>             String className = builderName.getAttributeValue();
>             Class builderClass = null;
>             Builder builderObject;
>@@ -397,7 +396,7 @@
> 
>         if (name_attribute == null) {
>             throw new DeploymentException(Messages.getMessage(
>-                    DeploymentErrorMsgs.INVALID_HANDLER, "Name missing"));
>+                    DeploymentErrorMsgs.INVALID_HANDLER, "Unknown", "Name missing"));
>         } else {
>             handler.setName(name_attribute.getAttributeValue());
>         }
>@@ -408,7 +407,7 @@
> 
>         if (class_attribute == null) {
>             throw new DeploymentException((Messages.getMessage(
>-                    DeploymentErrorMsgs.INVALID_HANDLER,
>+                    DeploymentErrorMsgs.INVALID_HANDLER, name_attribute.getAttributeValue(),
>                     "class name is missing")));
>         } else {
>             handler.setClassName(class_attribute.getAttributeValue());
>@@ -423,7 +422,7 @@
>             if (containingPhase == null) {
>                 // TODO : Include more information (which handler?) in message!
>                 throw new DeploymentException((Messages.getMessage(
>-                        DeploymentErrorMsgs.INVALID_HANDLER,
>+                        DeploymentErrorMsgs.INVALID_HANDLER, name_attribute.getAttributeValue(),
>                         "phase rule has not been specified")));
>             }
>             rules.setPhaseName(containingPhase);
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java Wed Apr 25 10:50:48 2007
>@@ -67,15 +67,19 @@
>                         repoLocation + "'");
>             }
>         }
>+
>         // Deal with the config file.  If a filename was specified as an
>         // arg to this constructor, just respect it.
>         if (axis2xml == null) {
>             // If not, check for a system property setting
>             axis2xml = System.getProperty(Constants.AXIS2_CONF);
> 
>-            // And if not that, try at the root of the repository
>+            // And if not that, try at the root of the repository if we have one.
>+            // It might be nice to default the repository to the current directory, but we don't yet
>             if (axis2xml == null) {
>-                axis2xml = repoLocation + File.separator + Constants.AXIS2_CONF;
>+                if (repoLocation != null) {
>+                    axis2xml = repoLocation + File.separator + Constants.AXIS2_CONF;
>+                }
>             }
> 
>             // In either case, check that the file exists... if not
>@@ -99,15 +103,15 @@
>      * @throws AxisFault
>      */
>     public synchronized AxisConfiguration getAxisConfiguration() throws AxisFault {
>-        InputStream axis2xmlSream;
>+        InputStream configStream;
>         try {
>             if (axis2xml != null && !"".equals(axis2xml)) {
>-                axis2xmlSream = new FileInputStream(axis2xml);
>+                configStream = new FileInputStream(axis2xml);
>             } else {
>-                axis2xmlSream =
>+                configStream =
>                         Loader.getResourceAsStream(DeploymentConstants.AXIS2_CONFIGURATION_RESOURCE);
>             }
>-            axisConfig = populateAxisConfiguration(axis2xmlSream);
>+            axisConfig = populateAxisConfiguration(configStream);
>         } catch (FileNotFoundException e) {
>             throw new AxisFault("System can not find the given axis2.xml " + axis2xml);
>         }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java Wed Apr 25 10:50:48 2007
>@@ -64,7 +64,7 @@
>         ClassLoader threadClassLoader = null;
>         try {
>             threadClassLoader = Thread.currentThread().getContextClassLoader();
>-            String extension = deploymentFileData.getType();
>+            String extension = DeploymentFileData.getFileExtension(deploymentFileData.getName());
>             if (".class".equals(extension)) {
>                 File file = deploymentFileData.getFile();
>                 if (file != null) {
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java Wed Apr 25 10:50:48 2007
>@@ -49,9 +49,8 @@
>      * then creates a WSInfoList to store information about available modules and services.
>      *
>      * @param deploymentEngine reference to engine registry for updates
>+     * @param isClasspath true if this RepositoryListener should scan the classpath for Modules
>      */
>-
>-    //The constructor , which loads modules from class path
>     public RepositoryListener(DeploymentEngine deploymentEngine, boolean isClasspath) {
>         this.deploymentEngine = deploymentEngine;
>         wsInfoList = new WSInfoList(deploymentEngine);
>@@ -78,11 +77,11 @@
>                 }
>                 if (!file.isDirectory()) {
>                     if (DeploymentFileData.isModuleArchiveFile(file.getName())) {
>-                        wsInfoList.addWSInfoItem(file, TYPE_MODULE);
>+                        addFileToDeploy(file, deploymentEngine.getModuleDeployer());
>                     }
>                 } else {
>                     if (!"lib".equalsIgnoreCase(file.getName())) {
>-                        wsInfoList.addWSInfoItem(file, TYPE_MODULE);
>+                        addFileToDeploy(file, deploymentEngine.getModuleDeployer());
>                     }
>                 }
>             }
>@@ -119,7 +118,7 @@
>                 if (!file.isDirectory()) {
>                     if (DeploymentFileData.isModuleArchiveFile(file.getName())) {
>                         //adding modules in the class path
>-                        wsInfoList.addWSInfoItem(file, TYPE_MODULE);
>+                        addFileToDeploy(file, deploymentEngine.getModuleDeployer());
>                     }
>                 }
>             }
>@@ -144,7 +143,7 @@
>                     if (file.isFile()) {
>                         if (DeploymentFileData.isModuleArchiveFile(file.getName())) {
>                             //adding modules in the class path
>-                            wsInfoList.addWSInfoItem(file, TYPE_MODULE);
>+                            addFileToDeploy(file, deploymentEngine.getModuleDeployer());
>                         }
>                     }
>                 }
>@@ -214,18 +213,20 @@
> 
>     private void findFileForGivenDirectory(String dir, String extension) {
>         try {
>-            File fileTobeSearch = new File(deploymentEngine.getRepositoryDir(), dir);
>-            if (fileTobeSearch.exists()) {
>-                File[] files = fileTobeSearch.listFiles();
>+            File directory = new File(deploymentEngine.getRepositoryDir(), dir);
>+            if (directory.exists()) {
>+                File[] files = directory.listFiles();
>                 if (files != null && files.length > 0) {
>                     for (int i = 0; i < files.length; i++) {
>                         File file = files[i];
>                         if (isSourceControlDir(file)) {
>                             continue;
>                         }
>-                        if (!file.isDirectory() && DeploymentFileData.getFileExtension(
>-                                file.getName()).equals(extension)) {
>-                            wsInfoList.addWSInfoItem(file, extension);
>+                        // TODO: Should this allow expanded directories like services/modules do?
>+                        if (!file.isDirectory() && extension.equals(
>+                                DeploymentFileData.getFileExtension(file.getName()))) {
>+                            addFileToDeploy(file,
>+                                            deploymentEngine.getDeployerForExtension(extension));
>                         }
>                     }
>                 }
>@@ -248,16 +249,23 @@
>                 }
>                 if (!file.isDirectory()) {
>                     if (DeploymentFileData.isServiceArchiveFile(file.getName())) {
>-                        wsInfoList.addWSInfoItem(file, TYPE_SERVICE);
>+                        addFileToDeploy(file, deploymentEngine.getServiceDeployer());
>+                    } else {
>+                        String ext = DeploymentFileData.getFileExtension(file.getName());
>+                        Deployer deployer = deploymentEngine.getDeployerForExtension(ext);
>+                        // If we found a deployer for this type of file, use it.  Otherwise
>+                        // ignore the file.
>+                        if (deployer != null) {
>+                            addFileToDeploy(file, deployer);
>+                        }
>                     }
>                 } else {
>                     if (!"lib".equalsIgnoreCase(file.getName())) {
>-                        wsInfoList.addWSInfoItem(file, TYPE_SERVICE);
>+                        addFileToDeploy(file, deploymentEngine.getServiceDeployer());
>                     }
>                 }
>             }
>         }
>-        wsInfoList.addWSInfoItem(null, TYPE_DEFAULT);
>     }
> 
>     /** Method invoked from the scheduler to start the listener. */
>@@ -277,4 +285,7 @@
>         update();
>     }
> 
>+    public void addFileToDeploy(File file, Deployer deployer) {
>+        wsInfoList.addWSInfoItem(file, deployer);
>+    }
> }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java Wed Apr 25 10:50:48 2007
>@@ -34,11 +34,11 @@
> 
>     private static final Log log = LogFactory.getLog(URLBasedAxisConfigurator.class);
>     private URL axis2xml;
>-    private URL repositoy;
>+    private URL repository;
> 
>-    public URLBasedAxisConfigurator(URL axis2xml, URL repositoy) throws AxisFault {
>+    public URLBasedAxisConfigurator(URL axis2xml, URL repository) throws AxisFault {
>         this.axis2xml = axis2xml;
>-        this.repositoy = repositoy;
>+        this.repository = repository;
>     }
> 
>     public AxisConfiguration getAxisConfiguration() throws AxisFault {
>@@ -51,7 +51,7 @@
>                 axis2xmlStream = axis2xml.openStream();
>             }
>             axisConfig = populateAxisConfiguration(axis2xmlStream);
>-            if (repositoy == null) {
>+            if (repository == null) {
>                 Parameter axis2repoPara = axisConfig.getParameter(DeploymentConstants.AXIS2_REPO);
>                 if (axis2repoPara != null) {
>                     String repoValue = (String) axis2repoPara.getValue();
>@@ -69,7 +69,7 @@
>                     loadFromClassPath();
>                 }
>             } else {
>-                loadRepositoryFromURL(repositoy);
>+                loadRepositoryFromURL(repository);
>             }
> 
>         } catch (IOException e) {
>@@ -81,7 +81,7 @@
>     //to load services
>     public void loadServices() {
>         try {
>-            if (repositoy == null) {
>+            if (repository == null) {
>                 Parameter axis2repoPara = axisConfig.getParameter(DeploymentConstants.AXIS2_REPO);
>                 if (axis2repoPara != null) {
>                     String repoValue = (String) axis2repoPara.getValue();
>@@ -96,7 +96,7 @@
>                     }
>                 }
>             } else {
>-                loadServicesFromUrl(repositoy);
>+                loadServicesFromUrl(repository);
>             }
>         } catch (MalformedURLException e) {
>             log.info(e);
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java Wed Apr 25 10:50:48 2007
>@@ -43,11 +43,9 @@
> import org.apache.axis2.i18n.Messages;
> import org.apache.axis2.namespace.Constants;
> import org.apache.axis2.util.XMLUtils;
>-import org.apache.axis2.wsdl.WSDLConstants;
> import org.apache.commons.logging.Log;
> import org.apache.commons.logging.LogFactory;
> 
>-import javax.xml.namespace.QName;
> import javax.xml.stream.XMLStreamException;
> import java.io.ByteArrayInputStream;
> import java.io.ByteArrayOutputStream;
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java Wed Apr 25 10:50:48 2007
>@@ -18,8 +18,9 @@
> package org.apache.axis2.deployment.repository.util;
> 
> import org.apache.axis2.AxisFault;
>-import org.apache.axis2.deployment.DeploymentClassLoader;
> import org.apache.axis2.deployment.DeploymentErrorMsgs;
>+import org.apache.axis2.deployment.Deployer;
>+import org.apache.axis2.deployment.DeploymentException;
> import org.apache.axis2.deployment.util.Utils;
> import org.apache.axis2.i18n.Messages;
> 
>@@ -36,17 +37,15 @@
>     private ClassLoader classLoader;
>     private String messageReceiver;
> 
>-    private String name;
>-    private String type;
>+    private Deployer deployer;
> 
>-    public DeploymentFileData(File file, String type) {
>+    public DeploymentFileData(File file) {
>         this.file = file;
>-        this.type = type;
>     }
> 
>-    public DeploymentFileData(String type, String name) {
>-        this.type = type;
>-        this.name = name;
>+    public DeploymentFileData(File file, Deployer deployer) {
>+        this.file = file;
>+        this.deployer = deployer;
>     }
> 
>     public String getAbsolutePath() {
>@@ -77,14 +76,10 @@
>         if (file != null) {
>             return file.getName();
>         } else {
>-            return name;
>+            return null;
>         }
>     }
> 
>-    public String getType() {
>-        return type;
>-    }
>-
>     public static boolean isModuleArchiveFile(String filename) {
>         return (filename.endsWith(".mar"));
>     }
>@@ -92,7 +87,7 @@
>     /**
>      * Checks whether a given file is a jar or an aar file.
>      *
>-     * @param filename
>+     * @param filename file to check
>      * @return Returns boolean.
>      */
>     public static boolean isServiceArchiveFile(String filename) {
>@@ -101,7 +96,7 @@
> 
>     public static String getFileExtension(String fileName) {
>         int index = fileName.lastIndexOf('.');
>-        return fileName.substring(index);
>+        return fileName.substring(index + 1);
>     }
> 
>     public void setClassLoader(ClassLoader classLoader) {
>@@ -136,5 +131,18 @@
> 
>     public void setMessageReceiver(String messageReceiver) {
>         this.messageReceiver = messageReceiver;
>+    }
>+
>+
>+    public Deployer getDeployer() {
>+        return deployer;
>+    }
>+
>+    public void setDeployer(Deployer deployer) {
>+        this.deployer = deployer;
>+    }
>+
>+    public void deploy() throws DeploymentException {
>+        deployer.deploy(this);
>     }
> }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java Wed Apr 25 10:50:48 2007
>@@ -17,26 +17,40 @@
> 
> package org.apache.axis2.deployment.repository.util;
> 
>+import org.apache.axis2.deployment.Deployer;
>+
> public class WSInfo {
>     private String fileName;
>     private long lastModifiedDate;
> 
>+    public static final int TYPE_SERVICE = 0;
>+    public static final int TYPE_MODULE = 1;
>+
>     /**
>      * To check whether the file is a module or a servise
>      */
>-    private String type;
>+    private int type = TYPE_SERVICE;
>+
>+    private Deployer deployer;
> 
>     public WSInfo(String filename, long lastmodifieddate) {
>         this.fileName = filename;
>         this.lastModifiedDate = lastmodifieddate;
>     }
> 
>-    public WSInfo(String filename, long lastmodifieddate, String type) {
>-        this.fileName = filename;
>-        this.lastModifiedDate = lastmodifieddate;
>+
>+    public WSInfo(String fileName, long lastModifiedDate, int type) {
>+        this.fileName = fileName;
>+        this.lastModifiedDate = lastModifiedDate;
>         this.type = type;
>     }
> 
>+    public WSInfo(String fileName, long lastModifiedDate, Deployer deployer) {
>+        this.fileName = fileName;
>+        this.lastModifiedDate = lastModifiedDate;
>+        this.deployer = deployer;
>+    }
>+
>     public String getFileName() {
>         return fileName;
>     }
>@@ -45,7 +59,7 @@
>         return lastModifiedDate;
>     }
> 
>-    public String getType() {
>+    public int getType() {
>         return type;
>     }
> 
>@@ -55,5 +69,9 @@
> 
>     public void setLastModifiedDate(long lastmodifieddate) {
>         this.lastModifiedDate = lastmodifieddate;
>+    }
>+    
>+    public Deployer getDeployer() {
>+        return deployer;
>     }
> }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java Wed Apr 25 10:50:48 2007
>@@ -19,12 +19,14 @@
> 
> import org.apache.axis2.deployment.DeploymentConstants;
> import org.apache.axis2.deployment.DeploymentEngine;
>-import org.apache.axis2.deployment.DeploymentException;
>+import org.apache.axis2.deployment.Deployer;
> 
> import java.io.File;
> import java.util.ArrayList;
> import java.util.Iterator;
> import java.util.List;
>+import java.util.Set;
>+import java.util.HashSet;
> 
> public class WSInfoList implements DeploymentConstants {
> 
>@@ -36,22 +38,22 @@
>     /**
>      * All the currently updated jars
>      */
>-    public List currentJars = new ArrayList();
>+    public Set currentJars = new HashSet();
> 
>     /**
>      * Reference to DeploymentEngine to make update
>      */
>-    private DeploymentEngine deployer;
>+    private final DeploymentEngine deploymentEngine;
> 
>     private boolean check;
> 
>     public WSInfoList(DeploymentEngine deploy_engine) {
>-        deployer = deploy_engine;
>+        deploymentEngine = deploy_engine;
>     }
> 
>     /**
>      * First checks whether the file is already available by the
>-     * system call isFileExist. If it is not deployed yet then adds to the jarList
>+     * system call fileExists. If it is not deployed yet then adds to the jarList
>      * and to the deployment engine as a new service or module.
>      * While adding new item to jarList, first creates the WSInfo object and
>      * then adds to the jarlist and actual jar file is added to DeploymentEngine.
>@@ -61,76 +63,21 @@
>      * DeploymentEngine - one for new deployment and other for undeployment.
>      *
>      * @param file actual jar files for either Module or service
>-     * @param type indicate either Service or Module
>      */
>-    public synchronized void addWSInfoItem(File file, String type) {
>-        if (TYPE_SERVICE.equals(type)) {
>-            if (!isFileExist(file.getName())) {    // checking whether the file is already deployed
>-                WSInfo wsInfo = new WSInfo(file.getName(), file.lastModified(), TYPE_SERVICE);
>-                jarList.add(wsInfo);
>-                DeploymentFileData deploymentFileData =
>-                        new DeploymentFileData(file, TYPE_SERVICE);
>-                deployer.addWSToDeploy(
>-                        deploymentFileData);    // inform that new web service is deployed
>-            } else {
>-                if (deployer.isHotUpdate()) {
>-                    WSInfo tempWSInfo = getFileItem(file.getName());
>-                    if (isModified(file, tempWSInfo)) {    // check whether file is updated
>-                        tempWSInfo.setLastModifiedDate(file.lastModified());
>-                        WSInfo wsInfo = new WSInfo(tempWSInfo.getFileName(),
>-                                                   tempWSInfo.getLastModifiedDate(), TYPE_SERVICE);
>-                        deployer.addWSToUndeploy(wsInfo);           // add entry to undeploy list
>-                        DeploymentFileData deploymentFileData = new DeploymentFileData(file,
>-                                                                                       TYPE_SERVICE);
>-                        deployer.addWSToDeploy(deploymentFileData);    // add entry to deploylist
>-                    }
>-                }
>-            }
>-        } else if (TYPE_MODULE.equals(type)) {
>-            if (!isFileExist(file.getName()))
>-            {                     // checking whether the file is already deployed
>-                WSInfo wsInfo = new WSInfo(file.getName(), file.lastModified(), TYPE_MODULE);
>-                jarList.add(wsInfo);
>-                DeploymentFileData deploymentFileData =
>-                        new DeploymentFileData(file, TYPE_MODULE);
>-                deployer.addWSToDeploy(
>-                        deploymentFileData);    // inform that new web service is deployed
>-            }
>-        } else {
>-            if (file != null) {
>-                String extension = DeploymentFileData.getFileExtension(file.getName());
>-                if (!isFileExist(file.getName())) {
>-                    WSInfo wsInfo = new WSInfo(file.getName(), file.lastModified(), extension);
>-                    jarList.add(wsInfo);
>-                    DeploymentFileData deploymentFileData =
>-                            new DeploymentFileData(file, extension);
>-                    deployer.addWSToDeploy(
>-                            deploymentFileData);    // inform that new web service is deployed
>-                } else {
>-                    if (deployer.isHotUpdate()) {
>-                        WSInfo tempWSInfo = getFileItem(file.getName());
>-                        if (isModified(file, tempWSInfo)) {    // check whether file is updated
>-                            tempWSInfo.setLastModifiedDate(file.lastModified());
>-                            WSInfo wsInfo = new WSInfo(tempWSInfo.getFileName(),
>-                                                       tempWSInfo.getLastModifiedDate(), extension);
>-                            deployer.addWSToUndeploy(
>-                                    wsInfo);           // add entry to undeploy list
>-                            DeploymentFileData deploymentFileData = new DeploymentFileData(file,
>-                                                                                           extension);
>-                            deployer.addWSToDeploy(
>-                                    deploymentFileData);    // add entry to deploylist
>-                        }
>-                    }
>-                }
>-            } else {
>-                check = true;
>-            }
>+    public synchronized void addWSInfoItem(File file, Deployer deployer) {
>+        WSInfo info = getFileItem(file.getName());
>+        if (info == null) {
>+            info = new WSInfo(file.getName(), file.lastModified(), deployer);
>+            jarList.add(info);
>+            DeploymentFileData fileData = new DeploymentFileData(file, deployer);
>+            deploymentEngine.addWSToDeploy(fileData);
>+        } else if (deploymentEngine.isHotUpdate() && isModified(file, info)) {
>+            info.setLastModifiedDate(file.lastModified());
>+            WSInfo wsInfo = new WSInfo(info.getFileName(), info.getLastModifiedDate(), deployer);
>+            deploymentEngine.addWSToUndeploy(wsInfo);           // add entry to undeploy list
>+            DeploymentFileData deploymentFileData = new DeploymentFileData(file, deployer);
>+            deploymentEngine.addWSToDeploy(deploymentFileData);    // add entry to deploylist
>         }
>-        if (file != null) {
>-            String jarname = file.getName();
>-            currentJars.add(jarname);
>-        }
>-        check = true;
>     }
> 
>     /**
>@@ -147,33 +94,18 @@
>         }
> 
>         Iterator iter = jarList.listIterator();
>-        int size = currentJars.size();
>         List tempvector = new ArrayList();
> 
>-        tempvector.clear();
>-
>-        String filename;
>-        boolean exist;
>-
>         while (iter.hasNext()) {
>             WSInfo fileitem = (WSInfo) iter.next();
>-            if (TYPE_MODULE.equals(fileitem.getType())) {
>+            if (fileitem.getType() == WSInfo.TYPE_MODULE) {
>                 continue;
>             }
>-            exist = false;
>-            for (int i = 0; i < size; i++) {
>-                filename = (String) currentJars.get(i);
>-                if (filename.equals(fileitem.getFileName())) {
>-                    exist = true;
>-                    break;
>-                }
>-            }
>-            if (!exist) {
>+            String itemName = fileitem.getFileName();
>+            if (!currentJars.contains(itemName)) {
>                 tempvector.add(fileitem);
>-                WSInfo wsInfo = new WSInfo(fileitem.getFileName(), fileitem.getLastModifiedDate(),
>-                                           fileitem.getType());
>-
>-                deployer.addWSToUndeploy(wsInfo);    // this is to be undeployed
>+                WSInfo wsInfo = new WSInfo(fileitem.getFileName(), fileitem.getLastModifiedDate());
>+                deploymentEngine.addWSToUndeploy(wsInfo);    // this is to be undeployed
>             }
>         }
>         for (int i = 0; i < tempvector.size(); i++) {
>@@ -195,10 +127,10 @@
>      *
>      */
>     public void update() {
>-        synchronized (deployer) {
>+        synchronized (deploymentEngine) {
>             checkForUndeployedServices();
>-            deployer.unDeploy();
>-            deployer.doDeploy();
>+            deploymentEngine.unDeploy();
>+            deploymentEngine.doDeploy();
>         }
>     }
> 
>@@ -217,15 +149,6 @@
>             }
>         }
>         return null;
>-    }
>-
>-    /**
>-     * Checks whether the file already exists in the list.
>-     *
>-     * @param filename
>-     */
>-    private boolean isFileExist(String filename) {
>-        return !(getFileItem(filename) == null);
>     }
> 
>     /**
>
>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=532422&r1=532421&r2=532422
>==============================================================================
>--- 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 Wed Apr 25 10:50:48 2007
>@@ -490,8 +490,7 @@
>                     File inputFile = Utils.createTempFile(servicename,
>                             fin,
>                             (File)axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
>-                    DeploymentFileData filedata = new DeploymentFileData(inputFile,
>-                                                                         DeploymentConstants.TYPE_SERVICE);
>+                    DeploymentFileData filedata = new DeploymentFileData(inputFile);
> 
>                     filedata.setClassLoader(false,
>                                             moduleClassLoader,
>@@ -509,8 +508,7 @@
>                         }
>                     }
>                     AxisServiceGroup serviceGroup = new AxisServiceGroup(axisConfig);
>-                    serviceGroup.setServiceGroupClassLoader(
>-                            filedata.getClassLoader());
>+                    serviceGroup.setServiceGroupClassLoader(filedata.getClassLoader());
>                     ArrayList serviceList = archiveReader.processServiceGroup(
>                             filedata.getAbsolutePath(), filedata,
>                             serviceGroup, false, wsdlservice,
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java Wed Apr 25 10:50:48 2007
>@@ -51,7 +51,6 @@
>     }
> 
>     public void addParameter(Parameter param) throws AxisFault {
>-
>         if (param == null) {
>             return;
>         }
>@@ -62,6 +61,10 @@
>         }
> 
>         parameterInclude.addParameter(param);
>+    }
>+
>+    public void addParameter(String name, Object value) throws AxisFault {
>+        addParameter(new Parameter(name, value));
>     }
> 
>     public void removeParameter(Parameter param) throws AxisFault {
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java Wed Apr 25 10:50:48 2007
>@@ -133,13 +133,13 @@
>         soap12 = ele.declareNamespace(URI_WSDL12_SOAP, SOAP12_PREFIX);
>         http = ele.declareNamespace(HTTP_NAMESPACE, HTTP_PREFIX);
>         mime = ele.declareNamespace(MIME_NAMESPACE, MIME_PREFIX);
>-        String prefix = WSDLSerializationUtil.getPrefix(axisService.getTargetNamespace(), namespaceMap);
>+        String prefix = WSDLSerializationUtil.getPrefix(axisService.getTargetNamespace(),
>+                                                        namespaceMap);
>         if (prefix == null || "".equals(prefix)) {
>             prefix = DEFAULT_TARGET_NAMESPACE_PREFIX;
>         }
> 
>-        namespaceMap.put(prefix,
>-                                           axisService.getTargetNamespace());
>+        namespaceMap.put(prefix, axisService.getTargetNamespace());
>         tns = ele.declareNamespace(axisService.getTargetNamespace(), prefix);
> 
>         // adding documentation element
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DispatchPhase.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DispatchPhase.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DispatchPhase.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DispatchPhase.java Wed Apr 25 10:50:48 2007
>@@ -1,16 +1,30 @@
> package org.apache.axis2.engine;
> 
> import org.apache.axis2.AxisFault;
>+import org.apache.axis2.Constants;
>+import org.apache.axis2.util.JavaUtils;
> import org.apache.axis2.addressing.AddressingHelper;
> import org.apache.axis2.addressing.EndpointReference;
> import org.apache.axis2.context.MessageContext;
>+import org.apache.axis2.context.SessionContext;
>+import org.apache.axis2.context.ServiceGroupContext;
>+import org.apache.axis2.context.ContextFactory;
>+import org.apache.axis2.context.ServiceContext;
>+import org.apache.axis2.context.OperationContext;
> import org.apache.axis2.description.AxisService;
>+import org.apache.axis2.description.AxisOperation;
>+import org.apache.axis2.description.AxisServiceGroup;
> import org.apache.axis2.i18n.Messages;
> import org.apache.axis2.transport.RequestResponseTransport;
>+import org.apache.axis2.transport.TransportListener;
>+import org.apache.axis2.transport.http.HTTPConstants;
> import org.apache.axis2.wsdl.WSDLConstants.WSDL20_2004_Constants;
>+import org.apache.axiom.soap.SOAPHeader;
>+import org.apache.axiom.om.OMElement;
> 
> import java.util.ArrayList;
> import java.util.List;
>+import java.util.Iterator;
> 
> /*
> * Copyright 2004,2005 The Apache Software Foundation.
>@@ -44,13 +58,36 @@
>         if (msgContext.getAxisService() == null) {
>             throw new AxisFault(Messages.getMessage("servicenotfoundforepr",
>                                                     ((toEPR != null) ? toEPR.getAddress() : "")));
>-        } else if (msgContext.getAxisOperation() == null) {
>+        }
>+
>+        AxisService service = msgContext.getAxisService();
>+        AxisOperation operation = msgContext.getAxisOperation();
>+        // If we're configured to do so, check the service for a single op...
>+        if (operation == null &&
>+                JavaUtils.isTrue(service.getParameterValue("supportSingleOperation"))) {
>+            Iterator ops = service.getOperations();
>+            // If there's exactly one, that's the one we want.  If there's more, forget it.
>+            if (ops.hasNext()) {
>+                operation = (AxisOperation)ops.next();
>+                if (ops.hasNext()) {
>+                    operation = null;
>+                }
>+            }
>+        }
>+
>+        // If we still don't have an operation, fault.
>+        if (operation == null) {
>             throw new AxisFault(Messages.getMessage("operationnotfoundforepr",
>                                                     ((toEPR != null) ? toEPR.getAddress()
>                                                             : ""), msgContext.getWSAAction()));
>         }
> 
>+        msgContext.setAxisOperation(operation);
>+        
>         validateTransport(msgContext);
>+
>+        loadContexts(service, msgContext);
>+
>         if (msgContext.getOperationContext() == null) {
>             throw new AxisFault(Messages.getMessage("cannotBeNullOperationContext"));
>         }
>@@ -59,6 +96,7 @@
>             throw new AxisFault(Messages.getMessage("cannotBeNullServiceContext"));
>         }
> 
>+        // TODO - review this
>         if ((msgContext.getAxisOperation() == null) && (msgContext.getOperationContext() != null)) {
>             msgContext.setAxisOperation(msgContext.getOperationContext().getAxisOperation());
>         }
>@@ -96,6 +134,59 @@
>         msgContext.setExecutionChain((ArrayList) operationChain.clone());
>     }
> 
>+    private void loadContexts(AxisService service, MessageContext msgContext) throws AxisFault {
>+        String scope = service == null ? null : service.getScope();
>+        ServiceContext serviceContext = msgContext.getServiceContext();
>+
>+        if ((msgContext.getOperationContext() != null)
>+                && (serviceContext != null)) {
>+            msgContext.setServiceGroupContextId(
>+                    ((ServiceGroupContext) serviceContext.getParent()).getId());
>+            return;
>+        }
>+        if (Constants.SCOPE_TRANSPORT_SESSION.equals(scope)) {
>+            fillContextsFromSessionContext(msgContext);
>+        }
>+
>+        AxisOperation axisOperation = msgContext.getAxisOperation();
>+        if (axisOperation == null) {
>+            return;
>+        }
>+        OperationContext operationContext =
>+                axisOperation.findForExistingOperationContext(msgContext);
>+
>+        if (operationContext != null) {
>+            // register operation context and message context
>+//            axisOperation.registerOperationContext(msgContext, operationContext);
>+            axisOperation.registerMessageContext(msgContext, operationContext);
>+
>+            serviceContext = (ServiceContext) operationContext.getParent();
>+            ServiceGroupContext serviceGroupContext =
>+                    (ServiceGroupContext) serviceContext.getParent();
>+
>+            msgContext.setServiceContext(serviceContext);
>+            msgContext.setServiceGroupContext(serviceGroupContext);
>+            msgContext.setServiceGroupContextId(serviceGroupContext.getId());
>+        } else {    // 2. if null, create new opCtxt
>+            operationContext = ContextFactory.createOperationContext(axisOperation, serviceContext);
>+
>+            axisOperation.registerMessageContext(msgContext, operationContext);
>+            if (serviceContext != null) {
>+                // no need to added to configuration conetxt , since we are happy in
>+                //  storing in session context
>+                operationContext.setParent(serviceContext);
>+            } else {
>+                // fill the service group context and service context info
>+                msgContext.getConfigurationContext().fillServiceContextAndServiceGroupContext(
>+                        msgContext);
>+            }
>+        }
>+        serviceContext = msgContext.getServiceContext();
>+        if (serviceContext != null) {
>+            serviceContext.setMyEPR(msgContext.getTo());
>+        }
>+    }
>+
>     /**
>      * To check wether the incoming request has come in valid transport , simpley the transports
>      * that service author wants to expose
>@@ -119,5 +210,57 @@
>         EndpointReference toEPR = msgctx.getTo();
>         throw new AxisFault(Messages.getMessage("servicenotfoundforepr",
>                                                 ((toEPR != null) ? toEPR.getAddress() : "")));
>+    }
>+
>+    private void fillContextsFromSessionContext(MessageContext msgContext) throws AxisFault {
>+        AxisService service = msgContext.getAxisService();
>+        if (service == null) {
>+            throw new AxisFault(Messages.getMessage("unabletofindservice"));
>+        }
>+        SessionContext sessionContext = msgContext.getSessionContext();
>+        if (sessionContext == null) {
>+            TransportListener listener = msgContext.getTransportIn().getReceiver();
>+            sessionContext = listener.getSessionContext(msgContext);
>+            if (sessionContext == null) {
>+                createAndFillContexts(service, msgContext, sessionContext);
>+                return;
>+            }
>+        }
>+        String serviceGroupName = msgContext.getAxisServiceGroup().getServiceGroupName();
>+        ServiceGroupContext serviceGroupContext = sessionContext.getServiceGroupContext(
>+                serviceGroupName);
>+        if (serviceGroupContext != null) {
>+            //setting service group context
>+            msgContext.setServiceGroupContext(serviceGroupContext);
>+            // setting Service conetxt
>+            msgContext.setServiceContext(
>+                    ContextFactory.createServiceContext(serviceGroupContext, service));
>+        } else {
>+            createAndFillContexts(service, msgContext, sessionContext);
>+        }
>+        ServiceContext serviceContext = sessionContext.getServiceContext(service);
>+        //found the serviceContext from session context , so adding that into msgContext
>+        if (serviceContext != null) {
>+            msgContext.setServiceContext(serviceContext);
>+            serviceContext.setProperty(HTTPConstants.COOKIE_STRING, sessionContext.getCookieID());
>+        }
>+    }
>+
>+    private void createAndFillContexts(AxisService service,
>+                                       MessageContext msgContext,
>+                                       SessionContext sessionContext) throws AxisFault {
>+        ServiceGroupContext serviceGroupContext;
>+        AxisServiceGroup axisServiceGroup = (AxisServiceGroup) service.getParent();
>+        serviceGroupContext = ContextFactory.createServiceGroupContext(
>+                msgContext.getConfigurationContext(), axisServiceGroup);
>+
>+        msgContext.setServiceGroupContext(serviceGroupContext);
>+        ServiceContext serviceContext =
>+                ContextFactory.createServiceContext(serviceGroupContext, service);
>+        msgContext.setServiceContext(serviceContext);
>+        if (sessionContext != null) {
>+            sessionContext.addServiceContext(serviceContext);
>+            sessionContext.addServiceGroupContext(serviceGroupContext);
>+        }
>     }
> }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties Wed Apr 25 10:50:48 2007
>@@ -160,7 +160,7 @@
> transportSenderError=The TransportSender implementation class is required for the transport {0}
> obsererror=An implemenation class of the Observer object is required.
> invalidmoduleconfig=A module configuration exists that is not valid.
>-invalidhandler=The following handler exists is not valid: {0}
>+invalidhandler=Invalid handler config!  Name: {0} Reason: {1}
> parameterlockederror=The {0} parameter is locked at the top level and cannot be overridden.
> op_error=Processing Operations Modules with an error of {0}
> servicenameeror=A service name is required.
>
>Added: webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/axis2.xml
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/axis2.xml?view=auto&rev=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/axis2.xml (added)
>+++ webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/axis2.xml Wed Apr 25 10:50:48 2007
>@@ -0,0 +1,290 @@
>+<!--
>+/*
>+ * Copyright 2001-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.
>+ */
>+ -->
>+
>+<axisconfig name="AxisJava2.0">
>+    <!-- ================================================= -->
>+    <!-- Parameters -->
>+    <!-- ================================================= -->
>+    <parameter name="hotdeployment">true</parameter>
>+    <parameter name="hotupdate">false</parameter>
>+    <parameter name="enableMTOM">false</parameter>
>+    <parameter name="enableSwA">false</parameter>
>+
>+    <!--Uncomment if you want to enable file caching for attachments -->
>+    <!--parameter name="cacheAttachments">true</parameter>
>+    <parameter name="attachmentDIR"></parameter>
>+    <parameter name="sizeThreshold">4000</parameter-->
>+
>+    <!--This will give out the timout of the configuration contexts, in milliseconds-->
>+    <parameter name="ConfigContextTimeoutInterval">30000</parameter>
>+
>+    <!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
>+    <!--that behaviour.-->
>+    <parameter name="sendStacktraceDetailsWithFaults">false</parameter>
>+
>+    <!--If there aren't any information available to find out the fault reason, we set the message of the expcetion-->
>+    <!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
>+    <!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
>+    <!--is set then, Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
>+    <parameter name="DrillDownToRootCauseForFaultReason">false</parameter>
>+
>+    <parameter name="userName">admin</parameter>
>+    <parameter name="password">axis2</parameter>
>+
>+    <!--To override repository/services you need to uncomment following parameter and value SHOULD be absolute file path.-->
>+    <!--<parameter name="ServicesDirectory">service</parameter>-->
>+    <!--To override repository/modules you need to uncomment following parameter and value SHOULD be absolute file path-->
>+    <!--<parameter name="ModulesDirectory">modules</parameter>-->
>+
>+
>+
>+    <!--Following params will set the proper context paths for invocations. All the endpoints will have a commons context-->
>+    <!--root which can configured using the following contextRoot parameter-->
>+    <!--<parameter name="contextRoot">axis2</parameter>-->
>+
>+    <!--Our HTTP endpoints can handle both REST and SOAP. Following parameters can be used to distingiush those endpoints-->
>+    <!--In case of a servlet, if you change this you have to manually change the settings of your servlet container to map this -->
>+    <!--context path to proper Axis2 servlets-->
>+    <!--<parameter name="servicePath">services</parameter>-->
>+    <!--<parameter name="restPath">rest</parameter>-->
>+
>+    <!-- Following parameter will completely disable REST handling in Axis2-->
>+    <parameter name="disableREST" locked="true">false</parameter>
>+
>+    <!-- If you have a frontend host which exposes this webservice using a different public URL  -->
>+    <!-- use this parameter to override autodetected url -->
>+    <!--<parameter name="httpFrontendHostUrl">https://someotherhost/context</parameter>-->
>+
>+
>+    <!--    The way of adding listener to the system-->
>+    <!--    <listener class="org.apache.axis2.ObserverIMPL">-->
>+    <!--        <parameter name="RSS_URL">http://127.0.0.1/rss</parameter>-->
>+    <!--    </listener>-->
>+
>+    <!-- ================================================= -->
>+    <!-- Message Receivers -->
>+    <!-- ================================================= -->
>+    <!--This is the Deafult Message Receiver for the system , if you want to have MessageReceivers for -->
>+    <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
>+    <!--any operation -->
>+    <!--Note : You can ovride this for particular service by adding the same element with your requirement-->
>+     <messageReceivers>
>+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
>+                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
>+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
>+                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
>+        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-only"
>+                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
>+        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-out"
>+                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
>+    </messageReceivers>
>+
>+    <!-- ================================================= -->
>+    <!-- Message Formatter -->
>+    <!-- ================================================= -->
>+    <!--Following content type to message formatter mapping can be used to implement support for different message -->
>+    <!--format  serialization in Axis2. These message formats are expected to be resolved based on the content type. -->
>+    <messageFormatters>
>+        <messageFormatter contentType="application/x-www-form-urlencoded"
>+                         class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
>+        <messageFormatter contentType="multipart/form-data"
>+                         class="org.apache.axis2.transport.http.MultipartFormDataFormatter"/>
>+        <messageFormatter contentType="application/xml"
>+                         class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
>+    </messageFormatters>
>+
>+    <!-- Test custom deployment by registering for "svc" files, and the "widgets" dir -->
>+    <deployer extension="svc" directory="widgets"
>+            class="org.apache.axis2.deployment.deployers.CustomDeployer"/>
>+
>+    <!-- ================================================= -->
>+    <!-- Message Builders -->
>+    <!-- ================================================= -->
>+    <!--Following content type to builder mapping can be used to implement support for different message -->
>+    <!--formats in Axis2. These message formats are expected to be resolved based on the content type. -->
>+    <messageBuilders>
>+        <messageBuilder contentType="application/xml"
>+                         class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
>+        <messageBuilder contentType="application/x-www-form-urlencoded"
>+                         class="org.apache.axis2.builder.XFormURLEncodedBuilder"/>
>+        <messageBuilder contentType="multipart/form-data"
>+                         class="org.apache.axis2.builder.MultipartFormDataBuilder"/>
>+    </messageBuilders>
>+
>+    <!-- ================================================= -->
>+    <!-- Transport Ins -->
>+    <!-- ================================================= -->
>+    <transportReceiver name="http"
>+                       class="org.apache.axis2.transport.http.SimpleHTTPServer">
>+        <parameter name="port">8080</parameter>
>+        <!-- Here is the complete list of supported parameters (see example settings further below):
>+            port: the port to listen on (default 6060)
>+            hostname:  if non-null, url prefix used in reply-to endpoint references                                 (default null)
>+            originServer:  value of http Server header in outgoing messages                                         (default "Simple-Server/1.1")
>+            requestTimeout:  value in millis of time that requests can wait for data                                (default 20000)
>+            requestTcpNoDelay:  true to maximize performance and minimize latency                                   (default true)
>+                                false to minimize bandwidth consumption by combining segments
>+            requestCoreThreadPoolSize:  number of threads available for request processing (unless queue fills up)  (default 25)
>+            requestMaxThreadPoolSize:  number of threads available for request processing if queue fills us         (default 150)
>+                                       note that default queue never fills up:  see HttpFactory
>+            threadKeepAliveTime:  time to keep threads in excess of core size alive while inactive                  (default 180)
>+                                  note that no such threads can exist with default unbounded request queue
>+            threadKeepAliveTimeUnit:  TimeUnit of value in threadKeepAliveTime (default SECONDS)                    (default SECONDS)
>+        -->
>+        <!-- <parameter name="hostname">http://www.myApp.com/ws</parameter> -->
>+        <!-- <parameter name="originServer">My-Server/1.1</parameter>           -->
>+        <!-- <parameter name="requestTimeout">10000</parameter>                   -->
>+        <!-- <parameter name="requestTcpNoDelay">false</parameter>                   -->
>+        <!-- <parameter name="requestCoreThreadPoolSize">50</parameter>                      -->
>+        <!-- <parameter name="RequestMaxThreadPoolSize">100</parameter>                     -->
>+        <!-- <parameter name="threadKeepAliveTime">240000</parameter>                  -->
>+        <!-- <parameter name="threadKeepAliveTimeUnit">MILLISECONDS</parameter>            -->
>+    </transportReceiver>
>+
>+    <!-- ================================================= -->
>+    <!-- Transport Outs -->
>+    <!-- ================================================= -->
>+
>+    <transportSender name="tcp"
>+                     class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
>+    <transportSender name="local"
>+                     class="org.apache.axis2.transport.local.LocalTransportSender"/>
>+    <transportSender name="http"
>+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
>+        <parameter name="PROTOCOL">HTTP/1.1</parameter>
>+        <parameter name="Transfer-Encoding">chunked</parameter>
>+
>+        <!-- If following is set to 'true', optional action part of the Content-Type will not be added to the SOAP 1.2 messages -->
>+        <!--  <parameter name="OmitSOAP12Action">true</parameter>  -->
>+    </transportSender>
>+
>+    <transportSender name="https"
>+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
>+        <parameter name="PROTOCOL">HTTP/1.1</parameter>
>+        <parameter name="Transfer-Encoding">chunked</parameter>
>+    </transportSender>
>+    <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
>+    <transportSender name="jms"
>+                     class="org.apache.axis2.transport.jms.JMSSender"/>
>+    -->
>+
>+    <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
>+   <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
>+       <parameter name="transport.mail.smtp.host">127.0.0.1</parameter>
>+       <parameter name="transport.mail.smtp.user">axis2</parameter>
>+       <parameter name="transport.mail.smtp.password">axis2</parameter>
>+       <parameter name="transport.mail.smtp.port">25</parameter>
>+   </transportSender>
>+   -->
>+
>+    <!-- ================================================= -->
>+    <!-- Global Modules  -->
>+    <!-- ================================================= -->
>+    <!-- Comment this to disable Addressing -->
>+    <!--<module ref="addressing"/>-->
>+
>+    <!--Configuring module , providing parameters for modules whether they refer or not-->
>+    <!--<moduleConfig name="addressing">-->
>+    <!--<parameter name="addressingPara">N/A</parameter>-->
>+    <!--</moduleConfig>-->
>+
>+    <!-- ================================================= -->
>+    <!-- Clustering  -->
>+    <!-- ================================================= -->
>+    <!-- Configure and uncomment following for preparing Axis2 to a clustered environment -->
>+    <!--
>+    <cluster class="org.apache.axis2.cluster.tribes.TribesClusterManager">
>+        <parameter name="param1">value1</parameter>
>+    	<configurationManager class="org.apache.axis2.cluster.tribes.configuration.TribesConfigurationManager">
>+    	    <listeners>
>+    	    </listeners>
>+    	</configurationManager>
>+    	<contextManager class="org.apache.axis2.cluster.tribes.context.TribesContextManager">
>+    	    <listeners>
>+    	    </listeners>
>+    	</contextManager>
>+    </cluster>
>+    -->
>+
>+    <!-- ================================================= -->
>+    <!-- Phases  -->
>+    <!-- ================================================= -->
>+    <phaseOrder type="InFlow">
>+        <!--  System pre defined phases       -->
>+        <phase name="Transport">
>+            <handler name="RequestURIBasedDispatcher"
>+                     class="org.apache.axis2.engine.RequestURIBasedDispatcher"/>
>+            <handler name="SOAPActionBasedDispatcher"
>+                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher"/>
>+        </phase>
>+        <phase name="Security"/>
>+        <phase name="PreDispatch"/>
>+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
>+            <handler name="AddressingBasedDispatcher"
>+                     class="org.apache.axis2.engine.AddressingBasedDispatcher"/>
>+            <handler name="RequestURIOperationDispatcher"
>+                     class="org.apache.axis2.engine.RequestURIOperationDispatcher"/>
>+            <handler name="SOAPMessageBodyBasedDispatcher"
>+                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher"/>
>+            <handler name="HTTPLocationBasedDispatcher"
>+                     class="org.apache.axis2.engine.HTTPLocationBasedDispatcher"/>
>+        </phase>
>+        <!--  System pre defined phases       -->
>+        <!--   After Postdispatch phase module author or or service author can add any phase he want      -->
>+        <phase name="OperationInPhase"/>
>+	<phase name="soapmonitorPhase"/>
>+    </phaseOrder>
>+    <phaseOrder type="OutFlow">
>+        <!--      user can add his own phases to this area  -->
>+	<phase name="soapmonitorPhase"/>
>+        <phase name="OperationOutPhase"/>
>+        <!--system predefined phase-->
>+        <!--these phase will run irrespective of the service-->
>+        <phase name="PolicyDetermination"/>
>+        <phase name="MessageOut"/>
>+        <phase name="Security"/>
>+    </phaseOrder>
>+    <phaseOrder type="InFaultFlow">
>+        <phase name="PreDispatch"/>
>+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
>+            <handler name="RequestURIBasedDispatcher"
>+                     class="org.apache.axis2.engine.RequestURIBasedDispatcher"/>
>+            <handler name="SOAPActionBasedDispatcher"
>+                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher"/>
>+            <handler name="AddressingBasedDispatcher"
>+                     class="org.apache.axis2.engine.AddressingBasedDispatcher"/>
>+            <handler name="RequestURIOperationDispatcher"
>+                     class="org.apache.axis2.engine.RequestURIOperationDispatcher"/>
>+            <handler name="SOAPMessageBodyBasedDispatcher"
>+                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher"/>
>+            <handler name="HTTPLocationBasedDispatcher"
>+                     class="org.apache.axis2.engine.HTTPLocationBasedDispatcher"/>
>+        </phase>
>+        <!--      user can add his own phases to this area  -->
>+        <phase name="OperationInFaultPhase"/>
>+	<phase name="soapmonitorPhase"/>
>+    </phaseOrder>
>+    <phaseOrder type="OutFaultFlow">
>+        <!--      user can add his own phases to this area  -->
>+	<phase name="soapmonitorPhase"/>
>+        <phase name="OperationOutFaultPhase"/>
>+        <phase name="PolicyDetermination"/>
>+        <phase name="MessageOut"/>
>+    </phaseOrder>
>+</axisconfig>
>+
>
>Added: webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/george.svc
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/george.svc?view=auto&rev=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/george.svc (added)
>+++ webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/george.svc Wed Apr 25 10:50:48 2007
>@@ -0,0 +1 @@
>+This is a custom service deployment in the services/ directory.  Its name is George.
>
>Added: webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/mary.svc
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/mary.svc?view=auto&rev=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/mary.svc (added)
>+++ webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/mary.svc Wed Apr 25 10:50:48 2007
>@@ -0,0 +1 @@
>+This is a custom service deployment in the widgets/ directory.  Its name is Mary.
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
>For additional commands, e-mail: axis-cvs-help@ws.apache.org
>
>
>
>  
>

-- 
Thanks,
Deepal
................................................................
"The highest tower is built one brick at a time"



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


Re: svn commit: r532422 [1/2] - in /webservices/axis2/trunk/java/modules/kernel: src/org/apache/axis2/context/ src/org/apache/axis2/deployment/ src/org/apache/axis2/deployment/repository/util/ src/org/apache/axis2/deployment/util/ src/org/apache/axis2/desc...

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi Glen,

I did not check but when I go though your changes I found you have
remove hot deployment feature of Axis2.

Can you please wait till I do Axis2 1.2 release ,  I am bit busy with
the release and I do not have enough time to check what you have done.
Believe me I have very good experience when someone else come and modify
Axis2 deployment and break Axis2 functionality without knowing history .
Therefore I relay need to look at carefully when someone change
Deployment code.

I am -1 on this kind of changes , first we need to discuss when we are
going to do a major changes.

Thanks
Deepal

gdaniels@apache.org wrote:

>Author: gdaniels
>Date: Wed Apr 25 10:50:48 2007
>New Revision: 532422
>
>URL: http://svn.apache.org/viewvc?view=rev&rev=532422
>Log:
>* Refactor deployment a bit to clean things up and get custom deployers actually working.  Get rid of a bunch of code that looked at (via string compares) the "type" field in order to decide what to do, and instead use polymorphism to do deployment.  Essentially this means we figure out which Deployer to use early on for DeploymentFileData/WSInfo, and store that away.  Then we can just call fileData.deploy() and it does the right thing.  Also notice how this simplifies WSInfoList.addWSInfoItem().
>
>* Add a custom Deployer test  
>
>* Refactor DispatchPhase to do the work of InstanceDispatcher, to avoid a separate Handler which has confusing deployment characteristics.  Now at the end of the Dispatch phase, all the contexts and metadata are set up, instead of doing it afterwards in a separate place.  Will remove InstanceDispatcher next.
>
>* Add convenience method addParameter(String, Object) to AxisDescription
>
>* The usual general fixing up of code, spelling, JavaDoc, etc
>
>TODO - This needs a little more cleanup and I'd like to merge WSInfo and DeploymentFileData into a single structure if possible to simplify further
>
>TODO - Consider whether to make Deployers stateless/singletons?
>
>TODO - Remove InstanceDispatcher
>
>Added:
>    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/
>    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/axis2.xml
>    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/
>    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/george.svc
>    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/
>    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/mary.svc
>    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/CustomDeployerTest.java
>    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/deployers/
>    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/deployers/CustomDeployer.java
>Modified:
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/Deployer.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.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/DescriptionBuilder.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DispatchPhase.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties
>    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/DeploymentTotalTest.java
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java Wed Apr 25 10:50:48 2007
>@@ -165,13 +165,17 @@
>      * @param axis2xml : location of the axis2.xml (configuration) , you can not give
>      *                 axis2xml relative to repository.
>      * @return Returns the built ConfigurationContext.
>-     * @throws DeploymentException
>+     * @throws AxisFault in case of problems
>      */
>     public static ConfigurationContext createConfigurationContextFromFileSystem(
>             String path,
>             String axis2xml) throws AxisFault {
>-    	
>         return createConfigurationContext(new FileSystemConfigurator(path, axis2xml));
>+    }
>+
>+    public static ConfigurationContext createConfigurationContextFromFileSystem(String path)
>+            throws AxisFault {
>+        return createConfigurationContextFromFileSystem(path, null);
>     }
> 
>     public static ConfigurationContext createConfigurationContextFromURIs(
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java Wed Apr 25 10:50:48 2007
>@@ -248,28 +248,29 @@
>         while (deployerItr.hasNext()) {
>             OMElement element = (OMElement) deployerItr.next();
>             String directory = element.getAttributeValue(new QName(DIRECTORY));
>-            if (directory != null) {
>-                String extension = element.getAttributeValue(new QName(EXTENSION));
>-                if (extension != null) {
>-                    try {
>-                        String deployerValue = element.getAttributeValue(new QName(TAG_CLASS_NAME));
>-                        Class deployerClass;
>-                        deployerClass = Loader.loadClass(deployerValue);
>-                        Deployer deployer =
>-                                (Deployer) deployerClass.newInstance();
>-                        deployer.setDirectory(directory);
>-                        deployer.setExtension(extension);
>-                        directoryToExtensionMappingMap.put(directory, extension);
>-                        extensionToDeployerMappingMap.put(extension, deployer);
>-                    } catch (ClassNotFoundException e) {
>-                        log.error(e);
>-                    } catch (InstantiationException e) {
>-                        log.error(e);
>-                    } catch (IllegalAccessException e) {
>-                        log.error(e);
>-                    }
>-                }
>+            if (directory == null) {
>+                log.error("Deployer missing 'directory' attribute : " + element.toString());
>+            }
>+
>+            String extension = element.getAttributeValue(new QName(EXTENSION));
>+            if (extension == null) {
>+                log.error("Deployer missing 'extension' attribute : " + element.toString());
>+                return;
>+            }
>+            String deployerClassName = element.getAttributeValue(new QName(TAG_CLASS_NAME));
>+            Deployer deployer;
>+            try {
>+                Class deployerClass = Loader.loadClass(deployerClassName);
>+                deployer = (Deployer) deployerClass.newInstance();
>+            } catch (Exception e) {
>+                log.error(e);
>+                return;
>             }
>+            deployer.setDirectory(directory);
>+            deployer.setExtension(extension);
>+            if (directory != null)
>+                directoryToExtensionMappingMap.put(directory, extension);
>+            extensionToDeployerMappingMap.put(extension, deployer);
>         }
>         if (deploymentEngine != null) {
>             deploymentEngine.setDirectoryToExtensionMappingMap(directoryToExtensionMappingMap);
>@@ -384,7 +385,7 @@
> 
>             while (handlers.hasNext()) {
>                 OMElement omElement = (OMElement) handlers.next();
>-                HandlerDescription handler = processHandler(omElement, axisConfig);
>+                HandlerDescription handler = processHandler(omElement, axisConfig, phaseName);
> 
>                 handler.getRules().setPhaseName(phaseName);
>                 Utils.loadHandler(axisConfig.getSystemClassLoader(), handler);
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/Deployer.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/Deployer.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/Deployer.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/Deployer.java Wed Apr 25 10:50:48 2007
>@@ -27,15 +27,36 @@
>  * a service or a module.
>  */
> public interface Deployer {
>-    //To initialize the deployer
>+    /**
>+     * Initialize the Deployer
>+     * @param configCtx our ConfigurationContext
>+     */
>     void init(ConfigurationContext configCtx);
> 
>-    //Will process the file and add that to axisConfig
>+    /**
>+     * Process a file and add it to the configuration
>+     * @param deploymentFileData the DeploymentFileData object to deploy
>+     * @throws DeploymentException if there is a problem
>+     */
>     void deploy(DeploymentFileData deploymentFileData) throws DeploymentException;
> 
>+    /**
>+     * Set the directory
>+     * @param directory directory name
>+     */
>     void setDirectory(String directory);
> 
>+    /**
>+     * Set the extension to look for
>+     * TODO: Support multiple extensions?
>+     * @param extension the file extension associated with this Deployer
>+     */
>     void setExtension(String extension);
> 
>+    /**
>+     * Remove a given file from the configuration
>+     * @param fileName name of item to remove
>+     * @throws DeploymentException if there is a problem
>+     */
>     void unDeploy(String fileName) throws DeploymentException;
> }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java Wed Apr 25 10:50:48 2007
>@@ -31,10 +31,6 @@
>     public static String MODULE_PATH = "modules";
>     public static String MODULE_DRI_PATH = "ModulesDirectory";
> 
>-    String TYPE_SERVICE = "service";                // is it a service
>-    String TYPE_DEFAULT = "none";                // is it a service
>-    String TYPE_MODULE = "module";                // is it a module
>-
>     String TAG_AXISCONFIG = "axisconfig";
>     String TAG_PHASE_ORDER = "phaseOrder";
>     String TAG_PHASE = "phase";
>
>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=532422&r1=532421&r2=532422
>==============================================================================
>--- 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 Wed Apr 25 10:50:48 2007
>@@ -94,6 +94,7 @@
>     protected String modulesPath = null;
>     protected File modulesDir = null;
>     private File repositoryDir = null;
>+
>     //to deploy service (both aar and expanded)
>     protected ServiceDeployer serviceDeployer;
>     //To deploy modules (both mar and expanded)
>@@ -235,10 +236,10 @@
> 
>     private void populateModule(AxisModule module, URL moduleUrl) throws DeploymentException {
>         try {
>-            ClassLoader classLoadere = module.getModuleClassLoader();
>-            InputStream moduleStream = classLoadere.getResourceAsStream("META-INF/module.xml");
>+            ClassLoader classLoader = module.getModuleClassLoader();
>+            InputStream moduleStream = classLoader.getResourceAsStream("META-INF/module.xml");
>             if (moduleStream == null) {
>-                moduleStream = classLoadere.getResourceAsStream("meta-inf/module.xml");
>+                moduleStream = classLoader.getResourceAsStream("meta-inf/module.xml");
>             }
>             if (moduleStream == null) {
>                 throw new DeploymentException(
>@@ -571,27 +572,13 @@
>         try {
>             if (wsToDeploy.size() > 0) {
>                 for (int i = 0; i < wsToDeploy.size(); i++) {
>-                    DeploymentFileData currentDeploymentFile = (DeploymentFileData) wsToDeploy.get(i);
>-                    String type = currentDeploymentFile.getType();
>-                    if (TYPE_SERVICE.equals(type)) {
>-                        try {
>-                            serviceDeployer.deploy(currentDeploymentFile);
>-                        } catch (DeploymentException e) {
>-                            log.debug(e);
>-                        }
>-                    } else if (TYPE_MODULE.equals(type)) {
>-                        moduleDeployer.deploy(currentDeploymentFile);
>-                    } else {
>-                        Deployer deployer = (Deployer) extensionToDeployerMappingMap.get(type);
>-                        if (deployer != null) {
>-                            try {
>-                                deployer.deploy(currentDeploymentFile);
>-                            } catch (DeploymentException e) {
>-                                log.debug(e);
>-                            }
>-                        }
>+                    DeploymentFileData fileToDeploy = (DeploymentFileData) wsToDeploy.get(i);
>+                    try {
>+                        fileToDeploy.deploy();
>+                    } catch (DeploymentException e) {
>+                        // TODO : This probably isn't sufficient.  Maybe provide an option to stop?
>+                        log.info(e);
>                     }
>-
>                 }
>             }
>         } finally {
>@@ -629,6 +616,7 @@
>      *
>      * @param in : InputStream to axis2.xml
>      * @throws DeploymentException : If something goes wrong
>+     * @return a populated AxisConfiguration
>      */
>     public AxisConfiguration populateAxisConfiguration(InputStream in) throws DeploymentException {
>         axisConfig = new AxisConfiguration();
>@@ -661,8 +649,7 @@
>             if (wsToUnDeploy.size() > 0) {
>                 for (int i = 0; i < wsToUnDeploy.size(); i++) {
>                     WSInfo wsInfo = (WSInfo) wsToUnDeploy.get(i);
>-                    String fileType = wsInfo.getType();
>-                    if (TYPE_SERVICE.equals(fileType)) {
>+                    if (wsInfo.getType() == WSInfo.TYPE_SERVICE) {
>                         if (isHotUpdate()) {
>                             serviceDeployer.unDeploy(wsInfo.getFileName());
>                         } else {
>@@ -670,8 +657,7 @@
>                         }
>                     } else {
>                         if (isHotUpdate()) {
>-                            Deployer deployer =
>-                                    (Deployer) extensionToDeployerMappingMap.get(fileType);
>+                            Deployer deployer = wsInfo.getDeployer();
>                             if (deployer != null) {
>                                 deployer.unDeploy(wsInfo.getFileName());
>                             }
>@@ -698,7 +684,7 @@
>      * Retrieves service name from the archive file name.
>      * If the archive file name is service1.aar , then axis2 service name would be service1
>      *
>-     * @param fileName
>+     * @param fileName the archive file name
>      * @return Returns String.
>      */
>     public static String getAxisServiceName(String fileName) {
>@@ -741,7 +727,7 @@
>      * SCL  : Service class loader
>      *
>      * @param axis2repoURI : The repository folder of Axis2
>-     * @throws DeploymentException
>+     * @throws DeploymentException if there's a problem
>      */
>     protected void setClassLoaders(String axis2repoURI) throws DeploymentException {
>         ClassLoader sysClassLoader =
>@@ -794,7 +780,7 @@
>     /**
>      * Creates directories for modules/services, copies configuration xml from class loader if necessary
>      *
>-     * @param repositoryName
>+     * @param repositoryName the pathname of the repository
>      */
> 
>     protected void prepareRepository(String repositoryName) {
>@@ -884,23 +870,31 @@
>     }
> 
>     /**
>-     * Builds ModuleDescription for a given module archive file. This does not
>+     * Builds an AxisModule for a given module archive file. This does not
>      * called the init method since there is no reference to configuration context
>      * so who ever create module using this has to called module.init if it is
>      * required
>      *
>      * @param modulearchive : Actual module archive file
>      * @param config        : AxisConfiguration : for get classloaders etc..
>-     * @throws org.apache.axis2.deployment.DeploymentException
>+     * @throws org.apache.axis2.deployment.DeploymentException if there's a problem
>      *
>+     * @return a complete AxisModule read from the file.
>      */
>     public static AxisModule buildModule(File modulearchive,
>                                          AxisConfiguration config)
>             throws DeploymentException {
>+        final String MODULE_DEPLOYER = "moduleDeployer";
>         AxisModule axismodule;
>+        ModuleDeployer deployer = (ModuleDeployer)config.getParameterValue(MODULE_DEPLOYER);
>         try {
>+            if (deployer == null) {
>+                deployer = new ModuleDeployer(config);
>+                config.addParameter(MODULE_DEPLOYER, deployer);
>+            }
>+
>             DeploymentFileData currentDeploymentFile = new DeploymentFileData(modulearchive,
>-                                                                              DeploymentConstants.TYPE_MODULE);
>+                                                                              deployer);
>             axismodule = new AxisModule();
>             ArchiveReader archiveReader = new ArchiveReader();
> 
>@@ -944,24 +938,17 @@
>      * Loads all the required class and builds the chains, finally adds the
>      * servicecontext to EngineContext and axisservice into EngineConfiguration.
>      *
>-     * @param serviceInputStream
>-     * @param classLoader
>+     * @param serviceInputStream InputStream containing configuration data
>+     * @param configCtx the ConfigurationContext in which we're deploying
>      * @return Returns AxisService.
>-     * @throws DeploymentException
>+     * @throws DeploymentException if there's a problem
>      */
>     public static AxisService buildService(InputStream serviceInputStream,
>-                                           ClassLoader classLoader,
>                                            ConfigurationContext configCtx)
>             throws DeploymentException {
>         AxisService axisService = new AxisService();
>         try {
>-            DeploymentFileData currentDeploymentFile = new DeploymentFileData(
>-                    DeploymentConstants.TYPE_SERVICE, "");
>-            currentDeploymentFile.setClassLoader(classLoader);
>-
>-            ServiceBuilder builder = new ServiceBuilder(serviceInputStream, configCtx,
>-                                                        axisService);
>-
>+            ServiceBuilder builder = new ServiceBuilder(serviceInputStream, configCtx, axisService);
>             builder.populateService(builder.buildOM());
>         } catch (AxisFault axisFault) {
>             throw new DeploymentException(axisFault);
>@@ -976,10 +963,14 @@
>      * To build a AxisServiceGroup for a given services.xml
>      * You have to add the created group into AxisConfig
>      *
>-     * @param servicesxml      : inpupstream create using services.xml
>-     * @param classLoader      : corresponding class loader to load the class
>-     * @param serviceGroupName : name of the service group
>-     * @throws AxisFault
>+     * @param servicesxml InputStream created from services.xml or equivalent
>+     * @param classLoader ClassLoader to use
>+     * @param serviceGroupName name of the service group
>+     * @param configCtx the ConfigurationContext in which we're deploying
>+     * @param archiveReader the ArchiveReader we're working with
>+     * @param wsdlServices Map of existing WSDL services
>+     * @throws AxisFault if there's a problem
>+     * @return a fleshed-out AxisServiceGroup
>      */
>     public static AxisServiceGroup buildServiceGroup(InputStream servicesxml,
>                                                      ClassLoader classLoader,
>@@ -987,8 +978,7 @@
>                                                      ConfigurationContext configCtx,
>                                                      ArchiveReader archiveReader,
>                                                      HashMap wsdlServices) throws AxisFault {
>-        DeploymentFileData currentDeploymentFile = new DeploymentFileData(
>-                DeploymentConstants.TYPE_SERVICE, "");
>+        DeploymentFileData currentDeploymentFile = new DeploymentFileData(null, null);
>         currentDeploymentFile.setClassLoader(classLoader);
>         AxisServiceGroup serviceGroup = new AxisServiceGroup();
>         serviceGroup.setServiceGroupClassLoader(classLoader);
>@@ -1034,5 +1024,18 @@
> 
>     public RepositoryListener getRepoListener() {
>         return repoListener;
>+    }
>+
>+
>+    public ServiceDeployer getServiceDeployer() {
>+        return serviceDeployer;
>+    }
>+
>+    public ModuleDeployer getModuleDeployer() {
>+        return moduleDeployer;
>+    }
>+
>+    public Deployer getDeployerForExtension(String extension) {
>+        return (Deployer)extensionToDeployerMappingMap.get(extension);
>     }
> }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java Wed Apr 25 10:50:48 2007
>@@ -219,8 +219,7 @@
>                 .getChildrenWithName(new QName(TAG_MESSAGE_BUILDER));
>         while (msgBuilders.hasNext()) {
>             OMElement msgBuilderElement = (OMElement) msgBuilders.next();
>-            OMElement tempMsgBuilder = msgBuilderElement;
>-            OMAttribute builderName = tempMsgBuilder.getAttribute(new QName(TAG_CLASS_NAME));
>+            OMAttribute builderName = msgBuilderElement.getAttribute(new QName(TAG_CLASS_NAME));
>             String className = builderName.getAttributeValue();
>             Class builderClass = null;
>             Builder builderObject;
>@@ -397,7 +396,7 @@
> 
>         if (name_attribute == null) {
>             throw new DeploymentException(Messages.getMessage(
>-                    DeploymentErrorMsgs.INVALID_HANDLER, "Name missing"));
>+                    DeploymentErrorMsgs.INVALID_HANDLER, "Unknown", "Name missing"));
>         } else {
>             handler.setName(name_attribute.getAttributeValue());
>         }
>@@ -408,7 +407,7 @@
> 
>         if (class_attribute == null) {
>             throw new DeploymentException((Messages.getMessage(
>-                    DeploymentErrorMsgs.INVALID_HANDLER,
>+                    DeploymentErrorMsgs.INVALID_HANDLER, name_attribute.getAttributeValue(),
>                     "class name is missing")));
>         } else {
>             handler.setClassName(class_attribute.getAttributeValue());
>@@ -423,7 +422,7 @@
>             if (containingPhase == null) {
>                 // TODO : Include more information (which handler?) in message!
>                 throw new DeploymentException((Messages.getMessage(
>-                        DeploymentErrorMsgs.INVALID_HANDLER,
>+                        DeploymentErrorMsgs.INVALID_HANDLER, name_attribute.getAttributeValue(),
>                         "phase rule has not been specified")));
>             }
>             rules.setPhaseName(containingPhase);
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java Wed Apr 25 10:50:48 2007
>@@ -67,15 +67,19 @@
>                         repoLocation + "'");
>             }
>         }
>+
>         // Deal with the config file.  If a filename was specified as an
>         // arg to this constructor, just respect it.
>         if (axis2xml == null) {
>             // If not, check for a system property setting
>             axis2xml = System.getProperty(Constants.AXIS2_CONF);
> 
>-            // And if not that, try at the root of the repository
>+            // And if not that, try at the root of the repository if we have one.
>+            // It might be nice to default the repository to the current directory, but we don't yet
>             if (axis2xml == null) {
>-                axis2xml = repoLocation + File.separator + Constants.AXIS2_CONF;
>+                if (repoLocation != null) {
>+                    axis2xml = repoLocation + File.separator + Constants.AXIS2_CONF;
>+                }
>             }
> 
>             // In either case, check that the file exists... if not
>@@ -99,15 +103,15 @@
>      * @throws AxisFault
>      */
>     public synchronized AxisConfiguration getAxisConfiguration() throws AxisFault {
>-        InputStream axis2xmlSream;
>+        InputStream configStream;
>         try {
>             if (axis2xml != null && !"".equals(axis2xml)) {
>-                axis2xmlSream = new FileInputStream(axis2xml);
>+                configStream = new FileInputStream(axis2xml);
>             } else {
>-                axis2xmlSream =
>+                configStream =
>                         Loader.getResourceAsStream(DeploymentConstants.AXIS2_CONFIGURATION_RESOURCE);
>             }
>-            axisConfig = populateAxisConfiguration(axis2xmlSream);
>+            axisConfig = populateAxisConfiguration(configStream);
>         } catch (FileNotFoundException e) {
>             throw new AxisFault("System can not find the given axis2.xml " + axis2xml);
>         }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java Wed Apr 25 10:50:48 2007
>@@ -64,7 +64,7 @@
>         ClassLoader threadClassLoader = null;
>         try {
>             threadClassLoader = Thread.currentThread().getContextClassLoader();
>-            String extension = deploymentFileData.getType();
>+            String extension = DeploymentFileData.getFileExtension(deploymentFileData.getName());
>             if (".class".equals(extension)) {
>                 File file = deploymentFileData.getFile();
>                 if (file != null) {
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java Wed Apr 25 10:50:48 2007
>@@ -49,9 +49,8 @@
>      * then creates a WSInfoList to store information about available modules and services.
>      *
>      * @param deploymentEngine reference to engine registry for updates
>+     * @param isClasspath true if this RepositoryListener should scan the classpath for Modules
>      */
>-
>-    //The constructor , which loads modules from class path
>     public RepositoryListener(DeploymentEngine deploymentEngine, boolean isClasspath) {
>         this.deploymentEngine = deploymentEngine;
>         wsInfoList = new WSInfoList(deploymentEngine);
>@@ -78,11 +77,11 @@
>                 }
>                 if (!file.isDirectory()) {
>                     if (DeploymentFileData.isModuleArchiveFile(file.getName())) {
>-                        wsInfoList.addWSInfoItem(file, TYPE_MODULE);
>+                        addFileToDeploy(file, deploymentEngine.getModuleDeployer());
>                     }
>                 } else {
>                     if (!"lib".equalsIgnoreCase(file.getName())) {
>-                        wsInfoList.addWSInfoItem(file, TYPE_MODULE);
>+                        addFileToDeploy(file, deploymentEngine.getModuleDeployer());
>                     }
>                 }
>             }
>@@ -119,7 +118,7 @@
>                 if (!file.isDirectory()) {
>                     if (DeploymentFileData.isModuleArchiveFile(file.getName())) {
>                         //adding modules in the class path
>-                        wsInfoList.addWSInfoItem(file, TYPE_MODULE);
>+                        addFileToDeploy(file, deploymentEngine.getModuleDeployer());
>                     }
>                 }
>             }
>@@ -144,7 +143,7 @@
>                     if (file.isFile()) {
>                         if (DeploymentFileData.isModuleArchiveFile(file.getName())) {
>                             //adding modules in the class path
>-                            wsInfoList.addWSInfoItem(file, TYPE_MODULE);
>+                            addFileToDeploy(file, deploymentEngine.getModuleDeployer());
>                         }
>                     }
>                 }
>@@ -214,18 +213,20 @@
> 
>     private void findFileForGivenDirectory(String dir, String extension) {
>         try {
>-            File fileTobeSearch = new File(deploymentEngine.getRepositoryDir(), dir);
>-            if (fileTobeSearch.exists()) {
>-                File[] files = fileTobeSearch.listFiles();
>+            File directory = new File(deploymentEngine.getRepositoryDir(), dir);
>+            if (directory.exists()) {
>+                File[] files = directory.listFiles();
>                 if (files != null && files.length > 0) {
>                     for (int i = 0; i < files.length; i++) {
>                         File file = files[i];
>                         if (isSourceControlDir(file)) {
>                             continue;
>                         }
>-                        if (!file.isDirectory() && DeploymentFileData.getFileExtension(
>-                                file.getName()).equals(extension)) {
>-                            wsInfoList.addWSInfoItem(file, extension);
>+                        // TODO: Should this allow expanded directories like services/modules do?
>+                        if (!file.isDirectory() && extension.equals(
>+                                DeploymentFileData.getFileExtension(file.getName()))) {
>+                            addFileToDeploy(file,
>+                                            deploymentEngine.getDeployerForExtension(extension));
>                         }
>                     }
>                 }
>@@ -248,16 +249,23 @@
>                 }
>                 if (!file.isDirectory()) {
>                     if (DeploymentFileData.isServiceArchiveFile(file.getName())) {
>-                        wsInfoList.addWSInfoItem(file, TYPE_SERVICE);
>+                        addFileToDeploy(file, deploymentEngine.getServiceDeployer());
>+                    } else {
>+                        String ext = DeploymentFileData.getFileExtension(file.getName());
>+                        Deployer deployer = deploymentEngine.getDeployerForExtension(ext);
>+                        // If we found a deployer for this type of file, use it.  Otherwise
>+                        // ignore the file.
>+                        if (deployer != null) {
>+                            addFileToDeploy(file, deployer);
>+                        }
>                     }
>                 } else {
>                     if (!"lib".equalsIgnoreCase(file.getName())) {
>-                        wsInfoList.addWSInfoItem(file, TYPE_SERVICE);
>+                        addFileToDeploy(file, deploymentEngine.getServiceDeployer());
>                     }
>                 }
>             }
>         }
>-        wsInfoList.addWSInfoItem(null, TYPE_DEFAULT);
>     }
> 
>     /** Method invoked from the scheduler to start the listener. */
>@@ -277,4 +285,7 @@
>         update();
>     }
> 
>+    public void addFileToDeploy(File file, Deployer deployer) {
>+        wsInfoList.addWSInfoItem(file, deployer);
>+    }
> }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java Wed Apr 25 10:50:48 2007
>@@ -34,11 +34,11 @@
> 
>     private static final Log log = LogFactory.getLog(URLBasedAxisConfigurator.class);
>     private URL axis2xml;
>-    private URL repositoy;
>+    private URL repository;
> 
>-    public URLBasedAxisConfigurator(URL axis2xml, URL repositoy) throws AxisFault {
>+    public URLBasedAxisConfigurator(URL axis2xml, URL repository) throws AxisFault {
>         this.axis2xml = axis2xml;
>-        this.repositoy = repositoy;
>+        this.repository = repository;
>     }
> 
>     public AxisConfiguration getAxisConfiguration() throws AxisFault {
>@@ -51,7 +51,7 @@
>                 axis2xmlStream = axis2xml.openStream();
>             }
>             axisConfig = populateAxisConfiguration(axis2xmlStream);
>-            if (repositoy == null) {
>+            if (repository == null) {
>                 Parameter axis2repoPara = axisConfig.getParameter(DeploymentConstants.AXIS2_REPO);
>                 if (axis2repoPara != null) {
>                     String repoValue = (String) axis2repoPara.getValue();
>@@ -69,7 +69,7 @@
>                     loadFromClassPath();
>                 }
>             } else {
>-                loadRepositoryFromURL(repositoy);
>+                loadRepositoryFromURL(repository);
>             }
> 
>         } catch (IOException e) {
>@@ -81,7 +81,7 @@
>     //to load services
>     public void loadServices() {
>         try {
>-            if (repositoy == null) {
>+            if (repository == null) {
>                 Parameter axis2repoPara = axisConfig.getParameter(DeploymentConstants.AXIS2_REPO);
>                 if (axis2repoPara != null) {
>                     String repoValue = (String) axis2repoPara.getValue();
>@@ -96,7 +96,7 @@
>                     }
>                 }
>             } else {
>-                loadServicesFromUrl(repositoy);
>+                loadServicesFromUrl(repository);
>             }
>         } catch (MalformedURLException e) {
>             log.info(e);
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java Wed Apr 25 10:50:48 2007
>@@ -43,11 +43,9 @@
> import org.apache.axis2.i18n.Messages;
> import org.apache.axis2.namespace.Constants;
> import org.apache.axis2.util.XMLUtils;
>-import org.apache.axis2.wsdl.WSDLConstants;
> import org.apache.commons.logging.Log;
> import org.apache.commons.logging.LogFactory;
> 
>-import javax.xml.namespace.QName;
> import javax.xml.stream.XMLStreamException;
> import java.io.ByteArrayInputStream;
> import java.io.ByteArrayOutputStream;
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java Wed Apr 25 10:50:48 2007
>@@ -18,8 +18,9 @@
> package org.apache.axis2.deployment.repository.util;
> 
> import org.apache.axis2.AxisFault;
>-import org.apache.axis2.deployment.DeploymentClassLoader;
> import org.apache.axis2.deployment.DeploymentErrorMsgs;
>+import org.apache.axis2.deployment.Deployer;
>+import org.apache.axis2.deployment.DeploymentException;
> import org.apache.axis2.deployment.util.Utils;
> import org.apache.axis2.i18n.Messages;
> 
>@@ -36,17 +37,15 @@
>     private ClassLoader classLoader;
>     private String messageReceiver;
> 
>-    private String name;
>-    private String type;
>+    private Deployer deployer;
> 
>-    public DeploymentFileData(File file, String type) {
>+    public DeploymentFileData(File file) {
>         this.file = file;
>-        this.type = type;
>     }
> 
>-    public DeploymentFileData(String type, String name) {
>-        this.type = type;
>-        this.name = name;
>+    public DeploymentFileData(File file, Deployer deployer) {
>+        this.file = file;
>+        this.deployer = deployer;
>     }
> 
>     public String getAbsolutePath() {
>@@ -77,14 +76,10 @@
>         if (file != null) {
>             return file.getName();
>         } else {
>-            return name;
>+            return null;
>         }
>     }
> 
>-    public String getType() {
>-        return type;
>-    }
>-
>     public static boolean isModuleArchiveFile(String filename) {
>         return (filename.endsWith(".mar"));
>     }
>@@ -92,7 +87,7 @@
>     /**
>      * Checks whether a given file is a jar or an aar file.
>      *
>-     * @param filename
>+     * @param filename file to check
>      * @return Returns boolean.
>      */
>     public static boolean isServiceArchiveFile(String filename) {
>@@ -101,7 +96,7 @@
> 
>     public static String getFileExtension(String fileName) {
>         int index = fileName.lastIndexOf('.');
>-        return fileName.substring(index);
>+        return fileName.substring(index + 1);
>     }
> 
>     public void setClassLoader(ClassLoader classLoader) {
>@@ -136,5 +131,18 @@
> 
>     public void setMessageReceiver(String messageReceiver) {
>         this.messageReceiver = messageReceiver;
>+    }
>+
>+
>+    public Deployer getDeployer() {
>+        return deployer;
>+    }
>+
>+    public void setDeployer(Deployer deployer) {
>+        this.deployer = deployer;
>+    }
>+
>+    public void deploy() throws DeploymentException {
>+        deployer.deploy(this);
>     }
> }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java Wed Apr 25 10:50:48 2007
>@@ -17,26 +17,40 @@
> 
> package org.apache.axis2.deployment.repository.util;
> 
>+import org.apache.axis2.deployment.Deployer;
>+
> public class WSInfo {
>     private String fileName;
>     private long lastModifiedDate;
> 
>+    public static final int TYPE_SERVICE = 0;
>+    public static final int TYPE_MODULE = 1;
>+
>     /**
>      * To check whether the file is a module or a servise
>      */
>-    private String type;
>+    private int type = TYPE_SERVICE;
>+
>+    private Deployer deployer;
> 
>     public WSInfo(String filename, long lastmodifieddate) {
>         this.fileName = filename;
>         this.lastModifiedDate = lastmodifieddate;
>     }
> 
>-    public WSInfo(String filename, long lastmodifieddate, String type) {
>-        this.fileName = filename;
>-        this.lastModifiedDate = lastmodifieddate;
>+
>+    public WSInfo(String fileName, long lastModifiedDate, int type) {
>+        this.fileName = fileName;
>+        this.lastModifiedDate = lastModifiedDate;
>         this.type = type;
>     }
> 
>+    public WSInfo(String fileName, long lastModifiedDate, Deployer deployer) {
>+        this.fileName = fileName;
>+        this.lastModifiedDate = lastModifiedDate;
>+        this.deployer = deployer;
>+    }
>+
>     public String getFileName() {
>         return fileName;
>     }
>@@ -45,7 +59,7 @@
>         return lastModifiedDate;
>     }
> 
>-    public String getType() {
>+    public int getType() {
>         return type;
>     }
> 
>@@ -55,5 +69,9 @@
> 
>     public void setLastModifiedDate(long lastmodifieddate) {
>         this.lastModifiedDate = lastmodifieddate;
>+    }
>+    
>+    public Deployer getDeployer() {
>+        return deployer;
>     }
> }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java Wed Apr 25 10:50:48 2007
>@@ -19,12 +19,14 @@
> 
> import org.apache.axis2.deployment.DeploymentConstants;
> import org.apache.axis2.deployment.DeploymentEngine;
>-import org.apache.axis2.deployment.DeploymentException;
>+import org.apache.axis2.deployment.Deployer;
> 
> import java.io.File;
> import java.util.ArrayList;
> import java.util.Iterator;
> import java.util.List;
>+import java.util.Set;
>+import java.util.HashSet;
> 
> public class WSInfoList implements DeploymentConstants {
> 
>@@ -36,22 +38,22 @@
>     /**
>      * All the currently updated jars
>      */
>-    public List currentJars = new ArrayList();
>+    public Set currentJars = new HashSet();
> 
>     /**
>      * Reference to DeploymentEngine to make update
>      */
>-    private DeploymentEngine deployer;
>+    private final DeploymentEngine deploymentEngine;
> 
>     private boolean check;
> 
>     public WSInfoList(DeploymentEngine deploy_engine) {
>-        deployer = deploy_engine;
>+        deploymentEngine = deploy_engine;
>     }
> 
>     /**
>      * First checks whether the file is already available by the
>-     * system call isFileExist. If it is not deployed yet then adds to the jarList
>+     * system call fileExists. If it is not deployed yet then adds to the jarList
>      * and to the deployment engine as a new service or module.
>      * While adding new item to jarList, first creates the WSInfo object and
>      * then adds to the jarlist and actual jar file is added to DeploymentEngine.
>@@ -61,76 +63,21 @@
>      * DeploymentEngine - one for new deployment and other for undeployment.
>      *
>      * @param file actual jar files for either Module or service
>-     * @param type indicate either Service or Module
>      */
>-    public synchronized void addWSInfoItem(File file, String type) {
>-        if (TYPE_SERVICE.equals(type)) {
>-            if (!isFileExist(file.getName())) {    // checking whether the file is already deployed
>-                WSInfo wsInfo = new WSInfo(file.getName(), file.lastModified(), TYPE_SERVICE);
>-                jarList.add(wsInfo);
>-                DeploymentFileData deploymentFileData =
>-                        new DeploymentFileData(file, TYPE_SERVICE);
>-                deployer.addWSToDeploy(
>-                        deploymentFileData);    // inform that new web service is deployed
>-            } else {
>-                if (deployer.isHotUpdate()) {
>-                    WSInfo tempWSInfo = getFileItem(file.getName());
>-                    if (isModified(file, tempWSInfo)) {    // check whether file is updated
>-                        tempWSInfo.setLastModifiedDate(file.lastModified());
>-                        WSInfo wsInfo = new WSInfo(tempWSInfo.getFileName(),
>-                                                   tempWSInfo.getLastModifiedDate(), TYPE_SERVICE);
>-                        deployer.addWSToUndeploy(wsInfo);           // add entry to undeploy list
>-                        DeploymentFileData deploymentFileData = new DeploymentFileData(file,
>-                                                                                       TYPE_SERVICE);
>-                        deployer.addWSToDeploy(deploymentFileData);    // add entry to deploylist
>-                    }
>-                }
>-            }
>-        } else if (TYPE_MODULE.equals(type)) {
>-            if (!isFileExist(file.getName()))
>-            {                     // checking whether the file is already deployed
>-                WSInfo wsInfo = new WSInfo(file.getName(), file.lastModified(), TYPE_MODULE);
>-                jarList.add(wsInfo);
>-                DeploymentFileData deploymentFileData =
>-                        new DeploymentFileData(file, TYPE_MODULE);
>-                deployer.addWSToDeploy(
>-                        deploymentFileData);    // inform that new web service is deployed
>-            }
>-        } else {
>-            if (file != null) {
>-                String extension = DeploymentFileData.getFileExtension(file.getName());
>-                if (!isFileExist(file.getName())) {
>-                    WSInfo wsInfo = new WSInfo(file.getName(), file.lastModified(), extension);
>-                    jarList.add(wsInfo);
>-                    DeploymentFileData deploymentFileData =
>-                            new DeploymentFileData(file, extension);
>-                    deployer.addWSToDeploy(
>-                            deploymentFileData);    // inform that new web service is deployed
>-                } else {
>-                    if (deployer.isHotUpdate()) {
>-                        WSInfo tempWSInfo = getFileItem(file.getName());
>-                        if (isModified(file, tempWSInfo)) {    // check whether file is updated
>-                            tempWSInfo.setLastModifiedDate(file.lastModified());
>-                            WSInfo wsInfo = new WSInfo(tempWSInfo.getFileName(),
>-                                                       tempWSInfo.getLastModifiedDate(), extension);
>-                            deployer.addWSToUndeploy(
>-                                    wsInfo);           // add entry to undeploy list
>-                            DeploymentFileData deploymentFileData = new DeploymentFileData(file,
>-                                                                                           extension);
>-                            deployer.addWSToDeploy(
>-                                    deploymentFileData);    // add entry to deploylist
>-                        }
>-                    }
>-                }
>-            } else {
>-                check = true;
>-            }
>+    public synchronized void addWSInfoItem(File file, Deployer deployer) {
>+        WSInfo info = getFileItem(file.getName());
>+        if (info == null) {
>+            info = new WSInfo(file.getName(), file.lastModified(), deployer);
>+            jarList.add(info);
>+            DeploymentFileData fileData = new DeploymentFileData(file, deployer);
>+            deploymentEngine.addWSToDeploy(fileData);
>+        } else if (deploymentEngine.isHotUpdate() && isModified(file, info)) {
>+            info.setLastModifiedDate(file.lastModified());
>+            WSInfo wsInfo = new WSInfo(info.getFileName(), info.getLastModifiedDate(), deployer);
>+            deploymentEngine.addWSToUndeploy(wsInfo);           // add entry to undeploy list
>+            DeploymentFileData deploymentFileData = new DeploymentFileData(file, deployer);
>+            deploymentEngine.addWSToDeploy(deploymentFileData);    // add entry to deploylist
>         }
>-        if (file != null) {
>-            String jarname = file.getName();
>-            currentJars.add(jarname);
>-        }
>-        check = true;
>     }
> 
>     /**
>@@ -147,33 +94,18 @@
>         }
> 
>         Iterator iter = jarList.listIterator();
>-        int size = currentJars.size();
>         List tempvector = new ArrayList();
> 
>-        tempvector.clear();
>-
>-        String filename;
>-        boolean exist;
>-
>         while (iter.hasNext()) {
>             WSInfo fileitem = (WSInfo) iter.next();
>-            if (TYPE_MODULE.equals(fileitem.getType())) {
>+            if (fileitem.getType() == WSInfo.TYPE_MODULE) {
>                 continue;
>             }
>-            exist = false;
>-            for (int i = 0; i < size; i++) {
>-                filename = (String) currentJars.get(i);
>-                if (filename.equals(fileitem.getFileName())) {
>-                    exist = true;
>-                    break;
>-                }
>-            }
>-            if (!exist) {
>+            String itemName = fileitem.getFileName();
>+            if (!currentJars.contains(itemName)) {
>                 tempvector.add(fileitem);
>-                WSInfo wsInfo = new WSInfo(fileitem.getFileName(), fileitem.getLastModifiedDate(),
>-                                           fileitem.getType());
>-
>-                deployer.addWSToUndeploy(wsInfo);    // this is to be undeployed
>+                WSInfo wsInfo = new WSInfo(fileitem.getFileName(), fileitem.getLastModifiedDate());
>+                deploymentEngine.addWSToUndeploy(wsInfo);    // this is to be undeployed
>             }
>         }
>         for (int i = 0; i < tempvector.size(); i++) {
>@@ -195,10 +127,10 @@
>      *
>      */
>     public void update() {
>-        synchronized (deployer) {
>+        synchronized (deploymentEngine) {
>             checkForUndeployedServices();
>-            deployer.unDeploy();
>-            deployer.doDeploy();
>+            deploymentEngine.unDeploy();
>+            deploymentEngine.doDeploy();
>         }
>     }
> 
>@@ -217,15 +149,6 @@
>             }
>         }
>         return null;
>-    }
>-
>-    /**
>-     * Checks whether the file already exists in the list.
>-     *
>-     * @param filename
>-     */
>-    private boolean isFileExist(String filename) {
>-        return !(getFileItem(filename) == null);
>     }
> 
>     /**
>
>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=532422&r1=532421&r2=532422
>==============================================================================
>--- 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 Wed Apr 25 10:50:48 2007
>@@ -490,8 +490,7 @@
>                     File inputFile = Utils.createTempFile(servicename,
>                             fin,
>                             (File)axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
>-                    DeploymentFileData filedata = new DeploymentFileData(inputFile,
>-                                                                         DeploymentConstants.TYPE_SERVICE);
>+                    DeploymentFileData filedata = new DeploymentFileData(inputFile);
> 
>                     filedata.setClassLoader(false,
>                                             moduleClassLoader,
>@@ -509,8 +508,7 @@
>                         }
>                     }
>                     AxisServiceGroup serviceGroup = new AxisServiceGroup(axisConfig);
>-                    serviceGroup.setServiceGroupClassLoader(
>-                            filedata.getClassLoader());
>+                    serviceGroup.setServiceGroupClassLoader(filedata.getClassLoader());
>                     ArrayList serviceList = archiveReader.processServiceGroup(
>                             filedata.getAbsolutePath(), filedata,
>                             serviceGroup, false, wsdlservice,
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java Wed Apr 25 10:50:48 2007
>@@ -51,7 +51,6 @@
>     }
> 
>     public void addParameter(Parameter param) throws AxisFault {
>-
>         if (param == null) {
>             return;
>         }
>@@ -62,6 +61,10 @@
>         }
> 
>         parameterInclude.addParameter(param);
>+    }
>+
>+    public void addParameter(String name, Object value) throws AxisFault {
>+        addParameter(new Parameter(name, value));
>     }
> 
>     public void removeParameter(Parameter param) throws AxisFault {
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java Wed Apr 25 10:50:48 2007
>@@ -133,13 +133,13 @@
>         soap12 = ele.declareNamespace(URI_WSDL12_SOAP, SOAP12_PREFIX);
>         http = ele.declareNamespace(HTTP_NAMESPACE, HTTP_PREFIX);
>         mime = ele.declareNamespace(MIME_NAMESPACE, MIME_PREFIX);
>-        String prefix = WSDLSerializationUtil.getPrefix(axisService.getTargetNamespace(), namespaceMap);
>+        String prefix = WSDLSerializationUtil.getPrefix(axisService.getTargetNamespace(),
>+                                                        namespaceMap);
>         if (prefix == null || "".equals(prefix)) {
>             prefix = DEFAULT_TARGET_NAMESPACE_PREFIX;
>         }
> 
>-        namespaceMap.put(prefix,
>-                                           axisService.getTargetNamespace());
>+        namespaceMap.put(prefix, axisService.getTargetNamespace());
>         tns = ele.declareNamespace(axisService.getTargetNamespace(), prefix);
> 
>         // adding documentation element
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DispatchPhase.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DispatchPhase.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DispatchPhase.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DispatchPhase.java Wed Apr 25 10:50:48 2007
>@@ -1,16 +1,30 @@
> package org.apache.axis2.engine;
> 
> import org.apache.axis2.AxisFault;
>+import org.apache.axis2.Constants;
>+import org.apache.axis2.util.JavaUtils;
> import org.apache.axis2.addressing.AddressingHelper;
> import org.apache.axis2.addressing.EndpointReference;
> import org.apache.axis2.context.MessageContext;
>+import org.apache.axis2.context.SessionContext;
>+import org.apache.axis2.context.ServiceGroupContext;
>+import org.apache.axis2.context.ContextFactory;
>+import org.apache.axis2.context.ServiceContext;
>+import org.apache.axis2.context.OperationContext;
> import org.apache.axis2.description.AxisService;
>+import org.apache.axis2.description.AxisOperation;
>+import org.apache.axis2.description.AxisServiceGroup;
> import org.apache.axis2.i18n.Messages;
> import org.apache.axis2.transport.RequestResponseTransport;
>+import org.apache.axis2.transport.TransportListener;
>+import org.apache.axis2.transport.http.HTTPConstants;
> import org.apache.axis2.wsdl.WSDLConstants.WSDL20_2004_Constants;
>+import org.apache.axiom.soap.SOAPHeader;
>+import org.apache.axiom.om.OMElement;
> 
> import java.util.ArrayList;
> import java.util.List;
>+import java.util.Iterator;
> 
> /*
> * Copyright 2004,2005 The Apache Software Foundation.
>@@ -44,13 +58,36 @@
>         if (msgContext.getAxisService() == null) {
>             throw new AxisFault(Messages.getMessage("servicenotfoundforepr",
>                                                     ((toEPR != null) ? toEPR.getAddress() : "")));
>-        } else if (msgContext.getAxisOperation() == null) {
>+        }
>+
>+        AxisService service = msgContext.getAxisService();
>+        AxisOperation operation = msgContext.getAxisOperation();
>+        // If we're configured to do so, check the service for a single op...
>+        if (operation == null &&
>+                JavaUtils.isTrue(service.getParameterValue("supportSingleOperation"))) {
>+            Iterator ops = service.getOperations();
>+            // If there's exactly one, that's the one we want.  If there's more, forget it.
>+            if (ops.hasNext()) {
>+                operation = (AxisOperation)ops.next();
>+                if (ops.hasNext()) {
>+                    operation = null;
>+                }
>+            }
>+        }
>+
>+        // If we still don't have an operation, fault.
>+        if (operation == null) {
>             throw new AxisFault(Messages.getMessage("operationnotfoundforepr",
>                                                     ((toEPR != null) ? toEPR.getAddress()
>                                                             : ""), msgContext.getWSAAction()));
>         }
> 
>+        msgContext.setAxisOperation(operation);
>+        
>         validateTransport(msgContext);
>+
>+        loadContexts(service, msgContext);
>+
>         if (msgContext.getOperationContext() == null) {
>             throw new AxisFault(Messages.getMessage("cannotBeNullOperationContext"));
>         }
>@@ -59,6 +96,7 @@
>             throw new AxisFault(Messages.getMessage("cannotBeNullServiceContext"));
>         }
> 
>+        // TODO - review this
>         if ((msgContext.getAxisOperation() == null) && (msgContext.getOperationContext() != null)) {
>             msgContext.setAxisOperation(msgContext.getOperationContext().getAxisOperation());
>         }
>@@ -96,6 +134,59 @@
>         msgContext.setExecutionChain((ArrayList) operationChain.clone());
>     }
> 
>+    private void loadContexts(AxisService service, MessageContext msgContext) throws AxisFault {
>+        String scope = service == null ? null : service.getScope();
>+        ServiceContext serviceContext = msgContext.getServiceContext();
>+
>+        if ((msgContext.getOperationContext() != null)
>+                && (serviceContext != null)) {
>+            msgContext.setServiceGroupContextId(
>+                    ((ServiceGroupContext) serviceContext.getParent()).getId());
>+            return;
>+        }
>+        if (Constants.SCOPE_TRANSPORT_SESSION.equals(scope)) {
>+            fillContextsFromSessionContext(msgContext);
>+        }
>+
>+        AxisOperation axisOperation = msgContext.getAxisOperation();
>+        if (axisOperation == null) {
>+            return;
>+        }
>+        OperationContext operationContext =
>+                axisOperation.findForExistingOperationContext(msgContext);
>+
>+        if (operationContext != null) {
>+            // register operation context and message context
>+//            axisOperation.registerOperationContext(msgContext, operationContext);
>+            axisOperation.registerMessageContext(msgContext, operationContext);
>+
>+            serviceContext = (ServiceContext) operationContext.getParent();
>+            ServiceGroupContext serviceGroupContext =
>+                    (ServiceGroupContext) serviceContext.getParent();
>+
>+            msgContext.setServiceContext(serviceContext);
>+            msgContext.setServiceGroupContext(serviceGroupContext);
>+            msgContext.setServiceGroupContextId(serviceGroupContext.getId());
>+        } else {    // 2. if null, create new opCtxt
>+            operationContext = ContextFactory.createOperationContext(axisOperation, serviceContext);
>+
>+            axisOperation.registerMessageContext(msgContext, operationContext);
>+            if (serviceContext != null) {
>+                // no need to added to configuration conetxt , since we are happy in
>+                //  storing in session context
>+                operationContext.setParent(serviceContext);
>+            } else {
>+                // fill the service group context and service context info
>+                msgContext.getConfigurationContext().fillServiceContextAndServiceGroupContext(
>+                        msgContext);
>+            }
>+        }
>+        serviceContext = msgContext.getServiceContext();
>+        if (serviceContext != null) {
>+            serviceContext.setMyEPR(msgContext.getTo());
>+        }
>+    }
>+
>     /**
>      * To check wether the incoming request has come in valid transport , simpley the transports
>      * that service author wants to expose
>@@ -119,5 +210,57 @@
>         EndpointReference toEPR = msgctx.getTo();
>         throw new AxisFault(Messages.getMessage("servicenotfoundforepr",
>                                                 ((toEPR != null) ? toEPR.getAddress() : "")));
>+    }
>+
>+    private void fillContextsFromSessionContext(MessageContext msgContext) throws AxisFault {
>+        AxisService service = msgContext.getAxisService();
>+        if (service == null) {
>+            throw new AxisFault(Messages.getMessage("unabletofindservice"));
>+        }
>+        SessionContext sessionContext = msgContext.getSessionContext();
>+        if (sessionContext == null) {
>+            TransportListener listener = msgContext.getTransportIn().getReceiver();
>+            sessionContext = listener.getSessionContext(msgContext);
>+            if (sessionContext == null) {
>+                createAndFillContexts(service, msgContext, sessionContext);
>+                return;
>+            }
>+        }
>+        String serviceGroupName = msgContext.getAxisServiceGroup().getServiceGroupName();
>+        ServiceGroupContext serviceGroupContext = sessionContext.getServiceGroupContext(
>+                serviceGroupName);
>+        if (serviceGroupContext != null) {
>+            //setting service group context
>+            msgContext.setServiceGroupContext(serviceGroupContext);
>+            // setting Service conetxt
>+            msgContext.setServiceContext(
>+                    ContextFactory.createServiceContext(serviceGroupContext, service));
>+        } else {
>+            createAndFillContexts(service, msgContext, sessionContext);
>+        }
>+        ServiceContext serviceContext = sessionContext.getServiceContext(service);
>+        //found the serviceContext from session context , so adding that into msgContext
>+        if (serviceContext != null) {
>+            msgContext.setServiceContext(serviceContext);
>+            serviceContext.setProperty(HTTPConstants.COOKIE_STRING, sessionContext.getCookieID());
>+        }
>+    }
>+
>+    private void createAndFillContexts(AxisService service,
>+                                       MessageContext msgContext,
>+                                       SessionContext sessionContext) throws AxisFault {
>+        ServiceGroupContext serviceGroupContext;
>+        AxisServiceGroup axisServiceGroup = (AxisServiceGroup) service.getParent();
>+        serviceGroupContext = ContextFactory.createServiceGroupContext(
>+                msgContext.getConfigurationContext(), axisServiceGroup);
>+
>+        msgContext.setServiceGroupContext(serviceGroupContext);
>+        ServiceContext serviceContext =
>+                ContextFactory.createServiceContext(serviceGroupContext, service);
>+        msgContext.setServiceContext(serviceContext);
>+        if (sessionContext != null) {
>+            sessionContext.addServiceContext(serviceContext);
>+            sessionContext.addServiceGroupContext(serviceGroupContext);
>+        }
>     }
> }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties Wed Apr 25 10:50:48 2007
>@@ -160,7 +160,7 @@
> transportSenderError=The TransportSender implementation class is required for the transport {0}
> obsererror=An implemenation class of the Observer object is required.
> invalidmoduleconfig=A module configuration exists that is not valid.
>-invalidhandler=The following handler exists is not valid: {0}
>+invalidhandler=Invalid handler config!  Name: {0} Reason: {1}
> parameterlockederror=The {0} parameter is locked at the top level and cannot be overridden.
> op_error=Processing Operations Modules with an error of {0}
> servicenameeror=A service name is required.
>
>Added: webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/axis2.xml
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/axis2.xml?view=auto&rev=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/axis2.xml (added)
>+++ webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/axis2.xml Wed Apr 25 10:50:48 2007
>@@ -0,0 +1,290 @@
>+<!--
>+/*
>+ * Copyright 2001-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.
>+ */
>+ -->
>+
>+<axisconfig name="AxisJava2.0">
>+    <!-- ================================================= -->
>+    <!-- Parameters -->
>+    <!-- ================================================= -->
>+    <parameter name="hotdeployment">true</parameter>
>+    <parameter name="hotupdate">false</parameter>
>+    <parameter name="enableMTOM">false</parameter>
>+    <parameter name="enableSwA">false</parameter>
>+
>+    <!--Uncomment if you want to enable file caching for attachments -->
>+    <!--parameter name="cacheAttachments">true</parameter>
>+    <parameter name="attachmentDIR"></parameter>
>+    <parameter name="sizeThreshold">4000</parameter-->
>+
>+    <!--This will give out the timout of the configuration contexts, in milliseconds-->
>+    <parameter name="ConfigContextTimeoutInterval">30000</parameter>
>+
>+    <!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
>+    <!--that behaviour.-->
>+    <parameter name="sendStacktraceDetailsWithFaults">false</parameter>
>+
>+    <!--If there aren't any information available to find out the fault reason, we set the message of the expcetion-->
>+    <!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
>+    <!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
>+    <!--is set then, Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
>+    <parameter name="DrillDownToRootCauseForFaultReason">false</parameter>
>+
>+    <parameter name="userName">admin</parameter>
>+    <parameter name="password">axis2</parameter>
>+
>+    <!--To override repository/services you need to uncomment following parameter and value SHOULD be absolute file path.-->
>+    <!--<parameter name="ServicesDirectory">service</parameter>-->
>+    <!--To override repository/modules you need to uncomment following parameter and value SHOULD be absolute file path-->
>+    <!--<parameter name="ModulesDirectory">modules</parameter>-->
>+
>+
>+
>+    <!--Following params will set the proper context paths for invocations. All the endpoints will have a commons context-->
>+    <!--root which can configured using the following contextRoot parameter-->
>+    <!--<parameter name="contextRoot">axis2</parameter>-->
>+
>+    <!--Our HTTP endpoints can handle both REST and SOAP. Following parameters can be used to distingiush those endpoints-->
>+    <!--In case of a servlet, if you change this you have to manually change the settings of your servlet container to map this -->
>+    <!--context path to proper Axis2 servlets-->
>+    <!--<parameter name="servicePath">services</parameter>-->
>+    <!--<parameter name="restPath">rest</parameter>-->
>+
>+    <!-- Following parameter will completely disable REST handling in Axis2-->
>+    <parameter name="disableREST" locked="true">false</parameter>
>+
>+    <!-- If you have a frontend host which exposes this webservice using a different public URL  -->
>+    <!-- use this parameter to override autodetected url -->
>+    <!--<parameter name="httpFrontendHostUrl">https://someotherhost/context</parameter>-->
>+
>+
>+    <!--    The way of adding listener to the system-->
>+    <!--    <listener class="org.apache.axis2.ObserverIMPL">-->
>+    <!--        <parameter name="RSS_URL">http://127.0.0.1/rss</parameter>-->
>+    <!--    </listener>-->
>+
>+    <!-- ================================================= -->
>+    <!-- Message Receivers -->
>+    <!-- ================================================= -->
>+    <!--This is the Deafult Message Receiver for the system , if you want to have MessageReceivers for -->
>+    <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
>+    <!--any operation -->
>+    <!--Note : You can ovride this for particular service by adding the same element with your requirement-->
>+     <messageReceivers>
>+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
>+                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
>+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
>+                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
>+        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-only"
>+                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
>+        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-out"
>+                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
>+    </messageReceivers>
>+
>+    <!-- ================================================= -->
>+    <!-- Message Formatter -->
>+    <!-- ================================================= -->
>+    <!--Following content type to message formatter mapping can be used to implement support for different message -->
>+    <!--format  serialization in Axis2. These message formats are expected to be resolved based on the content type. -->
>+    <messageFormatters>
>+        <messageFormatter contentType="application/x-www-form-urlencoded"
>+                         class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
>+        <messageFormatter contentType="multipart/form-data"
>+                         class="org.apache.axis2.transport.http.MultipartFormDataFormatter"/>
>+        <messageFormatter contentType="application/xml"
>+                         class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
>+    </messageFormatters>
>+
>+    <!-- Test custom deployment by registering for "svc" files, and the "widgets" dir -->
>+    <deployer extension="svc" directory="widgets"
>+            class="org.apache.axis2.deployment.deployers.CustomDeployer"/>
>+
>+    <!-- ================================================= -->
>+    <!-- Message Builders -->
>+    <!-- ================================================= -->
>+    <!--Following content type to builder mapping can be used to implement support for different message -->
>+    <!--formats in Axis2. These message formats are expected to be resolved based on the content type. -->
>+    <messageBuilders>
>+        <messageBuilder contentType="application/xml"
>+                         class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
>+        <messageBuilder contentType="application/x-www-form-urlencoded"
>+                         class="org.apache.axis2.builder.XFormURLEncodedBuilder"/>
>+        <messageBuilder contentType="multipart/form-data"
>+                         class="org.apache.axis2.builder.MultipartFormDataBuilder"/>
>+    </messageBuilders>
>+
>+    <!-- ================================================= -->
>+    <!-- Transport Ins -->
>+    <!-- ================================================= -->
>+    <transportReceiver name="http"
>+                       class="org.apache.axis2.transport.http.SimpleHTTPServer">
>+        <parameter name="port">8080</parameter>
>+        <!-- Here is the complete list of supported parameters (see example settings further below):
>+            port: the port to listen on (default 6060)
>+            hostname:  if non-null, url prefix used in reply-to endpoint references                                 (default null)
>+            originServer:  value of http Server header in outgoing messages                                         (default "Simple-Server/1.1")
>+            requestTimeout:  value in millis of time that requests can wait for data                                (default 20000)
>+            requestTcpNoDelay:  true to maximize performance and minimize latency                                   (default true)
>+                                false to minimize bandwidth consumption by combining segments
>+            requestCoreThreadPoolSize:  number of threads available for request processing (unless queue fills up)  (default 25)
>+            requestMaxThreadPoolSize:  number of threads available for request processing if queue fills us         (default 150)
>+                                       note that default queue never fills up:  see HttpFactory
>+            threadKeepAliveTime:  time to keep threads in excess of core size alive while inactive                  (default 180)
>+                                  note that no such threads can exist with default unbounded request queue
>+            threadKeepAliveTimeUnit:  TimeUnit of value in threadKeepAliveTime (default SECONDS)                    (default SECONDS)
>+        -->
>+        <!-- <parameter name="hostname">http://www.myApp.com/ws</parameter> -->
>+        <!-- <parameter name="originServer">My-Server/1.1</parameter>           -->
>+        <!-- <parameter name="requestTimeout">10000</parameter>                   -->
>+        <!-- <parameter name="requestTcpNoDelay">false</parameter>                   -->
>+        <!-- <parameter name="requestCoreThreadPoolSize">50</parameter>                      -->
>+        <!-- <parameter name="RequestMaxThreadPoolSize">100</parameter>                     -->
>+        <!-- <parameter name="threadKeepAliveTime">240000</parameter>                  -->
>+        <!-- <parameter name="threadKeepAliveTimeUnit">MILLISECONDS</parameter>            -->
>+    </transportReceiver>
>+
>+    <!-- ================================================= -->
>+    <!-- Transport Outs -->
>+    <!-- ================================================= -->
>+
>+    <transportSender name="tcp"
>+                     class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
>+    <transportSender name="local"
>+                     class="org.apache.axis2.transport.local.LocalTransportSender"/>
>+    <transportSender name="http"
>+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
>+        <parameter name="PROTOCOL">HTTP/1.1</parameter>
>+        <parameter name="Transfer-Encoding">chunked</parameter>
>+
>+        <!-- If following is set to 'true', optional action part of the Content-Type will not be added to the SOAP 1.2 messages -->
>+        <!--  <parameter name="OmitSOAP12Action">true</parameter>  -->
>+    </transportSender>
>+
>+    <transportSender name="https"
>+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
>+        <parameter name="PROTOCOL">HTTP/1.1</parameter>
>+        <parameter name="Transfer-Encoding">chunked</parameter>
>+    </transportSender>
>+    <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
>+    <transportSender name="jms"
>+                     class="org.apache.axis2.transport.jms.JMSSender"/>
>+    -->
>+
>+    <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
>+   <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
>+       <parameter name="transport.mail.smtp.host">127.0.0.1</parameter>
>+       <parameter name="transport.mail.smtp.user">axis2</parameter>
>+       <parameter name="transport.mail.smtp.password">axis2</parameter>
>+       <parameter name="transport.mail.smtp.port">25</parameter>
>+   </transportSender>
>+   -->
>+
>+    <!-- ================================================= -->
>+    <!-- Global Modules  -->
>+    <!-- ================================================= -->
>+    <!-- Comment this to disable Addressing -->
>+    <!--<module ref="addressing"/>-->
>+
>+    <!--Configuring module , providing parameters for modules whether they refer or not-->
>+    <!--<moduleConfig name="addressing">-->
>+    <!--<parameter name="addressingPara">N/A</parameter>-->
>+    <!--</moduleConfig>-->
>+
>+    <!-- ================================================= -->
>+    <!-- Clustering  -->
>+    <!-- ================================================= -->
>+    <!-- Configure and uncomment following for preparing Axis2 to a clustered environment -->
>+    <!--
>+    <cluster class="org.apache.axis2.cluster.tribes.TribesClusterManager">
>+        <parameter name="param1">value1</parameter>
>+    	<configurationManager class="org.apache.axis2.cluster.tribes.configuration.TribesConfigurationManager">
>+    	    <listeners>
>+    	    </listeners>
>+    	</configurationManager>
>+    	<contextManager class="org.apache.axis2.cluster.tribes.context.TribesContextManager">
>+    	    <listeners>
>+    	    </listeners>
>+    	</contextManager>
>+    </cluster>
>+    -->
>+
>+    <!-- ================================================= -->
>+    <!-- Phases  -->
>+    <!-- ================================================= -->
>+    <phaseOrder type="InFlow">
>+        <!--  System pre defined phases       -->
>+        <phase name="Transport">
>+            <handler name="RequestURIBasedDispatcher"
>+                     class="org.apache.axis2.engine.RequestURIBasedDispatcher"/>
>+            <handler name="SOAPActionBasedDispatcher"
>+                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher"/>
>+        </phase>
>+        <phase name="Security"/>
>+        <phase name="PreDispatch"/>
>+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
>+            <handler name="AddressingBasedDispatcher"
>+                     class="org.apache.axis2.engine.AddressingBasedDispatcher"/>
>+            <handler name="RequestURIOperationDispatcher"
>+                     class="org.apache.axis2.engine.RequestURIOperationDispatcher"/>
>+            <handler name="SOAPMessageBodyBasedDispatcher"
>+                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher"/>
>+            <handler name="HTTPLocationBasedDispatcher"
>+                     class="org.apache.axis2.engine.HTTPLocationBasedDispatcher"/>
>+        </phase>
>+        <!--  System pre defined phases       -->
>+        <!--   After Postdispatch phase module author or or service author can add any phase he want      -->
>+        <phase name="OperationInPhase"/>
>+	<phase name="soapmonitorPhase"/>
>+    </phaseOrder>
>+    <phaseOrder type="OutFlow">
>+        <!--      user can add his own phases to this area  -->
>+	<phase name="soapmonitorPhase"/>
>+        <phase name="OperationOutPhase"/>
>+        <!--system predefined phase-->
>+        <!--these phase will run irrespective of the service-->
>+        <phase name="PolicyDetermination"/>
>+        <phase name="MessageOut"/>
>+        <phase name="Security"/>
>+    </phaseOrder>
>+    <phaseOrder type="InFaultFlow">
>+        <phase name="PreDispatch"/>
>+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
>+            <handler name="RequestURIBasedDispatcher"
>+                     class="org.apache.axis2.engine.RequestURIBasedDispatcher"/>
>+            <handler name="SOAPActionBasedDispatcher"
>+                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher"/>
>+            <handler name="AddressingBasedDispatcher"
>+                     class="org.apache.axis2.engine.AddressingBasedDispatcher"/>
>+            <handler name="RequestURIOperationDispatcher"
>+                     class="org.apache.axis2.engine.RequestURIOperationDispatcher"/>
>+            <handler name="SOAPMessageBodyBasedDispatcher"
>+                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher"/>
>+            <handler name="HTTPLocationBasedDispatcher"
>+                     class="org.apache.axis2.engine.HTTPLocationBasedDispatcher"/>
>+        </phase>
>+        <!--      user can add his own phases to this area  -->
>+        <phase name="OperationInFaultPhase"/>
>+	<phase name="soapmonitorPhase"/>
>+    </phaseOrder>
>+    <phaseOrder type="OutFaultFlow">
>+        <!--      user can add his own phases to this area  -->
>+	<phase name="soapmonitorPhase"/>
>+        <phase name="OperationOutFaultPhase"/>
>+        <phase name="PolicyDetermination"/>
>+        <phase name="MessageOut"/>
>+    </phaseOrder>
>+</axisconfig>
>+
>
>Added: webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/george.svc
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/george.svc?view=auto&rev=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/george.svc (added)
>+++ webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/george.svc Wed Apr 25 10:50:48 2007
>@@ -0,0 +1 @@
>+This is a custom service deployment in the services/ directory.  Its name is George.
>
>Added: webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/mary.svc
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/mary.svc?view=auto&rev=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/mary.svc (added)
>+++ webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/mary.svc Wed Apr 25 10:50:48 2007
>@@ -0,0 +1 @@
>+This is a custom service deployment in the widgets/ directory.  Its name is Mary.
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
>For additional commands, e-mail: axis-cvs-help@ws.apache.org
>
>
>
>  
>

-- 
Thanks,
Deepal
................................................................
"The highest tower is built one brick at a time"



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


Re: svn commit: r532422 [1/2] - in /webservices/axis2/trunk/java/modules/kernel: src/org/apache/axis2/context/ src/org/apache/axis2/deployment/ src/org/apache/axis2/deployment/repository/util/ src/org/apache/axis2/deployment/util/ src/org/apache/axis2/desc...

Posted by Deepal Jayasinghe <de...@opensource.lk>.
Hi Glen,

I did not check but when I go though your changes I found you have
remove hot deployment feature of Axis2.

Can you please wait till I do Axis2 1.2 release ,  I am bit busy with
the release and I do not have enough time to check what you have done.
Believe me I have very good experience when someone else come and modify
Axis2 deployment and break Axis2 functionality without knowing history .
Therefore I relay need to look at carefully when someone change
Deployment code.

I am -1 on this kind of changes , first we need to discuss when we are
going to do a major changes.

Thanks
Deepal

gdaniels@apache.org wrote:

>Author: gdaniels
>Date: Wed Apr 25 10:50:48 2007
>New Revision: 532422
>
>URL: http://svn.apache.org/viewvc?view=rev&rev=532422
>Log:
>* Refactor deployment a bit to clean things up and get custom deployers actually working.  Get rid of a bunch of code that looked at (via string compares) the "type" field in order to decide what to do, and instead use polymorphism to do deployment.  Essentially this means we figure out which Deployer to use early on for DeploymentFileData/WSInfo, and store that away.  Then we can just call fileData.deploy() and it does the right thing.  Also notice how this simplifies WSInfoList.addWSInfoItem().
>
>* Add a custom Deployer test  
>
>* Refactor DispatchPhase to do the work of InstanceDispatcher, to avoid a separate Handler which has confusing deployment characteristics.  Now at the end of the Dispatch phase, all the contexts and metadata are set up, instead of doing it afterwards in a separate place.  Will remove InstanceDispatcher next.
>
>* Add convenience method addParameter(String, Object) to AxisDescription
>
>* The usual general fixing up of code, spelling, JavaDoc, etc
>
>TODO - This needs a little more cleanup and I'd like to merge WSInfo and DeploymentFileData into a single structure if possible to simplify further
>
>TODO - Consider whether to make Deployers stateless/singletons?
>
>TODO - Remove InstanceDispatcher
>
>Added:
>    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/
>    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/axis2.xml
>    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/
>    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/george.svc
>    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/
>    webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/mary.svc
>    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/CustomDeployerTest.java
>    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/deployers/
>    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/deployers/CustomDeployer.java
>Modified:
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/Deployer.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.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/DescriptionBuilder.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/util/Utils.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DispatchPhase.java
>    webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties
>    webservices/axis2/trunk/java/modules/kernel/test/org/apache/axis2/deployment/DeploymentTotalTest.java
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/context/ConfigurationContextFactory.java Wed Apr 25 10:50:48 2007
>@@ -165,13 +165,17 @@
>      * @param axis2xml : location of the axis2.xml (configuration) , you can not give
>      *                 axis2xml relative to repository.
>      * @return Returns the built ConfigurationContext.
>-     * @throws DeploymentException
>+     * @throws AxisFault in case of problems
>      */
>     public static ConfigurationContext createConfigurationContextFromFileSystem(
>             String path,
>             String axis2xml) throws AxisFault {
>-    	
>         return createConfigurationContext(new FileSystemConfigurator(path, axis2xml));
>+    }
>+
>+    public static ConfigurationContext createConfigurationContextFromFileSystem(String path)
>+            throws AxisFault {
>+        return createConfigurationContextFromFileSystem(path, null);
>     }
> 
>     public static ConfigurationContext createConfigurationContextFromURIs(
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/AxisConfigBuilder.java Wed Apr 25 10:50:48 2007
>@@ -248,28 +248,29 @@
>         while (deployerItr.hasNext()) {
>             OMElement element = (OMElement) deployerItr.next();
>             String directory = element.getAttributeValue(new QName(DIRECTORY));
>-            if (directory != null) {
>-                String extension = element.getAttributeValue(new QName(EXTENSION));
>-                if (extension != null) {
>-                    try {
>-                        String deployerValue = element.getAttributeValue(new QName(TAG_CLASS_NAME));
>-                        Class deployerClass;
>-                        deployerClass = Loader.loadClass(deployerValue);
>-                        Deployer deployer =
>-                                (Deployer) deployerClass.newInstance();
>-                        deployer.setDirectory(directory);
>-                        deployer.setExtension(extension);
>-                        directoryToExtensionMappingMap.put(directory, extension);
>-                        extensionToDeployerMappingMap.put(extension, deployer);
>-                    } catch (ClassNotFoundException e) {
>-                        log.error(e);
>-                    } catch (InstantiationException e) {
>-                        log.error(e);
>-                    } catch (IllegalAccessException e) {
>-                        log.error(e);
>-                    }
>-                }
>+            if (directory == null) {
>+                log.error("Deployer missing 'directory' attribute : " + element.toString());
>+            }
>+
>+            String extension = element.getAttributeValue(new QName(EXTENSION));
>+            if (extension == null) {
>+                log.error("Deployer missing 'extension' attribute : " + element.toString());
>+                return;
>+            }
>+            String deployerClassName = element.getAttributeValue(new QName(TAG_CLASS_NAME));
>+            Deployer deployer;
>+            try {
>+                Class deployerClass = Loader.loadClass(deployerClassName);
>+                deployer = (Deployer) deployerClass.newInstance();
>+            } catch (Exception e) {
>+                log.error(e);
>+                return;
>             }
>+            deployer.setDirectory(directory);
>+            deployer.setExtension(extension);
>+            if (directory != null)
>+                directoryToExtensionMappingMap.put(directory, extension);
>+            extensionToDeployerMappingMap.put(extension, deployer);
>         }
>         if (deploymentEngine != null) {
>             deploymentEngine.setDirectoryToExtensionMappingMap(directoryToExtensionMappingMap);
>@@ -384,7 +385,7 @@
> 
>             while (handlers.hasNext()) {
>                 OMElement omElement = (OMElement) handlers.next();
>-                HandlerDescription handler = processHandler(omElement, axisConfig);
>+                HandlerDescription handler = processHandler(omElement, axisConfig, phaseName);
> 
>                 handler.getRules().setPhaseName(phaseName);
>                 Utils.loadHandler(axisConfig.getSystemClassLoader(), handler);
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/Deployer.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/Deployer.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/Deployer.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/Deployer.java Wed Apr 25 10:50:48 2007
>@@ -27,15 +27,36 @@
>  * a service or a module.
>  */
> public interface Deployer {
>-    //To initialize the deployer
>+    /**
>+     * Initialize the Deployer
>+     * @param configCtx our ConfigurationContext
>+     */
>     void init(ConfigurationContext configCtx);
> 
>-    //Will process the file and add that to axisConfig
>+    /**
>+     * Process a file and add it to the configuration
>+     * @param deploymentFileData the DeploymentFileData object to deploy
>+     * @throws DeploymentException if there is a problem
>+     */
>     void deploy(DeploymentFileData deploymentFileData) throws DeploymentException;
> 
>+    /**
>+     * Set the directory
>+     * @param directory directory name
>+     */
>     void setDirectory(String directory);
> 
>+    /**
>+     * Set the extension to look for
>+     * TODO: Support multiple extensions?
>+     * @param extension the file extension associated with this Deployer
>+     */
>     void setExtension(String extension);
> 
>+    /**
>+     * Remove a given file from the configuration
>+     * @param fileName name of item to remove
>+     * @throws DeploymentException if there is a problem
>+     */
>     void unDeploy(String fileName) throws DeploymentException;
> }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DeploymentConstants.java Wed Apr 25 10:50:48 2007
>@@ -31,10 +31,6 @@
>     public static String MODULE_PATH = "modules";
>     public static String MODULE_DRI_PATH = "ModulesDirectory";
> 
>-    String TYPE_SERVICE = "service";                // is it a service
>-    String TYPE_DEFAULT = "none";                // is it a service
>-    String TYPE_MODULE = "module";                // is it a module
>-
>     String TAG_AXISCONFIG = "axisconfig";
>     String TAG_PHASE_ORDER = "phaseOrder";
>     String TAG_PHASE = "phase";
>
>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=532422&r1=532421&r2=532422
>==============================================================================
>--- 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 Wed Apr 25 10:50:48 2007
>@@ -94,6 +94,7 @@
>     protected String modulesPath = null;
>     protected File modulesDir = null;
>     private File repositoryDir = null;
>+
>     //to deploy service (both aar and expanded)
>     protected ServiceDeployer serviceDeployer;
>     //To deploy modules (both mar and expanded)
>@@ -235,10 +236,10 @@
> 
>     private void populateModule(AxisModule module, URL moduleUrl) throws DeploymentException {
>         try {
>-            ClassLoader classLoadere = module.getModuleClassLoader();
>-            InputStream moduleStream = classLoadere.getResourceAsStream("META-INF/module.xml");
>+            ClassLoader classLoader = module.getModuleClassLoader();
>+            InputStream moduleStream = classLoader.getResourceAsStream("META-INF/module.xml");
>             if (moduleStream == null) {
>-                moduleStream = classLoadere.getResourceAsStream("meta-inf/module.xml");
>+                moduleStream = classLoader.getResourceAsStream("meta-inf/module.xml");
>             }
>             if (moduleStream == null) {
>                 throw new DeploymentException(
>@@ -571,27 +572,13 @@
>         try {
>             if (wsToDeploy.size() > 0) {
>                 for (int i = 0; i < wsToDeploy.size(); i++) {
>-                    DeploymentFileData currentDeploymentFile = (DeploymentFileData) wsToDeploy.get(i);
>-                    String type = currentDeploymentFile.getType();
>-                    if (TYPE_SERVICE.equals(type)) {
>-                        try {
>-                            serviceDeployer.deploy(currentDeploymentFile);
>-                        } catch (DeploymentException e) {
>-                            log.debug(e);
>-                        }
>-                    } else if (TYPE_MODULE.equals(type)) {
>-                        moduleDeployer.deploy(currentDeploymentFile);
>-                    } else {
>-                        Deployer deployer = (Deployer) extensionToDeployerMappingMap.get(type);
>-                        if (deployer != null) {
>-                            try {
>-                                deployer.deploy(currentDeploymentFile);
>-                            } catch (DeploymentException e) {
>-                                log.debug(e);
>-                            }
>-                        }
>+                    DeploymentFileData fileToDeploy = (DeploymentFileData) wsToDeploy.get(i);
>+                    try {
>+                        fileToDeploy.deploy();
>+                    } catch (DeploymentException e) {
>+                        // TODO : This probably isn't sufficient.  Maybe provide an option to stop?
>+                        log.info(e);
>                     }
>-
>                 }
>             }
>         } finally {
>@@ -629,6 +616,7 @@
>      *
>      * @param in : InputStream to axis2.xml
>      * @throws DeploymentException : If something goes wrong
>+     * @return a populated AxisConfiguration
>      */
>     public AxisConfiguration populateAxisConfiguration(InputStream in) throws DeploymentException {
>         axisConfig = new AxisConfiguration();
>@@ -661,8 +649,7 @@
>             if (wsToUnDeploy.size() > 0) {
>                 for (int i = 0; i < wsToUnDeploy.size(); i++) {
>                     WSInfo wsInfo = (WSInfo) wsToUnDeploy.get(i);
>-                    String fileType = wsInfo.getType();
>-                    if (TYPE_SERVICE.equals(fileType)) {
>+                    if (wsInfo.getType() == WSInfo.TYPE_SERVICE) {
>                         if (isHotUpdate()) {
>                             serviceDeployer.unDeploy(wsInfo.getFileName());
>                         } else {
>@@ -670,8 +657,7 @@
>                         }
>                     } else {
>                         if (isHotUpdate()) {
>-                            Deployer deployer =
>-                                    (Deployer) extensionToDeployerMappingMap.get(fileType);
>+                            Deployer deployer = wsInfo.getDeployer();
>                             if (deployer != null) {
>                                 deployer.unDeploy(wsInfo.getFileName());
>                             }
>@@ -698,7 +684,7 @@
>      * Retrieves service name from the archive file name.
>      * If the archive file name is service1.aar , then axis2 service name would be service1
>      *
>-     * @param fileName
>+     * @param fileName the archive file name
>      * @return Returns String.
>      */
>     public static String getAxisServiceName(String fileName) {
>@@ -741,7 +727,7 @@
>      * SCL  : Service class loader
>      *
>      * @param axis2repoURI : The repository folder of Axis2
>-     * @throws DeploymentException
>+     * @throws DeploymentException if there's a problem
>      */
>     protected void setClassLoaders(String axis2repoURI) throws DeploymentException {
>         ClassLoader sysClassLoader =
>@@ -794,7 +780,7 @@
>     /**
>      * Creates directories for modules/services, copies configuration xml from class loader if necessary
>      *
>-     * @param repositoryName
>+     * @param repositoryName the pathname of the repository
>      */
> 
>     protected void prepareRepository(String repositoryName) {
>@@ -884,23 +870,31 @@
>     }
> 
>     /**
>-     * Builds ModuleDescription for a given module archive file. This does not
>+     * Builds an AxisModule for a given module archive file. This does not
>      * called the init method since there is no reference to configuration context
>      * so who ever create module using this has to called module.init if it is
>      * required
>      *
>      * @param modulearchive : Actual module archive file
>      * @param config        : AxisConfiguration : for get classloaders etc..
>-     * @throws org.apache.axis2.deployment.DeploymentException
>+     * @throws org.apache.axis2.deployment.DeploymentException if there's a problem
>      *
>+     * @return a complete AxisModule read from the file.
>      */
>     public static AxisModule buildModule(File modulearchive,
>                                          AxisConfiguration config)
>             throws DeploymentException {
>+        final String MODULE_DEPLOYER = "moduleDeployer";
>         AxisModule axismodule;
>+        ModuleDeployer deployer = (ModuleDeployer)config.getParameterValue(MODULE_DEPLOYER);
>         try {
>+            if (deployer == null) {
>+                deployer = new ModuleDeployer(config);
>+                config.addParameter(MODULE_DEPLOYER, deployer);
>+            }
>+
>             DeploymentFileData currentDeploymentFile = new DeploymentFileData(modulearchive,
>-                                                                              DeploymentConstants.TYPE_MODULE);
>+                                                                              deployer);
>             axismodule = new AxisModule();
>             ArchiveReader archiveReader = new ArchiveReader();
> 
>@@ -944,24 +938,17 @@
>      * Loads all the required class and builds the chains, finally adds the
>      * servicecontext to EngineContext and axisservice into EngineConfiguration.
>      *
>-     * @param serviceInputStream
>-     * @param classLoader
>+     * @param serviceInputStream InputStream containing configuration data
>+     * @param configCtx the ConfigurationContext in which we're deploying
>      * @return Returns AxisService.
>-     * @throws DeploymentException
>+     * @throws DeploymentException if there's a problem
>      */
>     public static AxisService buildService(InputStream serviceInputStream,
>-                                           ClassLoader classLoader,
>                                            ConfigurationContext configCtx)
>             throws DeploymentException {
>         AxisService axisService = new AxisService();
>         try {
>-            DeploymentFileData currentDeploymentFile = new DeploymentFileData(
>-                    DeploymentConstants.TYPE_SERVICE, "");
>-            currentDeploymentFile.setClassLoader(classLoader);
>-
>-            ServiceBuilder builder = new ServiceBuilder(serviceInputStream, configCtx,
>-                                                        axisService);
>-
>+            ServiceBuilder builder = new ServiceBuilder(serviceInputStream, configCtx, axisService);
>             builder.populateService(builder.buildOM());
>         } catch (AxisFault axisFault) {
>             throw new DeploymentException(axisFault);
>@@ -976,10 +963,14 @@
>      * To build a AxisServiceGroup for a given services.xml
>      * You have to add the created group into AxisConfig
>      *
>-     * @param servicesxml      : inpupstream create using services.xml
>-     * @param classLoader      : corresponding class loader to load the class
>-     * @param serviceGroupName : name of the service group
>-     * @throws AxisFault
>+     * @param servicesxml InputStream created from services.xml or equivalent
>+     * @param classLoader ClassLoader to use
>+     * @param serviceGroupName name of the service group
>+     * @param configCtx the ConfigurationContext in which we're deploying
>+     * @param archiveReader the ArchiveReader we're working with
>+     * @param wsdlServices Map of existing WSDL services
>+     * @throws AxisFault if there's a problem
>+     * @return a fleshed-out AxisServiceGroup
>      */
>     public static AxisServiceGroup buildServiceGroup(InputStream servicesxml,
>                                                      ClassLoader classLoader,
>@@ -987,8 +978,7 @@
>                                                      ConfigurationContext configCtx,
>                                                      ArchiveReader archiveReader,
>                                                      HashMap wsdlServices) throws AxisFault {
>-        DeploymentFileData currentDeploymentFile = new DeploymentFileData(
>-                DeploymentConstants.TYPE_SERVICE, "");
>+        DeploymentFileData currentDeploymentFile = new DeploymentFileData(null, null);
>         currentDeploymentFile.setClassLoader(classLoader);
>         AxisServiceGroup serviceGroup = new AxisServiceGroup();
>         serviceGroup.setServiceGroupClassLoader(classLoader);
>@@ -1034,5 +1024,18 @@
> 
>     public RepositoryListener getRepoListener() {
>         return repoListener;
>+    }
>+
>+
>+    public ServiceDeployer getServiceDeployer() {
>+        return serviceDeployer;
>+    }
>+
>+    public ModuleDeployer getModuleDeployer() {
>+        return moduleDeployer;
>+    }
>+
>+    public Deployer getDeployerForExtension(String extension) {
>+        return (Deployer)extensionToDeployerMappingMap.get(extension);
>     }
> }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/DescriptionBuilder.java Wed Apr 25 10:50:48 2007
>@@ -219,8 +219,7 @@
>                 .getChildrenWithName(new QName(TAG_MESSAGE_BUILDER));
>         while (msgBuilders.hasNext()) {
>             OMElement msgBuilderElement = (OMElement) msgBuilders.next();
>-            OMElement tempMsgBuilder = msgBuilderElement;
>-            OMAttribute builderName = tempMsgBuilder.getAttribute(new QName(TAG_CLASS_NAME));
>+            OMAttribute builderName = msgBuilderElement.getAttribute(new QName(TAG_CLASS_NAME));
>             String className = builderName.getAttributeValue();
>             Class builderClass = null;
>             Builder builderObject;
>@@ -397,7 +396,7 @@
> 
>         if (name_attribute == null) {
>             throw new DeploymentException(Messages.getMessage(
>-                    DeploymentErrorMsgs.INVALID_HANDLER, "Name missing"));
>+                    DeploymentErrorMsgs.INVALID_HANDLER, "Unknown", "Name missing"));
>         } else {
>             handler.setName(name_attribute.getAttributeValue());
>         }
>@@ -408,7 +407,7 @@
> 
>         if (class_attribute == null) {
>             throw new DeploymentException((Messages.getMessage(
>-                    DeploymentErrorMsgs.INVALID_HANDLER,
>+                    DeploymentErrorMsgs.INVALID_HANDLER, name_attribute.getAttributeValue(),
>                     "class name is missing")));
>         } else {
>             handler.setClassName(class_attribute.getAttributeValue());
>@@ -423,7 +422,7 @@
>             if (containingPhase == null) {
>                 // TODO : Include more information (which handler?) in message!
>                 throw new DeploymentException((Messages.getMessage(
>-                        DeploymentErrorMsgs.INVALID_HANDLER,
>+                        DeploymentErrorMsgs.INVALID_HANDLER, name_attribute.getAttributeValue(),
>                         "phase rule has not been specified")));
>             }
>             rules.setPhaseName(containingPhase);
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/FileSystemConfigurator.java Wed Apr 25 10:50:48 2007
>@@ -67,15 +67,19 @@
>                         repoLocation + "'");
>             }
>         }
>+
>         // Deal with the config file.  If a filename was specified as an
>         // arg to this constructor, just respect it.
>         if (axis2xml == null) {
>             // If not, check for a system property setting
>             axis2xml = System.getProperty(Constants.AXIS2_CONF);
> 
>-            // And if not that, try at the root of the repository
>+            // And if not that, try at the root of the repository if we have one.
>+            // It might be nice to default the repository to the current directory, but we don't yet
>             if (axis2xml == null) {
>-                axis2xml = repoLocation + File.separator + Constants.AXIS2_CONF;
>+                if (repoLocation != null) {
>+                    axis2xml = repoLocation + File.separator + Constants.AXIS2_CONF;
>+                }
>             }
> 
>             // In either case, check that the file exists... if not
>@@ -99,15 +103,15 @@
>      * @throws AxisFault
>      */
>     public synchronized AxisConfiguration getAxisConfiguration() throws AxisFault {
>-        InputStream axis2xmlSream;
>+        InputStream configStream;
>         try {
>             if (axis2xml != null && !"".equals(axis2xml)) {
>-                axis2xmlSream = new FileInputStream(axis2xml);
>+                configStream = new FileInputStream(axis2xml);
>             } else {
>-                axis2xmlSream =
>+                configStream =
>                         Loader.getResourceAsStream(DeploymentConstants.AXIS2_CONFIGURATION_RESOURCE);
>             }
>-            axisConfig = populateAxisConfiguration(axis2xmlSream);
>+            axisConfig = populateAxisConfiguration(configStream);
>         } catch (FileNotFoundException e) {
>             throw new AxisFault("System can not find the given axis2.xml " + axis2xml);
>         }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/POJODeployer.java Wed Apr 25 10:50:48 2007
>@@ -64,7 +64,7 @@
>         ClassLoader threadClassLoader = null;
>         try {
>             threadClassLoader = Thread.currentThread().getContextClassLoader();
>-            String extension = deploymentFileData.getType();
>+            String extension = DeploymentFileData.getFileExtension(deploymentFileData.getName());
>             if (".class".equals(extension)) {
>                 File file = deploymentFileData.getFile();
>                 if (file != null) {
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/RepositoryListener.java Wed Apr 25 10:50:48 2007
>@@ -49,9 +49,8 @@
>      * then creates a WSInfoList to store information about available modules and services.
>      *
>      * @param deploymentEngine reference to engine registry for updates
>+     * @param isClasspath true if this RepositoryListener should scan the classpath for Modules
>      */
>-
>-    //The constructor , which loads modules from class path
>     public RepositoryListener(DeploymentEngine deploymentEngine, boolean isClasspath) {
>         this.deploymentEngine = deploymentEngine;
>         wsInfoList = new WSInfoList(deploymentEngine);
>@@ -78,11 +77,11 @@
>                 }
>                 if (!file.isDirectory()) {
>                     if (DeploymentFileData.isModuleArchiveFile(file.getName())) {
>-                        wsInfoList.addWSInfoItem(file, TYPE_MODULE);
>+                        addFileToDeploy(file, deploymentEngine.getModuleDeployer());
>                     }
>                 } else {
>                     if (!"lib".equalsIgnoreCase(file.getName())) {
>-                        wsInfoList.addWSInfoItem(file, TYPE_MODULE);
>+                        addFileToDeploy(file, deploymentEngine.getModuleDeployer());
>                     }
>                 }
>             }
>@@ -119,7 +118,7 @@
>                 if (!file.isDirectory()) {
>                     if (DeploymentFileData.isModuleArchiveFile(file.getName())) {
>                         //adding modules in the class path
>-                        wsInfoList.addWSInfoItem(file, TYPE_MODULE);
>+                        addFileToDeploy(file, deploymentEngine.getModuleDeployer());
>                     }
>                 }
>             }
>@@ -144,7 +143,7 @@
>                     if (file.isFile()) {
>                         if (DeploymentFileData.isModuleArchiveFile(file.getName())) {
>                             //adding modules in the class path
>-                            wsInfoList.addWSInfoItem(file, TYPE_MODULE);
>+                            addFileToDeploy(file, deploymentEngine.getModuleDeployer());
>                         }
>                     }
>                 }
>@@ -214,18 +213,20 @@
> 
>     private void findFileForGivenDirectory(String dir, String extension) {
>         try {
>-            File fileTobeSearch = new File(deploymentEngine.getRepositoryDir(), dir);
>-            if (fileTobeSearch.exists()) {
>-                File[] files = fileTobeSearch.listFiles();
>+            File directory = new File(deploymentEngine.getRepositoryDir(), dir);
>+            if (directory.exists()) {
>+                File[] files = directory.listFiles();
>                 if (files != null && files.length > 0) {
>                     for (int i = 0; i < files.length; i++) {
>                         File file = files[i];
>                         if (isSourceControlDir(file)) {
>                             continue;
>                         }
>-                        if (!file.isDirectory() && DeploymentFileData.getFileExtension(
>-                                file.getName()).equals(extension)) {
>-                            wsInfoList.addWSInfoItem(file, extension);
>+                        // TODO: Should this allow expanded directories like services/modules do?
>+                        if (!file.isDirectory() && extension.equals(
>+                                DeploymentFileData.getFileExtension(file.getName()))) {
>+                            addFileToDeploy(file,
>+                                            deploymentEngine.getDeployerForExtension(extension));
>                         }
>                     }
>                 }
>@@ -248,16 +249,23 @@
>                 }
>                 if (!file.isDirectory()) {
>                     if (DeploymentFileData.isServiceArchiveFile(file.getName())) {
>-                        wsInfoList.addWSInfoItem(file, TYPE_SERVICE);
>+                        addFileToDeploy(file, deploymentEngine.getServiceDeployer());
>+                    } else {
>+                        String ext = DeploymentFileData.getFileExtension(file.getName());
>+                        Deployer deployer = deploymentEngine.getDeployerForExtension(ext);
>+                        // If we found a deployer for this type of file, use it.  Otherwise
>+                        // ignore the file.
>+                        if (deployer != null) {
>+                            addFileToDeploy(file, deployer);
>+                        }
>                     }
>                 } else {
>                     if (!"lib".equalsIgnoreCase(file.getName())) {
>-                        wsInfoList.addWSInfoItem(file, TYPE_SERVICE);
>+                        addFileToDeploy(file, deploymentEngine.getServiceDeployer());
>                     }
>                 }
>             }
>         }
>-        wsInfoList.addWSInfoItem(null, TYPE_DEFAULT);
>     }
> 
>     /** Method invoked from the scheduler to start the listener. */
>@@ -277,4 +285,7 @@
>         update();
>     }
> 
>+    public void addFileToDeploy(File file, Deployer deployer) {
>+        wsInfoList.addWSInfoItem(file, deployer);
>+    }
> }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/URLBasedAxisConfigurator.java Wed Apr 25 10:50:48 2007
>@@ -34,11 +34,11 @@
> 
>     private static final Log log = LogFactory.getLog(URLBasedAxisConfigurator.class);
>     private URL axis2xml;
>-    private URL repositoy;
>+    private URL repository;
> 
>-    public URLBasedAxisConfigurator(URL axis2xml, URL repositoy) throws AxisFault {
>+    public URLBasedAxisConfigurator(URL axis2xml, URL repository) throws AxisFault {
>         this.axis2xml = axis2xml;
>-        this.repositoy = repositoy;
>+        this.repository = repository;
>     }
> 
>     public AxisConfiguration getAxisConfiguration() throws AxisFault {
>@@ -51,7 +51,7 @@
>                 axis2xmlStream = axis2xml.openStream();
>             }
>             axisConfig = populateAxisConfiguration(axis2xmlStream);
>-            if (repositoy == null) {
>+            if (repository == null) {
>                 Parameter axis2repoPara = axisConfig.getParameter(DeploymentConstants.AXIS2_REPO);
>                 if (axis2repoPara != null) {
>                     String repoValue = (String) axis2repoPara.getValue();
>@@ -69,7 +69,7 @@
>                     loadFromClassPath();
>                 }
>             } else {
>-                loadRepositoryFromURL(repositoy);
>+                loadRepositoryFromURL(repository);
>             }
> 
>         } catch (IOException e) {
>@@ -81,7 +81,7 @@
>     //to load services
>     public void loadServices() {
>         try {
>-            if (repositoy == null) {
>+            if (repository == null) {
>                 Parameter axis2repoPara = axisConfig.getParameter(DeploymentConstants.AXIS2_REPO);
>                 if (axis2repoPara != null) {
>                     String repoValue = (String) axis2repoPara.getValue();
>@@ -96,7 +96,7 @@
>                     }
>                 }
>             } else {
>-                loadServicesFromUrl(repositoy);
>+                loadServicesFromUrl(repository);
>             }
>         } catch (MalformedURLException e) {
>             log.info(e);
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/ArchiveReader.java Wed Apr 25 10:50:48 2007
>@@ -43,11 +43,9 @@
> import org.apache.axis2.i18n.Messages;
> import org.apache.axis2.namespace.Constants;
> import org.apache.axis2.util.XMLUtils;
>-import org.apache.axis2.wsdl.WSDLConstants;
> import org.apache.commons.logging.Log;
> import org.apache.commons.logging.LogFactory;
> 
>-import javax.xml.namespace.QName;
> import javax.xml.stream.XMLStreamException;
> import java.io.ByteArrayInputStream;
> import java.io.ByteArrayOutputStream;
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/DeploymentFileData.java Wed Apr 25 10:50:48 2007
>@@ -18,8 +18,9 @@
> package org.apache.axis2.deployment.repository.util;
> 
> import org.apache.axis2.AxisFault;
>-import org.apache.axis2.deployment.DeploymentClassLoader;
> import org.apache.axis2.deployment.DeploymentErrorMsgs;
>+import org.apache.axis2.deployment.Deployer;
>+import org.apache.axis2.deployment.DeploymentException;
> import org.apache.axis2.deployment.util.Utils;
> import org.apache.axis2.i18n.Messages;
> 
>@@ -36,17 +37,15 @@
>     private ClassLoader classLoader;
>     private String messageReceiver;
> 
>-    private String name;
>-    private String type;
>+    private Deployer deployer;
> 
>-    public DeploymentFileData(File file, String type) {
>+    public DeploymentFileData(File file) {
>         this.file = file;
>-        this.type = type;
>     }
> 
>-    public DeploymentFileData(String type, String name) {
>-        this.type = type;
>-        this.name = name;
>+    public DeploymentFileData(File file, Deployer deployer) {
>+        this.file = file;
>+        this.deployer = deployer;
>     }
> 
>     public String getAbsolutePath() {
>@@ -77,14 +76,10 @@
>         if (file != null) {
>             return file.getName();
>         } else {
>-            return name;
>+            return null;
>         }
>     }
> 
>-    public String getType() {
>-        return type;
>-    }
>-
>     public static boolean isModuleArchiveFile(String filename) {
>         return (filename.endsWith(".mar"));
>     }
>@@ -92,7 +87,7 @@
>     /**
>      * Checks whether a given file is a jar or an aar file.
>      *
>-     * @param filename
>+     * @param filename file to check
>      * @return Returns boolean.
>      */
>     public static boolean isServiceArchiveFile(String filename) {
>@@ -101,7 +96,7 @@
> 
>     public static String getFileExtension(String fileName) {
>         int index = fileName.lastIndexOf('.');
>-        return fileName.substring(index);
>+        return fileName.substring(index + 1);
>     }
> 
>     public void setClassLoader(ClassLoader classLoader) {
>@@ -136,5 +131,18 @@
> 
>     public void setMessageReceiver(String messageReceiver) {
>         this.messageReceiver = messageReceiver;
>+    }
>+
>+
>+    public Deployer getDeployer() {
>+        return deployer;
>+    }
>+
>+    public void setDeployer(Deployer deployer) {
>+        this.deployer = deployer;
>+    }
>+
>+    public void deploy() throws DeploymentException {
>+        deployer.deploy(this);
>     }
> }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfo.java Wed Apr 25 10:50:48 2007
>@@ -17,26 +17,40 @@
> 
> package org.apache.axis2.deployment.repository.util;
> 
>+import org.apache.axis2.deployment.Deployer;
>+
> public class WSInfo {
>     private String fileName;
>     private long lastModifiedDate;
> 
>+    public static final int TYPE_SERVICE = 0;
>+    public static final int TYPE_MODULE = 1;
>+
>     /**
>      * To check whether the file is a module or a servise
>      */
>-    private String type;
>+    private int type = TYPE_SERVICE;
>+
>+    private Deployer deployer;
> 
>     public WSInfo(String filename, long lastmodifieddate) {
>         this.fileName = filename;
>         this.lastModifiedDate = lastmodifieddate;
>     }
> 
>-    public WSInfo(String filename, long lastmodifieddate, String type) {
>-        this.fileName = filename;
>-        this.lastModifiedDate = lastmodifieddate;
>+
>+    public WSInfo(String fileName, long lastModifiedDate, int type) {
>+        this.fileName = fileName;
>+        this.lastModifiedDate = lastModifiedDate;
>         this.type = type;
>     }
> 
>+    public WSInfo(String fileName, long lastModifiedDate, Deployer deployer) {
>+        this.fileName = fileName;
>+        this.lastModifiedDate = lastModifiedDate;
>+        this.deployer = deployer;
>+    }
>+
>     public String getFileName() {
>         return fileName;
>     }
>@@ -45,7 +59,7 @@
>         return lastModifiedDate;
>     }
> 
>-    public String getType() {
>+    public int getType() {
>         return type;
>     }
> 
>@@ -55,5 +69,9 @@
> 
>     public void setLastModifiedDate(long lastmodifieddate) {
>         this.lastModifiedDate = lastmodifieddate;
>+    }
>+    
>+    public Deployer getDeployer() {
>+        return deployer;
>     }
> }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/deployment/repository/util/WSInfoList.java Wed Apr 25 10:50:48 2007
>@@ -19,12 +19,14 @@
> 
> import org.apache.axis2.deployment.DeploymentConstants;
> import org.apache.axis2.deployment.DeploymentEngine;
>-import org.apache.axis2.deployment.DeploymentException;
>+import org.apache.axis2.deployment.Deployer;
> 
> import java.io.File;
> import java.util.ArrayList;
> import java.util.Iterator;
> import java.util.List;
>+import java.util.Set;
>+import java.util.HashSet;
> 
> public class WSInfoList implements DeploymentConstants {
> 
>@@ -36,22 +38,22 @@
>     /**
>      * All the currently updated jars
>      */
>-    public List currentJars = new ArrayList();
>+    public Set currentJars = new HashSet();
> 
>     /**
>      * Reference to DeploymentEngine to make update
>      */
>-    private DeploymentEngine deployer;
>+    private final DeploymentEngine deploymentEngine;
> 
>     private boolean check;
> 
>     public WSInfoList(DeploymentEngine deploy_engine) {
>-        deployer = deploy_engine;
>+        deploymentEngine = deploy_engine;
>     }
> 
>     /**
>      * First checks whether the file is already available by the
>-     * system call isFileExist. If it is not deployed yet then adds to the jarList
>+     * system call fileExists. If it is not deployed yet then adds to the jarList
>      * and to the deployment engine as a new service or module.
>      * While adding new item to jarList, first creates the WSInfo object and
>      * then adds to the jarlist and actual jar file is added to DeploymentEngine.
>@@ -61,76 +63,21 @@
>      * DeploymentEngine - one for new deployment and other for undeployment.
>      *
>      * @param file actual jar files for either Module or service
>-     * @param type indicate either Service or Module
>      */
>-    public synchronized void addWSInfoItem(File file, String type) {
>-        if (TYPE_SERVICE.equals(type)) {
>-            if (!isFileExist(file.getName())) {    // checking whether the file is already deployed
>-                WSInfo wsInfo = new WSInfo(file.getName(), file.lastModified(), TYPE_SERVICE);
>-                jarList.add(wsInfo);
>-                DeploymentFileData deploymentFileData =
>-                        new DeploymentFileData(file, TYPE_SERVICE);
>-                deployer.addWSToDeploy(
>-                        deploymentFileData);    // inform that new web service is deployed
>-            } else {
>-                if (deployer.isHotUpdate()) {
>-                    WSInfo tempWSInfo = getFileItem(file.getName());
>-                    if (isModified(file, tempWSInfo)) {    // check whether file is updated
>-                        tempWSInfo.setLastModifiedDate(file.lastModified());
>-                        WSInfo wsInfo = new WSInfo(tempWSInfo.getFileName(),
>-                                                   tempWSInfo.getLastModifiedDate(), TYPE_SERVICE);
>-                        deployer.addWSToUndeploy(wsInfo);           // add entry to undeploy list
>-                        DeploymentFileData deploymentFileData = new DeploymentFileData(file,
>-                                                                                       TYPE_SERVICE);
>-                        deployer.addWSToDeploy(deploymentFileData);    // add entry to deploylist
>-                    }
>-                }
>-            }
>-        } else if (TYPE_MODULE.equals(type)) {
>-            if (!isFileExist(file.getName()))
>-            {                     // checking whether the file is already deployed
>-                WSInfo wsInfo = new WSInfo(file.getName(), file.lastModified(), TYPE_MODULE);
>-                jarList.add(wsInfo);
>-                DeploymentFileData deploymentFileData =
>-                        new DeploymentFileData(file, TYPE_MODULE);
>-                deployer.addWSToDeploy(
>-                        deploymentFileData);    // inform that new web service is deployed
>-            }
>-        } else {
>-            if (file != null) {
>-                String extension = DeploymentFileData.getFileExtension(file.getName());
>-                if (!isFileExist(file.getName())) {
>-                    WSInfo wsInfo = new WSInfo(file.getName(), file.lastModified(), extension);
>-                    jarList.add(wsInfo);
>-                    DeploymentFileData deploymentFileData =
>-                            new DeploymentFileData(file, extension);
>-                    deployer.addWSToDeploy(
>-                            deploymentFileData);    // inform that new web service is deployed
>-                } else {
>-                    if (deployer.isHotUpdate()) {
>-                        WSInfo tempWSInfo = getFileItem(file.getName());
>-                        if (isModified(file, tempWSInfo)) {    // check whether file is updated
>-                            tempWSInfo.setLastModifiedDate(file.lastModified());
>-                            WSInfo wsInfo = new WSInfo(tempWSInfo.getFileName(),
>-                                                       tempWSInfo.getLastModifiedDate(), extension);
>-                            deployer.addWSToUndeploy(
>-                                    wsInfo);           // add entry to undeploy list
>-                            DeploymentFileData deploymentFileData = new DeploymentFileData(file,
>-                                                                                           extension);
>-                            deployer.addWSToDeploy(
>-                                    deploymentFileData);    // add entry to deploylist
>-                        }
>-                    }
>-                }
>-            } else {
>-                check = true;
>-            }
>+    public synchronized void addWSInfoItem(File file, Deployer deployer) {
>+        WSInfo info = getFileItem(file.getName());
>+        if (info == null) {
>+            info = new WSInfo(file.getName(), file.lastModified(), deployer);
>+            jarList.add(info);
>+            DeploymentFileData fileData = new DeploymentFileData(file, deployer);
>+            deploymentEngine.addWSToDeploy(fileData);
>+        } else if (deploymentEngine.isHotUpdate() && isModified(file, info)) {
>+            info.setLastModifiedDate(file.lastModified());
>+            WSInfo wsInfo = new WSInfo(info.getFileName(), info.getLastModifiedDate(), deployer);
>+            deploymentEngine.addWSToUndeploy(wsInfo);           // add entry to undeploy list
>+            DeploymentFileData deploymentFileData = new DeploymentFileData(file, deployer);
>+            deploymentEngine.addWSToDeploy(deploymentFileData);    // add entry to deploylist
>         }
>-        if (file != null) {
>-            String jarname = file.getName();
>-            currentJars.add(jarname);
>-        }
>-        check = true;
>     }
> 
>     /**
>@@ -147,33 +94,18 @@
>         }
> 
>         Iterator iter = jarList.listIterator();
>-        int size = currentJars.size();
>         List tempvector = new ArrayList();
> 
>-        tempvector.clear();
>-
>-        String filename;
>-        boolean exist;
>-
>         while (iter.hasNext()) {
>             WSInfo fileitem = (WSInfo) iter.next();
>-            if (TYPE_MODULE.equals(fileitem.getType())) {
>+            if (fileitem.getType() == WSInfo.TYPE_MODULE) {
>                 continue;
>             }
>-            exist = false;
>-            for (int i = 0; i < size; i++) {
>-                filename = (String) currentJars.get(i);
>-                if (filename.equals(fileitem.getFileName())) {
>-                    exist = true;
>-                    break;
>-                }
>-            }
>-            if (!exist) {
>+            String itemName = fileitem.getFileName();
>+            if (!currentJars.contains(itemName)) {
>                 tempvector.add(fileitem);
>-                WSInfo wsInfo = new WSInfo(fileitem.getFileName(), fileitem.getLastModifiedDate(),
>-                                           fileitem.getType());
>-
>-                deployer.addWSToUndeploy(wsInfo);    // this is to be undeployed
>+                WSInfo wsInfo = new WSInfo(fileitem.getFileName(), fileitem.getLastModifiedDate());
>+                deploymentEngine.addWSToUndeploy(wsInfo);    // this is to be undeployed
>             }
>         }
>         for (int i = 0; i < tempvector.size(); i++) {
>@@ -195,10 +127,10 @@
>      *
>      */
>     public void update() {
>-        synchronized (deployer) {
>+        synchronized (deploymentEngine) {
>             checkForUndeployedServices();
>-            deployer.unDeploy();
>-            deployer.doDeploy();
>+            deploymentEngine.unDeploy();
>+            deploymentEngine.doDeploy();
>         }
>     }
> 
>@@ -217,15 +149,6 @@
>             }
>         }
>         return null;
>-    }
>-
>-    /**
>-     * Checks whether the file already exists in the list.
>-     *
>-     * @param filename
>-     */
>-    private boolean isFileExist(String filename) {
>-        return !(getFileItem(filename) == null);
>     }
> 
>     /**
>
>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=532422&r1=532421&r2=532422
>==============================================================================
>--- 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 Wed Apr 25 10:50:48 2007
>@@ -490,8 +490,7 @@
>                     File inputFile = Utils.createTempFile(servicename,
>                             fin,
>                             (File)axisConfig.getParameterValue(Constants.Configuration.ARTIFACTS_TEMP_DIR));
>-                    DeploymentFileData filedata = new DeploymentFileData(inputFile,
>-                                                                         DeploymentConstants.TYPE_SERVICE);
>+                    DeploymentFileData filedata = new DeploymentFileData(inputFile);
> 
>                     filedata.setClassLoader(false,
>                                             moduleClassLoader,
>@@ -509,8 +508,7 @@
>                         }
>                     }
>                     AxisServiceGroup serviceGroup = new AxisServiceGroup(axisConfig);
>-                    serviceGroup.setServiceGroupClassLoader(
>-                            filedata.getClassLoader());
>+                    serviceGroup.setServiceGroupClassLoader(filedata.getClassLoader());
>                     ArrayList serviceList = archiveReader.processServiceGroup(
>                             filedata.getAbsolutePath(), filedata,
>                             serviceGroup, false, wsdlservice,
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisDescription.java Wed Apr 25 10:50:48 2007
>@@ -51,7 +51,6 @@
>     }
> 
>     public void addParameter(Parameter param) throws AxisFault {
>-
>         if (param == null) {
>             return;
>         }
>@@ -62,6 +61,10 @@
>         }
> 
>         parameterInclude.addParameter(param);
>+    }
>+
>+    public void addParameter(String name, Object value) throws AxisFault {
>+        addParameter(new Parameter(name, value));
>     }
> 
>     public void removeParameter(Parameter param) throws AxisFault {
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/description/AxisService2OM.java Wed Apr 25 10:50:48 2007
>@@ -133,13 +133,13 @@
>         soap12 = ele.declareNamespace(URI_WSDL12_SOAP, SOAP12_PREFIX);
>         http = ele.declareNamespace(HTTP_NAMESPACE, HTTP_PREFIX);
>         mime = ele.declareNamespace(MIME_NAMESPACE, MIME_PREFIX);
>-        String prefix = WSDLSerializationUtil.getPrefix(axisService.getTargetNamespace(), namespaceMap);
>+        String prefix = WSDLSerializationUtil.getPrefix(axisService.getTargetNamespace(),
>+                                                        namespaceMap);
>         if (prefix == null || "".equals(prefix)) {
>             prefix = DEFAULT_TARGET_NAMESPACE_PREFIX;
>         }
> 
>-        namespaceMap.put(prefix,
>-                                           axisService.getTargetNamespace());
>+        namespaceMap.put(prefix, axisService.getTargetNamespace());
>         tns = ele.declareNamespace(axisService.getTargetNamespace(), prefix);
> 
>         // adding documentation element
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DispatchPhase.java
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DispatchPhase.java?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DispatchPhase.java (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/engine/DispatchPhase.java Wed Apr 25 10:50:48 2007
>@@ -1,16 +1,30 @@
> package org.apache.axis2.engine;
> 
> import org.apache.axis2.AxisFault;
>+import org.apache.axis2.Constants;
>+import org.apache.axis2.util.JavaUtils;
> import org.apache.axis2.addressing.AddressingHelper;
> import org.apache.axis2.addressing.EndpointReference;
> import org.apache.axis2.context.MessageContext;
>+import org.apache.axis2.context.SessionContext;
>+import org.apache.axis2.context.ServiceGroupContext;
>+import org.apache.axis2.context.ContextFactory;
>+import org.apache.axis2.context.ServiceContext;
>+import org.apache.axis2.context.OperationContext;
> import org.apache.axis2.description.AxisService;
>+import org.apache.axis2.description.AxisOperation;
>+import org.apache.axis2.description.AxisServiceGroup;
> import org.apache.axis2.i18n.Messages;
> import org.apache.axis2.transport.RequestResponseTransport;
>+import org.apache.axis2.transport.TransportListener;
>+import org.apache.axis2.transport.http.HTTPConstants;
> import org.apache.axis2.wsdl.WSDLConstants.WSDL20_2004_Constants;
>+import org.apache.axiom.soap.SOAPHeader;
>+import org.apache.axiom.om.OMElement;
> 
> import java.util.ArrayList;
> import java.util.List;
>+import java.util.Iterator;
> 
> /*
> * Copyright 2004,2005 The Apache Software Foundation.
>@@ -44,13 +58,36 @@
>         if (msgContext.getAxisService() == null) {
>             throw new AxisFault(Messages.getMessage("servicenotfoundforepr",
>                                                     ((toEPR != null) ? toEPR.getAddress() : "")));
>-        } else if (msgContext.getAxisOperation() == null) {
>+        }
>+
>+        AxisService service = msgContext.getAxisService();
>+        AxisOperation operation = msgContext.getAxisOperation();
>+        // If we're configured to do so, check the service for a single op...
>+        if (operation == null &&
>+                JavaUtils.isTrue(service.getParameterValue("supportSingleOperation"))) {
>+            Iterator ops = service.getOperations();
>+            // If there's exactly one, that's the one we want.  If there's more, forget it.
>+            if (ops.hasNext()) {
>+                operation = (AxisOperation)ops.next();
>+                if (ops.hasNext()) {
>+                    operation = null;
>+                }
>+            }
>+        }
>+
>+        // If we still don't have an operation, fault.
>+        if (operation == null) {
>             throw new AxisFault(Messages.getMessage("operationnotfoundforepr",
>                                                     ((toEPR != null) ? toEPR.getAddress()
>                                                             : ""), msgContext.getWSAAction()));
>         }
> 
>+        msgContext.setAxisOperation(operation);
>+        
>         validateTransport(msgContext);
>+
>+        loadContexts(service, msgContext);
>+
>         if (msgContext.getOperationContext() == null) {
>             throw new AxisFault(Messages.getMessage("cannotBeNullOperationContext"));
>         }
>@@ -59,6 +96,7 @@
>             throw new AxisFault(Messages.getMessage("cannotBeNullServiceContext"));
>         }
> 
>+        // TODO - review this
>         if ((msgContext.getAxisOperation() == null) && (msgContext.getOperationContext() != null)) {
>             msgContext.setAxisOperation(msgContext.getOperationContext().getAxisOperation());
>         }
>@@ -96,6 +134,59 @@
>         msgContext.setExecutionChain((ArrayList) operationChain.clone());
>     }
> 
>+    private void loadContexts(AxisService service, MessageContext msgContext) throws AxisFault {
>+        String scope = service == null ? null : service.getScope();
>+        ServiceContext serviceContext = msgContext.getServiceContext();
>+
>+        if ((msgContext.getOperationContext() != null)
>+                && (serviceContext != null)) {
>+            msgContext.setServiceGroupContextId(
>+                    ((ServiceGroupContext) serviceContext.getParent()).getId());
>+            return;
>+        }
>+        if (Constants.SCOPE_TRANSPORT_SESSION.equals(scope)) {
>+            fillContextsFromSessionContext(msgContext);
>+        }
>+
>+        AxisOperation axisOperation = msgContext.getAxisOperation();
>+        if (axisOperation == null) {
>+            return;
>+        }
>+        OperationContext operationContext =
>+                axisOperation.findForExistingOperationContext(msgContext);
>+
>+        if (operationContext != null) {
>+            // register operation context and message context
>+//            axisOperation.registerOperationContext(msgContext, operationContext);
>+            axisOperation.registerMessageContext(msgContext, operationContext);
>+
>+            serviceContext = (ServiceContext) operationContext.getParent();
>+            ServiceGroupContext serviceGroupContext =
>+                    (ServiceGroupContext) serviceContext.getParent();
>+
>+            msgContext.setServiceContext(serviceContext);
>+            msgContext.setServiceGroupContext(serviceGroupContext);
>+            msgContext.setServiceGroupContextId(serviceGroupContext.getId());
>+        } else {    // 2. if null, create new opCtxt
>+            operationContext = ContextFactory.createOperationContext(axisOperation, serviceContext);
>+
>+            axisOperation.registerMessageContext(msgContext, operationContext);
>+            if (serviceContext != null) {
>+                // no need to added to configuration conetxt , since we are happy in
>+                //  storing in session context
>+                operationContext.setParent(serviceContext);
>+            } else {
>+                // fill the service group context and service context info
>+                msgContext.getConfigurationContext().fillServiceContextAndServiceGroupContext(
>+                        msgContext);
>+            }
>+        }
>+        serviceContext = msgContext.getServiceContext();
>+        if (serviceContext != null) {
>+            serviceContext.setMyEPR(msgContext.getTo());
>+        }
>+    }
>+
>     /**
>      * To check wether the incoming request has come in valid transport , simpley the transports
>      * that service author wants to expose
>@@ -119,5 +210,57 @@
>         EndpointReference toEPR = msgctx.getTo();
>         throw new AxisFault(Messages.getMessage("servicenotfoundforepr",
>                                                 ((toEPR != null) ? toEPR.getAddress() : "")));
>+    }
>+
>+    private void fillContextsFromSessionContext(MessageContext msgContext) throws AxisFault {
>+        AxisService service = msgContext.getAxisService();
>+        if (service == null) {
>+            throw new AxisFault(Messages.getMessage("unabletofindservice"));
>+        }
>+        SessionContext sessionContext = msgContext.getSessionContext();
>+        if (sessionContext == null) {
>+            TransportListener listener = msgContext.getTransportIn().getReceiver();
>+            sessionContext = listener.getSessionContext(msgContext);
>+            if (sessionContext == null) {
>+                createAndFillContexts(service, msgContext, sessionContext);
>+                return;
>+            }
>+        }
>+        String serviceGroupName = msgContext.getAxisServiceGroup().getServiceGroupName();
>+        ServiceGroupContext serviceGroupContext = sessionContext.getServiceGroupContext(
>+                serviceGroupName);
>+        if (serviceGroupContext != null) {
>+            //setting service group context
>+            msgContext.setServiceGroupContext(serviceGroupContext);
>+            // setting Service conetxt
>+            msgContext.setServiceContext(
>+                    ContextFactory.createServiceContext(serviceGroupContext, service));
>+        } else {
>+            createAndFillContexts(service, msgContext, sessionContext);
>+        }
>+        ServiceContext serviceContext = sessionContext.getServiceContext(service);
>+        //found the serviceContext from session context , so adding that into msgContext
>+        if (serviceContext != null) {
>+            msgContext.setServiceContext(serviceContext);
>+            serviceContext.setProperty(HTTPConstants.COOKIE_STRING, sessionContext.getCookieID());
>+        }
>+    }
>+
>+    private void createAndFillContexts(AxisService service,
>+                                       MessageContext msgContext,
>+                                       SessionContext sessionContext) throws AxisFault {
>+        ServiceGroupContext serviceGroupContext;
>+        AxisServiceGroup axisServiceGroup = (AxisServiceGroup) service.getParent();
>+        serviceGroupContext = ContextFactory.createServiceGroupContext(
>+                msgContext.getConfigurationContext(), axisServiceGroup);
>+
>+        msgContext.setServiceGroupContext(serviceGroupContext);
>+        ServiceContext serviceContext =
>+                ContextFactory.createServiceContext(serviceGroupContext, service);
>+        msgContext.setServiceContext(serviceContext);
>+        if (sessionContext != null) {
>+            sessionContext.addServiceContext(serviceContext);
>+            sessionContext.addServiceGroupContext(serviceGroupContext);
>+        }
>     }
> }
>
>Modified: webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties?view=diff&rev=532422&r1=532421&r2=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties (original)
>+++ webservices/axis2/trunk/java/modules/kernel/src/org/apache/axis2/i18n/resource.properties Wed Apr 25 10:50:48 2007
>@@ -160,7 +160,7 @@
> transportSenderError=The TransportSender implementation class is required for the transport {0}
> obsererror=An implemenation class of the Observer object is required.
> invalidmoduleconfig=A module configuration exists that is not valid.
>-invalidhandler=The following handler exists is not valid: {0}
>+invalidhandler=Invalid handler config!  Name: {0} Reason: {1}
> parameterlockederror=The {0} parameter is locked at the top level and cannot be overridden.
> op_error=Processing Operations Modules with an error of {0}
> servicenameeror=A service name is required.
>
>Added: webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/axis2.xml
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/axis2.xml?view=auto&rev=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/axis2.xml (added)
>+++ webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/axis2.xml Wed Apr 25 10:50:48 2007
>@@ -0,0 +1,290 @@
>+<!--
>+/*
>+ * Copyright 2001-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.
>+ */
>+ -->
>+
>+<axisconfig name="AxisJava2.0">
>+    <!-- ================================================= -->
>+    <!-- Parameters -->
>+    <!-- ================================================= -->
>+    <parameter name="hotdeployment">true</parameter>
>+    <parameter name="hotupdate">false</parameter>
>+    <parameter name="enableMTOM">false</parameter>
>+    <parameter name="enableSwA">false</parameter>
>+
>+    <!--Uncomment if you want to enable file caching for attachments -->
>+    <!--parameter name="cacheAttachments">true</parameter>
>+    <parameter name="attachmentDIR"></parameter>
>+    <parameter name="sizeThreshold">4000</parameter-->
>+
>+    <!--This will give out the timout of the configuration contexts, in milliseconds-->
>+    <parameter name="ConfigContextTimeoutInterval">30000</parameter>
>+
>+    <!--During a fault, stacktrace can be sent with the fault message. The following flag will control -->
>+    <!--that behaviour.-->
>+    <parameter name="sendStacktraceDetailsWithFaults">false</parameter>
>+
>+    <!--If there aren't any information available to find out the fault reason, we set the message of the expcetion-->
>+    <!--as the faultreason/Reason. But when a fault is thrown from a service or some where, it will be -->
>+    <!--wrapped by different levels. Due to this the initial exception message can be lost. If this flag-->
>+    <!--is set then, Axis2 tries to get the first exception and set its message as the faultreason/Reason.-->
>+    <parameter name="DrillDownToRootCauseForFaultReason">false</parameter>
>+
>+    <parameter name="userName">admin</parameter>
>+    <parameter name="password">axis2</parameter>
>+
>+    <!--To override repository/services you need to uncomment following parameter and value SHOULD be absolute file path.-->
>+    <!--<parameter name="ServicesDirectory">service</parameter>-->
>+    <!--To override repository/modules you need to uncomment following parameter and value SHOULD be absolute file path-->
>+    <!--<parameter name="ModulesDirectory">modules</parameter>-->
>+
>+
>+
>+    <!--Following params will set the proper context paths for invocations. All the endpoints will have a commons context-->
>+    <!--root which can configured using the following contextRoot parameter-->
>+    <!--<parameter name="contextRoot">axis2</parameter>-->
>+
>+    <!--Our HTTP endpoints can handle both REST and SOAP. Following parameters can be used to distingiush those endpoints-->
>+    <!--In case of a servlet, if you change this you have to manually change the settings of your servlet container to map this -->
>+    <!--context path to proper Axis2 servlets-->
>+    <!--<parameter name="servicePath">services</parameter>-->
>+    <!--<parameter name="restPath">rest</parameter>-->
>+
>+    <!-- Following parameter will completely disable REST handling in Axis2-->
>+    <parameter name="disableREST" locked="true">false</parameter>
>+
>+    <!-- If you have a frontend host which exposes this webservice using a different public URL  -->
>+    <!-- use this parameter to override autodetected url -->
>+    <!--<parameter name="httpFrontendHostUrl">https://someotherhost/context</parameter>-->
>+
>+
>+    <!--    The way of adding listener to the system-->
>+    <!--    <listener class="org.apache.axis2.ObserverIMPL">-->
>+    <!--        <parameter name="RSS_URL">http://127.0.0.1/rss</parameter>-->
>+    <!--    </listener>-->
>+
>+    <!-- ================================================= -->
>+    <!-- Message Receivers -->
>+    <!-- ================================================= -->
>+    <!--This is the Deafult Message Receiver for the system , if you want to have MessageReceivers for -->
>+    <!--all the other MEP implement it and add the correct entry to here , so that you can refer from-->
>+    <!--any operation -->
>+    <!--Note : You can ovride this for particular service by adding the same element with your requirement-->
>+     <messageReceivers>
>+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-only"
>+                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
>+        <messageReceiver mep="http://www.w3.org/2004/08/wsdl/in-out"
>+                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
>+        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-only"
>+                         class="org.apache.axis2.receivers.RawXMLINOnlyMessageReceiver"/>
>+        <messageReceiver mep="http://www.w3.org/2006/01/wsdl/in-out"
>+                         class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
>+    </messageReceivers>
>+
>+    <!-- ================================================= -->
>+    <!-- Message Formatter -->
>+    <!-- ================================================= -->
>+    <!--Following content type to message formatter mapping can be used to implement support for different message -->
>+    <!--format  serialization in Axis2. These message formats are expected to be resolved based on the content type. -->
>+    <messageFormatters>
>+        <messageFormatter contentType="application/x-www-form-urlencoded"
>+                         class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
>+        <messageFormatter contentType="multipart/form-data"
>+                         class="org.apache.axis2.transport.http.MultipartFormDataFormatter"/>
>+        <messageFormatter contentType="application/xml"
>+                         class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
>+    </messageFormatters>
>+
>+    <!-- Test custom deployment by registering for "svc" files, and the "widgets" dir -->
>+    <deployer extension="svc" directory="widgets"
>+            class="org.apache.axis2.deployment.deployers.CustomDeployer"/>
>+
>+    <!-- ================================================= -->
>+    <!-- Message Builders -->
>+    <!-- ================================================= -->
>+    <!--Following content type to builder mapping can be used to implement support for different message -->
>+    <!--formats in Axis2. These message formats are expected to be resolved based on the content type. -->
>+    <messageBuilders>
>+        <messageBuilder contentType="application/xml"
>+                         class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
>+        <messageBuilder contentType="application/x-www-form-urlencoded"
>+                         class="org.apache.axis2.builder.XFormURLEncodedBuilder"/>
>+        <messageBuilder contentType="multipart/form-data"
>+                         class="org.apache.axis2.builder.MultipartFormDataBuilder"/>
>+    </messageBuilders>
>+
>+    <!-- ================================================= -->
>+    <!-- Transport Ins -->
>+    <!-- ================================================= -->
>+    <transportReceiver name="http"
>+                       class="org.apache.axis2.transport.http.SimpleHTTPServer">
>+        <parameter name="port">8080</parameter>
>+        <!-- Here is the complete list of supported parameters (see example settings further below):
>+            port: the port to listen on (default 6060)
>+            hostname:  if non-null, url prefix used in reply-to endpoint references                                 (default null)
>+            originServer:  value of http Server header in outgoing messages                                         (default "Simple-Server/1.1")
>+            requestTimeout:  value in millis of time that requests can wait for data                                (default 20000)
>+            requestTcpNoDelay:  true to maximize performance and minimize latency                                   (default true)
>+                                false to minimize bandwidth consumption by combining segments
>+            requestCoreThreadPoolSize:  number of threads available for request processing (unless queue fills up)  (default 25)
>+            requestMaxThreadPoolSize:  number of threads available for request processing if queue fills us         (default 150)
>+                                       note that default queue never fills up:  see HttpFactory
>+            threadKeepAliveTime:  time to keep threads in excess of core size alive while inactive                  (default 180)
>+                                  note that no such threads can exist with default unbounded request queue
>+            threadKeepAliveTimeUnit:  TimeUnit of value in threadKeepAliveTime (default SECONDS)                    (default SECONDS)
>+        -->
>+        <!-- <parameter name="hostname">http://www.myApp.com/ws</parameter> -->
>+        <!-- <parameter name="originServer">My-Server/1.1</parameter>           -->
>+        <!-- <parameter name="requestTimeout">10000</parameter>                   -->
>+        <!-- <parameter name="requestTcpNoDelay">false</parameter>                   -->
>+        <!-- <parameter name="requestCoreThreadPoolSize">50</parameter>                      -->
>+        <!-- <parameter name="RequestMaxThreadPoolSize">100</parameter>                     -->
>+        <!-- <parameter name="threadKeepAliveTime">240000</parameter>                  -->
>+        <!-- <parameter name="threadKeepAliveTimeUnit">MILLISECONDS</parameter>            -->
>+    </transportReceiver>
>+
>+    <!-- ================================================= -->
>+    <!-- Transport Outs -->
>+    <!-- ================================================= -->
>+
>+    <transportSender name="tcp"
>+                     class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
>+    <transportSender name="local"
>+                     class="org.apache.axis2.transport.local.LocalTransportSender"/>
>+    <transportSender name="http"
>+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
>+        <parameter name="PROTOCOL">HTTP/1.1</parameter>
>+        <parameter name="Transfer-Encoding">chunked</parameter>
>+
>+        <!-- If following is set to 'true', optional action part of the Content-Type will not be added to the SOAP 1.2 messages -->
>+        <!--  <parameter name="OmitSOAP12Action">true</parameter>  -->
>+    </transportSender>
>+
>+    <transportSender name="https"
>+                     class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
>+        <parameter name="PROTOCOL">HTTP/1.1</parameter>
>+        <parameter name="Transfer-Encoding">chunked</parameter>
>+    </transportSender>
>+    <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
>+    <transportSender name="jms"
>+                     class="org.apache.axis2.transport.jms.JMSSender"/>
>+    -->
>+
>+    <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
>+   <transportSender name="mailto" class="org.apache.axis2.transport.mail.MailTransportSender">
>+       <parameter name="transport.mail.smtp.host">127.0.0.1</parameter>
>+       <parameter name="transport.mail.smtp.user">axis2</parameter>
>+       <parameter name="transport.mail.smtp.password">axis2</parameter>
>+       <parameter name="transport.mail.smtp.port">25</parameter>
>+   </transportSender>
>+   -->
>+
>+    <!-- ================================================= -->
>+    <!-- Global Modules  -->
>+    <!-- ================================================= -->
>+    <!-- Comment this to disable Addressing -->
>+    <!--<module ref="addressing"/>-->
>+
>+    <!--Configuring module , providing parameters for modules whether they refer or not-->
>+    <!--<moduleConfig name="addressing">-->
>+    <!--<parameter name="addressingPara">N/A</parameter>-->
>+    <!--</moduleConfig>-->
>+
>+    <!-- ================================================= -->
>+    <!-- Clustering  -->
>+    <!-- ================================================= -->
>+    <!-- Configure and uncomment following for preparing Axis2 to a clustered environment -->
>+    <!--
>+    <cluster class="org.apache.axis2.cluster.tribes.TribesClusterManager">
>+        <parameter name="param1">value1</parameter>
>+    	<configurationManager class="org.apache.axis2.cluster.tribes.configuration.TribesConfigurationManager">
>+    	    <listeners>
>+    	    </listeners>
>+    	</configurationManager>
>+    	<contextManager class="org.apache.axis2.cluster.tribes.context.TribesContextManager">
>+    	    <listeners>
>+    	    </listeners>
>+    	</contextManager>
>+    </cluster>
>+    -->
>+
>+    <!-- ================================================= -->
>+    <!-- Phases  -->
>+    <!-- ================================================= -->
>+    <phaseOrder type="InFlow">
>+        <!--  System pre defined phases       -->
>+        <phase name="Transport">
>+            <handler name="RequestURIBasedDispatcher"
>+                     class="org.apache.axis2.engine.RequestURIBasedDispatcher"/>
>+            <handler name="SOAPActionBasedDispatcher"
>+                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher"/>
>+        </phase>
>+        <phase name="Security"/>
>+        <phase name="PreDispatch"/>
>+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
>+            <handler name="AddressingBasedDispatcher"
>+                     class="org.apache.axis2.engine.AddressingBasedDispatcher"/>
>+            <handler name="RequestURIOperationDispatcher"
>+                     class="org.apache.axis2.engine.RequestURIOperationDispatcher"/>
>+            <handler name="SOAPMessageBodyBasedDispatcher"
>+                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher"/>
>+            <handler name="HTTPLocationBasedDispatcher"
>+                     class="org.apache.axis2.engine.HTTPLocationBasedDispatcher"/>
>+        </phase>
>+        <!--  System pre defined phases       -->
>+        <!--   After Postdispatch phase module author or or service author can add any phase he want      -->
>+        <phase name="OperationInPhase"/>
>+	<phase name="soapmonitorPhase"/>
>+    </phaseOrder>
>+    <phaseOrder type="OutFlow">
>+        <!--      user can add his own phases to this area  -->
>+	<phase name="soapmonitorPhase"/>
>+        <phase name="OperationOutPhase"/>
>+        <!--system predefined phase-->
>+        <!--these phase will run irrespective of the service-->
>+        <phase name="PolicyDetermination"/>
>+        <phase name="MessageOut"/>
>+        <phase name="Security"/>
>+    </phaseOrder>
>+    <phaseOrder type="InFaultFlow">
>+        <phase name="PreDispatch"/>
>+        <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
>+            <handler name="RequestURIBasedDispatcher"
>+                     class="org.apache.axis2.engine.RequestURIBasedDispatcher"/>
>+            <handler name="SOAPActionBasedDispatcher"
>+                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher"/>
>+            <handler name="AddressingBasedDispatcher"
>+                     class="org.apache.axis2.engine.AddressingBasedDispatcher"/>
>+            <handler name="RequestURIOperationDispatcher"
>+                     class="org.apache.axis2.engine.RequestURIOperationDispatcher"/>
>+            <handler name="SOAPMessageBodyBasedDispatcher"
>+                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher"/>
>+            <handler name="HTTPLocationBasedDispatcher"
>+                     class="org.apache.axis2.engine.HTTPLocationBasedDispatcher"/>
>+        </phase>
>+        <!--      user can add his own phases to this area  -->
>+        <phase name="OperationInFaultPhase"/>
>+	<phase name="soapmonitorPhase"/>
>+    </phaseOrder>
>+    <phaseOrder type="OutFaultFlow">
>+        <!--      user can add his own phases to this area  -->
>+	<phase name="soapmonitorPhase"/>
>+        <phase name="OperationOutFaultPhase"/>
>+        <phase name="PolicyDetermination"/>
>+        <phase name="MessageOut"/>
>+    </phaseOrder>
>+</axisconfig>
>+
>
>Added: webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/george.svc
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/george.svc?view=auto&rev=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/george.svc (added)
>+++ webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/services/george.svc Wed Apr 25 10:50:48 2007
>@@ -0,0 +1 @@
>+This is a custom service deployment in the services/ directory.  Its name is George.
>
>Added: webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/mary.svc
>URL: http://svn.apache.org/viewvc/webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/mary.svc?view=auto&rev=532422
>==============================================================================
>--- webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/mary.svc (added)
>+++ webservices/axis2/trunk/java/modules/kernel/test-resources/deployment/CustomDeployerRepo/widgets/mary.svc Wed Apr 25 10:50:48 2007
>@@ -0,0 +1 @@
>+This is a custom service deployment in the widgets/ directory.  Its name is Mary.
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
>For additional commands, e-mail: axis-cvs-help@ws.apache.org
>
>
>
>  
>

-- 
Thanks,
Deepal
................................................................
"The highest tower is built one brick at a time"



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