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

svn commit: r357187 [6/25] - in /webservices/axis2/trunk/java/modules/core/src/org/apache/axis2: ./ addressing/ client/ client/async/ context/ deployment/ deployment/listener/ deployment/repository/util/ deployment/scheduler/ deployment/util/ descripti...

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentEngine.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
 
 package org.apache.axis2.deployment;
 
@@ -27,7 +28,12 @@
 import org.apache.axis2.deployment.scheduler.SchedulerTask;
 import org.apache.axis2.deployment.util.PhasesInfo;
 import org.apache.axis2.deployment.util.Utils;
-import org.apache.axis2.description.*;
+import org.apache.axis2.description.AxisOperation;
+import org.apache.axis2.description.AxisService;
+import org.apache.axis2.description.AxisServiceGroup;
+import org.apache.axis2.description.Flow;
+import org.apache.axis2.description.ModuleDescription;
+import org.apache.axis2.description.Parameter;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.Phase;
 import org.apache.axis2.i18n.Messages;
@@ -37,25 +43,48 @@
 
 import javax.xml.namespace.QName;
 import javax.xml.stream.XMLStreamException;
-import java.io.*;
-import java.util.*;
-
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintWriter;
+import java.io.StringWriter;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
 
 public class DeploymentEngine implements DeploymentConstants {
 
+    /**
+     * Resource that contains the configuration
+     */
+    protected static final String AXIS2_CONFIGURATION_RESOURCE =
+            "org/apache/axis2/deployment/axis2.xml";
+    protected static final String SERVER_XML_FILE = "axis2.xml";
     private Log log = LogFactory.getLog(getClass());
-
+    private boolean hotUpdate = true;    // to do hot update or not
+    private boolean hotDeployment = true;    // to do hot deployment or not
     public String axis2repository = null;
-    private boolean hotDeployment = true;   //to do hot deployment or not
-    private boolean hotUpdate = true;  // to do hot update or not
+
     /**
      * This will store all the web Services to deploy
      */
     private List wsToDeploy = new ArrayList();
+
     /**
      * this will store all the web Services to undeploy
      */
     private List wsToUnDeploy = new ArrayList();
+    private PhasesInfo phasesinfo = new PhasesInfo();    // to store phases list in axis2.xml
+
+    /**
+     * To store the module specified in the server.xml at the document parsing time
+     */
+    private ArrayList modulelist = new ArrayList();
 
     /**
      * to keep a ref to engine register
@@ -63,31 +92,15 @@
      * method
      */
     private AxisConfiguration axisConfig;
+    private ArchiveFileData currentArchiveFile;
+    private String engineConfigName;
 
     /**
      * this constaructor for the testing
      */
-
     private String folderName;
     private File repository;
 
-    private String engineConfigName;
-
-    private ArchiveFileData currentArchiveFile;
-
-    /**
-     * To store the module specified in the server.xml at the document parsing time
-     */
-    private ArrayList modulelist = new ArrayList();
-
-    private PhasesInfo phasesinfo = new PhasesInfo(); //to store phases list in axis2.xml
-
-    /**
-     * Resource that contains the configuration
-     */
-    protected static final String AXIS2_CONFIGURATION_RESOURCE = "org/apache/axis2/deployment/axis2.xml";
-    protected static final String SERVER_XML_FILE = "axis2.xml";
-
     /**
      * Default constructor is need to deploye module and service programatically
      */
@@ -101,41 +114,51 @@
      * @param repositoryName is the path to which Repositary Listner should
      *                       listent.
      */
-
     public DeploymentEngine(String repositoryName) throws DeploymentException {
         this(repositoryName, SERVER_XML_FILE);
     }
 
     public DeploymentEngine(String repositoryName, String serverXMLFile)
             throws DeploymentException {
-        if (repositoryName == null || repositoryName.trim().equals("")) {
-            throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.REPO_CAN_NOT_BE_NULL));
+        if ((repositoryName == null) || repositoryName.trim().equals("")) {
+            throw new DeploymentException(
+                    Messages.getMessage(DeploymentErrorMsgs.REPO_CAN_NOT_BE_NULL));
         }
+
         this.folderName = repositoryName;
         axis2repository = repositoryName;
         repository = new File(repositoryName);
+
         if (!repository.exists()) {
             repository.mkdirs();
+
             File services = new File(repository, "services");
             File modules = new File(repository, "modules");
+
             modules.mkdirs();
             services.mkdirs();
         }
+
         File serverConf = new File(repository, serverXMLFile);
+
         if (!serverConf.exists()) {
             ClassLoader cl = Thread.currentThread().getContextClassLoader();
             InputStream in = cl.getResourceAsStream(AXIS2_CONFIGURATION_RESOURCE);
             FileOutputStream out = null;
+
             if (in != null) {
                 try {
                     serverConf.createNewFile();
                     out = new FileOutputStream(serverConf);
-                    int BUFSIZE = 512; // since only a test file going to load , the size has selected
+
+                    int BUFSIZE = 512;    // since only a test file going to load , the size has selected
                     byte[] buf = new byte[BUFSIZE];
                     int read;
+
                     while ((read = in.read(buf)) > 0) {
                         out.write(buf, 0, read);
                     }
+
                     in.close();
                     out.close();
                 } catch (IOException e) {
@@ -145,331 +168,150 @@
                         try {
                             out.close();
                         } catch (IOException e) {
-                            //ignore
+
+                            // ignore
                         }
                     }
+
                     try {
                         in.close();
                     } catch (IOException e) {
-                        //ignore
+
+                        // ignore
                     }
                 }
-
-
             } else {
-                throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.CONFIG_NOT_FOUND));
+                throw new DeploymentException(
+                        Messages.getMessage(DeploymentErrorMsgs.CONFIG_NOT_FOUND));
             }
         }
-        this.engineConfigName = repositoryName + '/' + serverXMLFile;
-    }
 
-    public ArchiveFileData getCurrentFileItem() {
-        return currentArchiveFile;
+        this.engineConfigName = repositoryName + '/' + serverXMLFile;
     }
 
-
     /**
-     * tio get ER
+     * while parsing the axis2.xml the module refferences have to be store some where , since at that
+     * time none of module availble (they load after parsing the document)
      *
-     * @return AxisConfiguration <code>AxisConfiguration</code>
-     */
-    public AxisConfiguration getAxisConfig() {
-        return axisConfig;
-    }
-
-    /**
-     * To set hotDeployment and hot update
+     * @param moduleName <code>QName</code>
      */
-    private void setDeploymentFeatures() {
-        String value;
-        Parameter parahotdeployment = axisConfig.getParameter(HOTDEPLOYMENT);
-        Parameter parahotupdate = axisConfig.getParameter(HOTUPDATE);
-        if (parahotdeployment != null) {
-            value = (String) parahotdeployment.getValue();
-            if ("false".equalsIgnoreCase(value))
-                hotDeployment = false;
-        }
-        if (parahotupdate != null) {
-            value = (String) parahotupdate.getValue();
-            if ("false".equalsIgnoreCase(value))
-                hotUpdate = false;
-        }
+    public void addModule(QName moduleName) {
+        modulelist.add(moduleName);
     }
 
-    public AxisConfiguration load() throws DeploymentException {
-        if (engineConfigName == null) {
-            throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.PATH_TO_CONFIG_CAN_NOT_B_NULL));
-        }
-        File tempfile = new File(engineConfigName);
-        RepositoryListenerImpl repoListener;
-        try {
-            InputStream in = new FileInputStream(tempfile);
-            axisConfig = createEngineConfig();
-            AxisConfigBuilder builder = new AxisConfigBuilder(in, this, axisConfig);
-            builder.populateConfig();
-            axisConfig.setPhasesinfo(phasesinfo);
-            //setting the CLs
-            setClassLoaders(repository);
-        } catch (FileNotFoundException e) {
-            throw new DeploymentException(e);
-        }
-        setDeploymentFeatures();
-        repoListener = new RepositoryListenerImpl(folderName, this);
-        try {
-            axisConfig.setRepository(axis2repository);
-            validateSystemPredefinedPhases();
-            engageModules();
-        } catch (AxisFault axisFault) {
-            log.info(Messages.getMessage(DeploymentErrorMsgs.MODULE_VAL_FAILED, axisFault.getMessage()));
-            throw new DeploymentException(axisFault);
-        }
-        repoListener.checkServices();
-        if (hotDeployment) {
-            startSearch(repoListener);
-        }
-        return axisConfig;
-    }
+    private void addNewModule(ModuleDescription modulemetadata) throws AxisFault {
 
+        // currentArchiveFile.setClassLoader();
+        Flow inflow = modulemetadata.getInFlow();
+        ClassLoader moduleClassLoader = modulemetadata.getModuleClassLoader();
 
-    public AxisConfiguration loadClient(String clientHome) throws DeploymentException {
-        InputStream in;
-        axis2repository = clientHome;
-        boolean isRepositoryExist = false;
-        RepositoryListenerImpl repoListener = null;
-        if (!(clientHome == null || clientHome.trim().equals(""))) {
-            checkClientHome(clientHome);
-            isRepositoryExist = true;
-            try {
-                File tempfile = new File(engineConfigName);
-                in = new FileInputStream(tempfile);
-            } catch (FileNotFoundException e) {
-                throw new DeploymentException(e);
-            }
-        } else {
-            ClassLoader cl = Thread.currentThread().getContextClassLoader();
-            in = cl.getResourceAsStream(AXIS2_CONFIGURATION_RESOURCE);
-            if (in == null) {
-                throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.CONFIG_NOT_FOUND));
-            }
-        }
-        axisConfig = createEngineConfig();
-        AxisConfigBuilder builder = new AxisConfigBuilder(in, this, axisConfig);
-        axisConfig.setPhasesinfo(phasesinfo);
-        builder.populateConfig();
-        if (isRepositoryExist) {
-            hotDeployment = false;
-            hotUpdate = false;
-            //setting CLs
-            setClassLoaders(repository);
-            repoListener = new RepositoryListenerImpl(folderName, this);
-        }
-        try {
-            axisConfig.setRepository(axis2repository);
-            validateSystemPredefinedPhases();
-            engageModules();
-        } catch (AxisFault axisFault) {
-            log.info(Messages.getMessage(DeploymentErrorMsgs.MODULE_VAL_FAILED, axisFault.getMessage()));
-            throw new DeploymentException(axisFault);
-        }
-        if (repoListener != null) {
-            repoListener.checkServices();
+        if (inflow != null) {
+            Utils.addFlowHandlers(inflow, moduleClassLoader);
         }
-        return axisConfig;
-    }
 
+        Flow outFlow = modulemetadata.getOutFlow();
 
-    private void checkClientHome(String clientHome) throws DeploymentException {
-        String clientXML = SERVER_XML_FILE;
-        this.folderName = clientHome;
-        repository = new File(clientHome);
-        if (!repository.exists()) {
-            repository.mkdirs();
-            File services = new File(repository, "services");
-            File modules = new File(repository, "modules");
-            modules.mkdirs();
-            services.mkdirs();
+        if (outFlow != null) {
+            Utils.addFlowHandlers(outFlow, moduleClassLoader);
         }
-        File serverConf = new File(repository, clientXML);
-        if (!serverConf.exists()) {
-            ClassLoader cl = Thread.currentThread().getContextClassLoader();
-            InputStream in = cl.getResourceAsStream(AXIS2_CONFIGURATION_RESOURCE);
-            if (in != null) {
-                try {
-                    serverConf.createNewFile();
-                    FileOutputStream out = new FileOutputStream(serverConf);
-                    int BUFSIZE = 512; // since only a test file going to load , the size has selected
-                    byte[] buf = new byte[BUFSIZE];
-                    int read;
-                    while ((read = in.read(buf)) > 0) {
-                        out.write(buf, 0, read);
-                    }
-                    in.close();
-                    out.close();
-                } catch (IOException e) {
-                    throw new DeploymentException(e);
-                }
 
+        Flow faultInFlow = modulemetadata.getFaultInFlow();
 
-            } else {
-                throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.CONFIG_NOT_FOUND));
-            }
+        if (faultInFlow != null) {
+            Utils.addFlowHandlers(faultInFlow, moduleClassLoader);
         }
-        this.engineConfigName = clientHome + '/' + clientXML;
-    }
 
-    /**
-     * This methode used to check the modules referd by server.xml
-     * are exist , or they have deployed
-     */
-    private void engageModules() throws AxisFault {
-        // ArrayList modules = DeploymentData.getInstance().getModuleRefs();
-        // PhaseResolver resolver = new PhaseResolver(axisConfig);
-        for (Iterator iterator = modulelist.iterator(); iterator.hasNext();) {
-            QName name = (QName) iterator.next();
-            axisConfig.engageModule(name);
-        }
-    }
+        Flow faultOutFlow = modulemetadata.getFaultOutFlow();
 
-    /**
-     * This method is to check wether some one has change the system pre defined phases for all the
-     * flows if some one has done so will throw a DeploymentException
-     *
-     * @throws DeploymentException
-     */
-    private void validateSystemPredefinedPhases() throws DeploymentException {
-        ArrayList inPhases = phasesinfo.getINPhases();
-        try {
-            String phase1 = ((Phase) inPhases.get(0)).getPhaseName();
-            String phases = ((Phase) inPhases.get(1)).getPhaseName();
-            String phase3 = ((Phase) inPhases.get(2)).getPhaseName();
-            if (!(phase1.equals(PhaseMetadata.PHASE_TRANSPORTIN) &&
-                    phases.equals(PhaseMetadata.PHASE_PRE_DISPATCH) &&
-                    phase3.equals(PhaseMetadata.PHASE_DISPATCH))) {
-                throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.INVALID_PHASE));
-            }
-        } catch (Exception e) {
-            throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.INVALID_PHASE));
+        if (faultOutFlow != null) {
+            Utils.addFlowHandlers(faultOutFlow, moduleClassLoader);
         }
-        axisConfig.setInPhasesUptoAndIncludingPostDispatch(
-                phasesinfo.getGlobalInflow());
-        axisConfig.setInFaultPhases(phasesinfo.getIN_FaultPhases());
-        axisConfig.setGlobalOutPhase(phasesinfo.getGlobalOutPhaseList());
-    }
-
-    public ModuleDescription getModule(QName moduleName) throws AxisFault {
-        return axisConfig.getModule(moduleName);
-    }
-
-    /**
-     * this method use to start the Deployment engine
-     * inorder to perform Hot deployment and so on..
-     */
-    private void startSearch(RepositoryListener listener) {
-        Scheduler scheduler = new Scheduler();
-        scheduler.schedule(new SchedulerTask(listener),
-                new DeploymentIterator());
-    }
 
-    private AxisConfiguration createEngineConfig() {
-        return new AxisConfiguration();
+//      modulemetadata.setModuleClassLoader(currentArchiveFile.getClassLoader());
+        axisConfig.addModule(modulemetadata);
+        log.info(Messages.getMessage(DeploymentErrorMsgs.ADDING_NEW_MODULE));
     }
 
     private void addServiceGroup(AxisServiceGroup serviceGroup, ArrayList serviceList)
             throws AxisFault {
         serviceGroup.setParent(axisConfig);
-        //engaging globally engage module to this service group
-        Iterator itr_global_modules =
-                axisConfig.getEngagedModules().iterator();
+
+        // engaging globally engage module to this service group
+        Iterator itr_global_modules = axisConfig.getEngagedModules().iterator();
+
         while (itr_global_modules.hasNext()) {
             QName qName = (QName) itr_global_modules.next();
+
             serviceGroup.engageModuleToGroup(qName);
         }
 
-        //module from services.xml at serviceGroup level
+        // module from services.xml at serviceGroup level
         ArrayList groupModules = serviceGroup.getModuleRefs();
+
         for (int i = 0; i < groupModules.size(); i++) {
             QName moduleName = (QName) groupModules.get(i);
             ModuleDescription module = axisConfig.getModule(moduleName);
+
             if (module != null) {
                 serviceGroup.engageModuleToGroup(moduleName);
             } else {
-                throw new DeploymentException(Messages.getMessage(
-                        DeploymentErrorMsgs.BAD_MODULE_FROM_SERVICE,
-                        serviceGroup.getServiceGroupName()
-                        , moduleName.getLocalPart()));
+                throw new DeploymentException(
+                        Messages.getMessage(
+                                DeploymentErrorMsgs.BAD_MODULE_FROM_SERVICE,
+                                serviceGroup.getServiceGroupName(), moduleName.getLocalPart()));
             }
         }
 
         Iterator services = serviceList.iterator();
+
         while (services.hasNext()) {
             AxisService axisService = (AxisService) services.next();
-            axisService.setFileName(
-                    currentArchiveFile.getFile().getAbsolutePath());
+
+            axisService.setFileName(currentArchiveFile.getFile().getAbsolutePath());
             serviceGroup.addService(axisService);
-            //modules from <service>
+
+            // modules from <service>
             ArrayList list = axisService.getModules();
+
             for (int i = 0; i < list.size(); i++) {
-                ModuleDescription module =
-                        axisConfig.getModule((QName) list.get(i));
+                ModuleDescription module = axisConfig.getModule((QName) list.get(i));
+
                 if (module == null) {
-                    throw new DeploymentException(Messages.getMessage(
-                            DeploymentErrorMsgs.BAD_MODULE_FROM_SERVICE,
-                            axisService.getName(),
-                            ((QName) list.get(i)).getLocalPart()));
+                    throw new DeploymentException(
+                            Messages.getMessage(
+                                    DeploymentErrorMsgs.BAD_MODULE_FROM_SERVICE, axisService.getName(),
+                                    ((QName) list.get(i)).getLocalPart()));
                 }
+
                 axisService.engageModule(module, axisConfig);
             }
 
             HashMap operations = axisService.getOperations();
             Collection opCol = operations.values();
+
             for (Iterator iterator = opCol.iterator(); iterator.hasNext();) {
                 AxisOperation opDesc = (AxisOperation) iterator.next();
                 ArrayList modules = opDesc.getModuleRefs();
+
                 for (int i = 0; i < modules.size(); i++) {
                     QName moduleName = (QName) modules.get(i);
                     ModuleDescription module = axisConfig.getModule(moduleName);
+
                     if (module != null) {
                         opDesc.engageModule(module, axisConfig);
                     } else {
-                        throw new DeploymentException(Messages.getMessage(
-                                DeploymentErrorMsgs.BAD_MODULE_FROM_OPERATION,
-                                opDesc.getName().getLocalPart(),
-                                moduleName.getLocalPart()));
+                        throw new DeploymentException(
+                                Messages.getMessage(
+                                        DeploymentErrorMsgs.BAD_MODULE_FROM_OPERATION,
+                                        opDesc.getName().getLocalPart(), moduleName.getLocalPart()));
                     }
                 }
-
             }
         }
-        axisConfig.addServiceGroup(serviceGroup);
-    }
-
 
-    private void addNewModule(ModuleDescription modulemetadata) throws AxisFault {
-        // currentArchiveFile.setClassLoader();
-        Flow inflow = modulemetadata.getInFlow();
-        ClassLoader moduleClassLoader = modulemetadata.getModuleClassLoader();
-        if (inflow != null) {
-            Utils.addFlowHandlers(inflow, moduleClassLoader);
-        }
-        Flow outFlow = modulemetadata.getOutFlow();
-        if (outFlow != null) {
-            Utils.addFlowHandlers(outFlow, moduleClassLoader);
-        }
-        Flow faultInFlow = modulemetadata.getFaultInFlow();
-        if (faultInFlow != null) {
-            Utils.addFlowHandlers(faultInFlow, moduleClassLoader);
-        }
-
-        Flow faultOutFlow = modulemetadata.getFaultOutFlow();
-        if (faultOutFlow != null) {
-            Utils.addFlowHandlers(faultOutFlow, moduleClassLoader);
-        }
-//        modulemetadata.setModuleClassLoader(currentArchiveFile.getClassLoader());
-        axisConfig.addModule(modulemetadata);
-        log.info(Messages.getMessage(DeploymentErrorMsgs.ADDING_NEW_MODULE));
+        axisConfig.addServiceGroup(serviceGroup);
     }
 
-
     /**
      * @param file
      */
@@ -484,134 +326,504 @@
         wsToUnDeploy.add(file);
     }
 
+    /**
+     * This method can be used to build ModuleDescription for a given module archiev file
+     *
+     * @param modulearchive
+     * @return
+     * @throws DeploymentException
+     */
+    public ModuleDescription buildModule(File modulearchive, AxisConfiguration config)
+            throws DeploymentException {
+        ModuleDescription axismodule;
+
+        try {
+            this.setPhasesinfo(config.getPhasesInfo());
+            currentArchiveFile = new ArchiveFileData(modulearchive, MODULE);
+            axismodule = new ModuleDescription();
+            axismodule.setModuleClassLoader(currentArchiveFile.getClassLoader());
+
+            ArchiveReader archiveReader = new ArchiveReader();
+            ClassLoader moduleClassLoader = config.getModuleClassLoader();
+
+            currentArchiveFile.setClassLoader(false, moduleClassLoader);
+            archiveReader.readModuleArchive(currentArchiveFile.getAbsolutePath(), this, axismodule,
+                    false, axisConfig);
+
+            Flow inflow = axismodule.getInFlow();
+
+            if (inflow != null) {
+                Utils.addFlowHandlers(inflow, moduleClassLoader);
+            }
+
+            Flow outFlow = axismodule.getOutFlow();
+
+            if (outFlow != null) {
+                Utils.addFlowHandlers(outFlow, moduleClassLoader);
+            }
+
+            Flow faultInFlow = axismodule.getFaultInFlow();
+
+            if (faultInFlow != null) {
+                Utils.addFlowHandlers(faultInFlow, moduleClassLoader);
+            }
+
+            Flow faultOutFlow = axismodule.getFaultOutFlow();
+
+            if (faultOutFlow != null) {
+                Utils.addFlowHandlers(faultOutFlow, moduleClassLoader);
+            }
+
+//          loadModuleClass(axismodule);
+        } catch (AxisFault axisFault) {
+            throw new DeploymentException(axisFault);
+        }
+
+        currentArchiveFile = null;
+
+        return axismodule;
+    }
+
+    /*
+     *  public AxisService deployService(ClassLoader classLoder, InputStream serviceStream, String servieName) throws DeploymentException {
+     * AxisService service = null;
+     * try {
+     * currentArchiveFileile = new ArchiveFileData(SERVICE, servieName);
+     * currentArchiveFileile.setClassLoader(classLoder);
+     * service = new AxisService();
+     * DeploymentParser schme = new DeploymentParser(serviceStream, this);
+     * schme.parseServiceXML(service);
+     * service = loadServiceProperties(service);
+     * } catch (XMLStreamException e) {
+     * throw  new DeploymentException(e.getMessage());
+     * } catch (PhaseException e) {
+     * throw  new DeploymentException(e.getMessage());
+     * } catch (AxisFault axisFault) {
+     * throw  new DeploymentException(axisFault.getMessage());
+     * }
+     * return service;
+     * }
+     */
+
+    /**
+     * This method is used to fill a axisservice object using services.xml , first it should create
+     * an axisservice object using WSDL and then fill that using given servic.xml and load all the requed
+     * class and build the chains , finally add the  servicecontext to EngineContext and axisservice into
+     * EngineConfiguration
+     *
+     * @param axisService
+     * @param serviceInputStream
+     * @param classLoader
+     * @return
+     * @throws DeploymentException
+     */
+    public AxisService buildService(AxisService axisService, InputStream serviceInputStream,
+                                    ClassLoader classLoader, AxisConfiguration axisConfig)
+            throws DeploymentException {
+        try {
+            currentArchiveFile = new ArchiveFileData(SERVICE, "");
+            currentArchiveFile.setClassLoader(classLoader);
+
+            ServiceBuilder builder = new ServiceBuilder(serviceInputStream, axisConfig,
+                    axisService);
+
+            builder.populateService(builder.buildOM());
+        } catch (AxisFault axisFault) {
+            throw new DeploymentException(axisFault);
+        } catch (XMLStreamException e) {
+            throw new DeploymentException(e);
+        }
+
+        return axisService;
+    }
+
+    private void checkClientHome(String clientHome) throws DeploymentException {
+        String clientXML = SERVER_XML_FILE;
+
+        this.folderName = clientHome;
+        repository = new File(clientHome);
+
+        if (!repository.exists()) {
+            repository.mkdirs();
+
+            File services = new File(repository, "services");
+            File modules = new File(repository, "modules");
+
+            modules.mkdirs();
+            services.mkdirs();
+        }
+
+        File serverConf = new File(repository, clientXML);
+
+        if (!serverConf.exists()) {
+            ClassLoader cl = Thread.currentThread().getContextClassLoader();
+            InputStream in = cl.getResourceAsStream(AXIS2_CONFIGURATION_RESOURCE);
+
+            if (in != null) {
+                try {
+                    serverConf.createNewFile();
+
+                    FileOutputStream out = new FileOutputStream(serverConf);
+                    int BUFSIZE = 512;    // since only a test file going to load , the size has selected
+                    byte[] buf = new byte[BUFSIZE];
+                    int read;
+
+                    while ((read = in.read(buf)) > 0) {
+                        out.write(buf, 0, read);
+                    }
+
+                    in.close();
+                    out.close();
+                } catch (IOException e) {
+                    throw new DeploymentException(e);
+                }
+            } else {
+                throw new DeploymentException(
+                        Messages.getMessage(DeploymentErrorMsgs.CONFIG_NOT_FOUND));
+            }
+        }
+
+        this.engineConfigName = clientHome + '/' + clientXML;
+    }
+
+    private AxisConfiguration createEngineConfig() {
+        return new AxisConfiguration();
+    }
+
     public void doDeploy() {
         if (wsToDeploy.size() > 0) {
             for (int i = 0; i < wsToDeploy.size(); i++) {
                 currentArchiveFile = (ArchiveFileData) wsToDeploy.get(i);
+
                 boolean explodedDir = currentArchiveFile.getFile().isDirectory();
                 int type = currentArchiveFile.getType();
+
                 try {
                     ArchiveReader archiveReader;
                     StringWriter errorWriter = new StringWriter();
+
                     switch (type) {
-                        case SERVICE:
-                            currentArchiveFile.setClassLoader(explodedDir, axisConfig.getServiceClassLoader());
+                        case SERVICE :
+                            currentArchiveFile.setClassLoader(explodedDir,
+                                    axisConfig.getServiceClassLoader());
                             archiveReader = new ArchiveReader();
+
                             String serviceStatus = "";
+
                             try {
-                                HashMap wsdlservice = archiveReader.processWSDLs(currentArchiveFile, this);
+                                HashMap wsdlservice = archiveReader.processWSDLs(currentArchiveFile,
+                                        this);
+
                                 // AxisService service = archiveReader.generateService(currentArchiveFile.getAbsolutePath());
-                                AxisServiceGroup sericeGroup =
-                                        new AxisServiceGroup(axisConfig);
-                                sericeGroup.setServiceGroupClassLoader(currentArchiveFile.getClassLoader());
+                                AxisServiceGroup sericeGroup = new AxisServiceGroup(axisConfig);
+
+                                sericeGroup.setServiceGroupClassLoader(
+                                        currentArchiveFile.getClassLoader());
+
                                 ArrayList serviceList = archiveReader.processServiceGroup(
-                                        currentArchiveFile.getAbsolutePath(),
-                                        this,
-                                        sericeGroup, explodedDir, wsdlservice, axisConfig);
+                                        currentArchiveFile.getAbsolutePath(), this,
+                                        sericeGroup, explodedDir, wsdlservice,
+                                        axisConfig);
+
                                 addServiceGroup(sericeGroup, serviceList);
-                                log.info(Messages.getMessage(
-                                        DeploymentErrorMsgs.DEPLOYING_WS, currentArchiveFile.getName()));
+                                log.info(Messages.getMessage(DeploymentErrorMsgs.DEPLOYING_WS,
+                                        currentArchiveFile.getName()));
                             } catch (DeploymentException de) {
                                 log.info(Messages.getMessage(DeploymentErrorMsgs.INVALID_SERVICE,
-                                        currentArchiveFile.getName(), de.getMessage()));
+                                        currentArchiveFile.getName(),
+                                        de.getMessage()));
+
                                 PrintWriter error_ptintWriter = new PrintWriter(errorWriter);
+
                                 de.printStackTrace(error_ptintWriter);
-                                serviceStatus = "Error:\n" +
-                                        errorWriter.toString();
+                                serviceStatus = "Error:\n" + errorWriter.toString();
                             } catch (AxisFault axisFault) {
                                 log.info(Messages.getMessage(DeploymentErrorMsgs.INVALID_SERVICE,
-                                        currentArchiveFile.getName(), axisFault.getMessage()));
+                                        currentArchiveFile.getName(),
+                                        axisFault.getMessage()));
+
                                 PrintWriter error_ptintWriter = new PrintWriter(errorWriter);
-                                axisFault.printStackTrace(error_ptintWriter);
-                                serviceStatus = "Error:\n" +
-                                        errorWriter.toString();
 
+                                axisFault.printStackTrace(error_ptintWriter);
+                                serviceStatus = "Error:\n" + errorWriter.toString();
                             } catch (Exception e) {
                                 log.info(Messages.getMessage(DeploymentErrorMsgs.INVALID_SERVICE,
-                                        currentArchiveFile.getName(), e.getMessage()));
+                                        currentArchiveFile.getName(),
+                                        e.getMessage()));
+
                                 PrintWriter error_ptintWriter = new PrintWriter(errorWriter);
+
                                 e.printStackTrace(error_ptintWriter);
-                                serviceStatus = "Error:\n" +
-                                        errorWriter.toString();
+                                serviceStatus = "Error:\n" + errorWriter.toString();
                             } finally {
                                 if (serviceStatus.startsWith("Error:")) {
-                                    axisConfig.getFaultyServices().put(getAxisServiceName(currentArchiveFile.getName()),
+                                    axisConfig.getFaultyServices().put(
+                                            getAxisServiceName(currentArchiveFile.getName()),
                                             serviceStatus);
                                 }
+
                                 currentArchiveFile = null;
                             }
+
                             break;
-                        case MODULE:
-                            currentArchiveFile.setClassLoader(explodedDir, axisConfig.getModuleClassLoader());
+
+                        case MODULE :
+                            currentArchiveFile.setClassLoader(explodedDir,
+                                    axisConfig.getModuleClassLoader());
                             archiveReader = new ArchiveReader();
+
                             String moduleStatus = "";
+
                             try {
                                 ModuleDescription metaData = new ModuleDescription();
+
                                 metaData.setModuleClassLoader(currentArchiveFile.getClassLoader());
                                 metaData.setParent(axisConfig);
                                 archiveReader.readModuleArchive(currentArchiveFile.getAbsolutePath(),
-                                        this,
-                                        metaData, explodedDir, axisConfig);
+                                        this, metaData, explodedDir,
+                                        axisConfig);
                                 addNewModule(metaData);
                                 log.info(Messages.getMessage(DeploymentErrorMsgs.DEPLOYING_MODULE,
                                         metaData.getName().getLocalPart()));
                             } catch (DeploymentException e) {
-                                log.info(Messages.getMessage(
-                                        DeploymentErrorMsgs.INVALID_MODULE, currentArchiveFile.getName(),
+                                log.info(Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE,
+                                        currentArchiveFile.getName(),
                                         e.getMessage()));
+
                                 PrintWriter error_ptintWriter = new PrintWriter(errorWriter);
+
                                 e.printStackTrace(error_ptintWriter);
                                 moduleStatus = "Error:\n" + errorWriter.toString();
                             } catch (AxisFault axisFault) {
-                                log.info(Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE, currentArchiveFile.getName(),
+                                log.info(Messages.getMessage(DeploymentErrorMsgs.INVALID_MODULE,
+                                        currentArchiveFile.getName(),
                                         axisFault.getMessage()));
+
                                 PrintWriter error_ptintWriter = new PrintWriter(errorWriter);
+
                                 axisFault.printStackTrace(error_ptintWriter);
                                 moduleStatus = "Error:\n" + errorWriter.toString();
                             } finally {
                                 if (moduleStatus.startsWith("Error:")) {
-                                    axisConfig.getFaultyModules().put(getAxisServiceName(currentArchiveFile.getName()),
-                                            moduleStatus);
+                                    axisConfig.getFaultyModules().put(
+                                            getAxisServiceName(currentArchiveFile.getName()), moduleStatus);
                                 }
+
                                 currentArchiveFile = null;
                             }
-                            break;
 
+                            break;
                     }
                 } catch (AxisFault axisFault) {
-                    log.info(Messages.getMessage(DeploymentErrorMsgs.SETTING_CL, axisFault.getMessage()));
+                    log.info(Messages.getMessage(DeploymentErrorMsgs.SETTING_CL,
+                            axisFault.getMessage()));
                 }
-
             }
         }
+
         wsToDeploy.clear();
     }
 
+    /**
+     * This methode used to check the modules referd by server.xml
+     * are exist , or they have deployed
+     */
+    private void engageModules() throws AxisFault {
+
+        // ArrayList modules = DeploymentData.getInstance().getModuleRefs();
+        // PhaseResolver resolver = new PhaseResolver(axisConfig);
+        for (Iterator iterator = modulelist.iterator(); iterator.hasNext();) {
+            QName name = (QName) iterator.next();
+
+            axisConfig.engageModule(name);
+        }
+    }
+
+    public AxisConfiguration load() throws DeploymentException {
+        if (engineConfigName == null) {
+            throw new DeploymentException(
+                    Messages.getMessage(DeploymentErrorMsgs.PATH_TO_CONFIG_CAN_NOT_B_NULL));
+        }
+
+        File tempfile = new File(engineConfigName);
+        RepositoryListenerImpl repoListener;
+
+        try {
+            InputStream in = new FileInputStream(tempfile);
+
+            axisConfig = createEngineConfig();
+
+            AxisConfigBuilder builder = new AxisConfigBuilder(in, this, axisConfig);
+
+            builder.populateConfig();
+            axisConfig.setPhasesinfo(phasesinfo);
+
+            // setting the CLs
+            setClassLoaders(repository);
+        } catch (FileNotFoundException e) {
+            throw new DeploymentException(e);
+        }
+
+        setDeploymentFeatures();
+        repoListener = new RepositoryListenerImpl(folderName, this);
+
+        try {
+            axisConfig.setRepository(axis2repository);
+            validateSystemPredefinedPhases();
+            engageModules();
+        } catch (AxisFault axisFault) {
+            log.info(Messages.getMessage(DeploymentErrorMsgs.MODULE_VAL_FAILED,
+                    axisFault.getMessage()));
+
+            throw new DeploymentException(axisFault);
+        }
+
+        repoListener.checkServices();
+
+        if (hotDeployment) {
+            startSearch(repoListener);
+        }
+
+        return axisConfig;
+    }
+
+    public AxisConfiguration loadClient(String clientHome) throws DeploymentException {
+        InputStream in;
+
+        axis2repository = clientHome;
+
+        boolean isRepositoryExist = false;
+        RepositoryListenerImpl repoListener = null;
+
+        if (!((clientHome == null) || clientHome.trim().equals(""))) {
+            checkClientHome(clientHome);
+            isRepositoryExist = true;
+
+            try {
+                File tempfile = new File(engineConfigName);
+
+                in = new FileInputStream(tempfile);
+            } catch (FileNotFoundException e) {
+                throw new DeploymentException(e);
+            }
+        } else {
+            ClassLoader cl = Thread.currentThread().getContextClassLoader();
+
+            in = cl.getResourceAsStream(AXIS2_CONFIGURATION_RESOURCE);
+
+            if (in == null) {
+                throw new DeploymentException(
+                        Messages.getMessage(DeploymentErrorMsgs.CONFIG_NOT_FOUND));
+            }
+        }
+
+        axisConfig = createEngineConfig();
+
+        AxisConfigBuilder builder = new AxisConfigBuilder(in, this, axisConfig);
+
+        axisConfig.setPhasesinfo(phasesinfo);
+        builder.populateConfig();
+
+        if (isRepositoryExist) {
+            hotDeployment = false;
+            hotUpdate = false;
+
+            // setting CLs
+            setClassLoaders(repository);
+            repoListener = new RepositoryListenerImpl(folderName, this);
+        }
+
+        try {
+            axisConfig.setRepository(axis2repository);
+            validateSystemPredefinedPhases();
+            engageModules();
+        } catch (AxisFault axisFault) {
+            log.info(Messages.getMessage(DeploymentErrorMsgs.MODULE_VAL_FAILED,
+                    axisFault.getMessage()));
+
+            throw new DeploymentException(axisFault);
+        }
+
+        if (repoListener != null) {
+            repoListener.checkServices();
+        }
+
+        return axisConfig;
+    }
+
+    /**
+     * this method use to start the Deployment engine
+     * inorder to perform Hot deployment and so on..
+     */
+    private void startSearch(RepositoryListener listener) {
+        Scheduler scheduler = new Scheduler();
+
+        scheduler.schedule(new SchedulerTask(listener), new DeploymentIterator());
+    }
+
     public void unDeploy() {
         String serviceName = "";
+
         try {
             if (wsToUnDeploy.size() > 0) {
                 for (int i = 0; i < wsToUnDeploy.size(); i++) {
                     WSInfo wsInfo = (WSInfo) wsToUnDeploy.get(i);
+
                     if (wsInfo.getType() == SERVICE) {
                         serviceName = getAxisServiceName(wsInfo.getFileName());
-                        //todo fix me deepal
-                        //   axisConfig.removeService(new QName(serviceName));
+
+                        // todo fix me deepal
+                        // axisConfig.removeService(new QName(serviceName));
                         log.info(Messages.getMessage(DeploymentErrorMsgs.SERVICE_REMOVED,
                                 wsInfo.getFileName()));
                     }
+
                     axisConfig.getFaultyServices().remove(serviceName);
                 }
-
             }
         } catch (Exception e) {
             log.info(e);
         }
+
         wsToUnDeploy.clear();
     }
 
-    public boolean isHotUpdate() {
-        return hotUpdate;
+    /**
+     * This method is to check wether some one has change the system pre defined phases for all the
+     * flows if some one has done so will throw a DeploymentException
+     *
+     * @throws DeploymentException
+     */
+    private void validateSystemPredefinedPhases() throws DeploymentException {
+        ArrayList inPhases = phasesinfo.getINPhases();
+
+        try {
+            String phase1 = ((Phase) inPhases.get(0)).getPhaseName();
+            String phases = ((Phase) inPhases.get(1)).getPhaseName();
+            String phase3 = ((Phase) inPhases.get(2)).getPhaseName();
+
+            if (!(phase1.equals(PhaseMetadata.PHASE_TRANSPORTIN)
+                    && phases.equals(PhaseMetadata.PHASE_PRE_DISPATCH)
+                    && phase3.equals(PhaseMetadata.PHASE_DISPATCH))) {
+                throw new DeploymentException(
+                        Messages.getMessage(DeploymentErrorMsgs.INVALID_PHASE));
+            }
+        } catch (Exception e) {
+            throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.INVALID_PHASE));
+        }
+
+        axisConfig.setInPhasesUptoAndIncludingPostDispatch(phasesinfo.getGlobalInflow());
+        axisConfig.setInFaultPhases(phasesinfo.getIN_FaultPhases());
+        axisConfig.setGlobalOutPhase(phasesinfo.getGlobalOutPhaseList());
+    }
+
+    /**
+     * tio get ER
+     *
+     * @return AxisConfiguration <code>AxisConfiguration</code>
+     */
+    public AxisConfiguration getAxisConfig() {
+        return axisConfig;
     }
 
     /**
@@ -625,121 +837,30 @@
         char seperator = '.';
         String value;
         int index = fileName.indexOf(seperator);
+
         if (index > 0) {
             value = fileName.substring(0, index);
+
             return value;
         }
-        return fileName;
-    }
 
-    /**
-     * while parsing the axis2.xml the module refferences have to be store some where , since at that
-     * time none of module availble (they load after parsing the document)
-     *
-     * @param moduleName <code>QName</code>
-     */
-    public void addModule(QName moduleName) {
-        modulelist.add(moduleName);
-    }
-
-    public PhasesInfo getPhasesinfo() {
-        return phasesinfo;
+        return fileName;
     }
 
-    public void setPhasesinfo(PhasesInfo phasesinfo) {
-        this.phasesinfo = phasesinfo;
+    public ArchiveFileData getCurrentFileItem() {
+        return currentArchiveFile;
     }
 
-    /* public AxisService deployService(ClassLoader classLoder, InputStream serviceStream, String servieName) throws DeploymentException {
-    AxisService service = null;
-    try {
-    currentArchiveFileile = new ArchiveFileData(SERVICE, servieName);
-    currentArchiveFileile.setClassLoader(classLoder);
-    service = new AxisService();
-    DeploymentParser schme = new DeploymentParser(serviceStream, this);
-    schme.parseServiceXML(service);
-    service = loadServiceProperties(service);
-    } catch (XMLStreamException e) {
-    throw  new DeploymentException(e.getMessage());
-    } catch (PhaseException e) {
-    throw  new DeploymentException(e.getMessage());
-    } catch (AxisFault axisFault) {
-    throw  new DeploymentException(axisFault.getMessage());
-    }
-    return service;
+    public ModuleDescription getModule(QName moduleName) throws AxisFault {
+        return axisConfig.getModule(moduleName);
     }
-*/
-
-    /**
-     * This method is used to fill a axisservice object using services.xml , first it should create
-     * an axisservice object using WSDL and then fill that using given servic.xml and load all the requed
-     * class and build the chains , finally add the  servicecontext to EngineContext and axisservice into
-     * EngineConfiguration
-     *
-     * @param axisService
-     * @param serviceInputStream
-     * @param classLoader
-     * @return
-     * @throws DeploymentException
-     */
-    public AxisService buildService(AxisService axisService,
-                                    InputStream serviceInputStream,
-                                    ClassLoader classLoader, AxisConfiguration axisConfig) throws DeploymentException {
-        try {
-            currentArchiveFile = new ArchiveFileData(SERVICE, "");
-            currentArchiveFile.setClassLoader(classLoader);
 
-            ServiceBuilder builder = new ServiceBuilder(serviceInputStream, axisConfig, axisService);
-            builder.populateService(builder.buildOM());
-        } catch (AxisFault axisFault) {
-            throw new DeploymentException(axisFault);
-        } catch (XMLStreamException e) {
-            throw new DeploymentException(e);
-        }
-        return axisService;
+    public PhasesInfo getPhasesinfo() {
+        return phasesinfo;
     }
 
-    /**
-     * This method can be used to build ModuleDescription for a given module archiev file
-     *
-     * @param modulearchive
-     * @return
-     * @throws DeploymentException
-     */
-
-    public ModuleDescription buildModule(File modulearchive, AxisConfiguration config) throws DeploymentException {
-        ModuleDescription axismodule;
-        try {
-            this.setPhasesinfo(config.getPhasesInfo());
-            currentArchiveFile = new ArchiveFileData(modulearchive, MODULE);
-            axismodule = new ModuleDescription();
-            axismodule.setModuleClassLoader(currentArchiveFile.getClassLoader());
-            ArchiveReader archiveReader = new ArchiveReader();
-            ClassLoader moduleClassLoader = config.getModuleClassLoader();
-            currentArchiveFile.setClassLoader(false, moduleClassLoader);
-            archiveReader.readModuleArchive(currentArchiveFile.getAbsolutePath(), this, axismodule, false, axisConfig);
-            Flow inflow = axismodule.getInFlow();
-            if (inflow != null) {
-                Utils.addFlowHandlers(inflow, moduleClassLoader);
-            }
-            Flow outFlow = axismodule.getOutFlow();
-            if (outFlow != null) {
-                Utils.addFlowHandlers(outFlow, moduleClassLoader);
-            }
-            Flow faultInFlow = axismodule.getFaultInFlow();
-            if (faultInFlow != null) {
-                Utils.addFlowHandlers(faultInFlow, moduleClassLoader);
-            }
-            Flow faultOutFlow = axismodule.getFaultOutFlow();
-            if (faultOutFlow != null) {
-                Utils.addFlowHandlers(faultOutFlow, moduleClassLoader);
-            }
-//            loadModuleClass(axismodule);
-        } catch (AxisFault axisFault) {
-            throw new DeploymentException(axisFault);
-        }
-        currentArchiveFile = null;
-        return axismodule;
+    public boolean isHotUpdate() {
+        return hotUpdate;
     }
 
     /**
@@ -763,23 +884,56 @@
      * @throws DeploymentException
      */
     private void setClassLoaders(File axis2repo) throws DeploymentException {
-        ClassLoader sysClassLoader = Utils.getClassLoader(
-                Thread.currentThread().getContextClassLoader(), axis2repo);
+        ClassLoader sysClassLoader =
+                Utils.getClassLoader(Thread.currentThread().getContextClassLoader(), axis2repo);
+
         axisConfig.setSystemClassLoader(sysClassLoader);
 
         File services = new File(axis2repo, "services");
+
         if (services.exists()) {
-            axisConfig.setServiceClassLoader(Utils.getClassLoader(
-                    axisConfig.getSystemClassLoader(), services));
+            axisConfig.setServiceClassLoader(
+                    Utils.getClassLoader(axisConfig.getSystemClassLoader(), services));
         } else {
             axisConfig.setServiceClassLoader(axisConfig.getSystemClassLoader());
         }
+
         File modules = new File(axis2repo, "modules");
+
         if (modules.exists()) {
-            axisConfig.setModuleClassLoader(Utils.getClassLoader(
-                    axisConfig.getSystemClassLoader(), modules));
+            axisConfig.setModuleClassLoader(Utils.getClassLoader(axisConfig.getSystemClassLoader(),
+                    modules));
         } else {
             axisConfig.setModuleClassLoader(axisConfig.getSystemClassLoader());
         }
+    }
+
+    /**
+     * To set hotDeployment and hot update
+     */
+    private void setDeploymentFeatures() {
+        String value;
+        Parameter parahotdeployment = axisConfig.getParameter(HOTDEPLOYMENT);
+        Parameter parahotupdate = axisConfig.getParameter(HOTUPDATE);
+
+        if (parahotdeployment != null) {
+            value = (String) parahotdeployment.getValue();
+
+            if ("false".equalsIgnoreCase(value)) {
+                hotDeployment = false;
+            }
+        }
+
+        if (parahotupdate != null) {
+            value = (String) parahotupdate.getValue();
+
+            if ("false".equalsIgnoreCase(value)) {
+                hotUpdate = false;
+            }
+        }
+    }
+
+    public void setPhasesinfo(PhasesInfo phasesinfo) {
+        this.phasesinfo = phasesinfo;
     }
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentErrorMsgs.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentErrorMsgs.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentErrorMsgs.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentErrorMsgs.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
 
 package org.apache.axis2.deployment;
 
@@ -46,7 +47,8 @@
     public static final String INVALID_PHASE = "invalidphase";
     public static final String INVALID_SERVICE = "invalidservice";
     public static final String INVALID_STORAGE_CLASS = "invalid_storage";
-    public static final String MODULE_CANNOTHAVE_BOTH_NAME_AND_REF = "modulecannothavrbothnameandref";
+    public static final String MODULE_CANNOTHAVE_BOTH_NAME_AND_REF =
+            "modulecannothavrbothnameandref";
     public static final String MODULE_NOT_FOUND = "modulenotfound";
     public static final String MODULE_VAL_FAILED = "modulevalfailed";
     public static final String MODULEXML_NOT_FOUND_FOR_THE_MODULE = "modulexmlnotfound";
@@ -55,12 +57,14 @@
     public static final String OBSERVER_ERROR = "obsererror";
     public static final String OP_NOT_FOUN_IN_WSDL = "opnotfoundinwsdl";
     public static final String OPERATION_PROCESS_ERROR = "op_error";
-    public static final String OUTFLOW_NOT_ALLOWED_IN_TRS_IN = "outflownotallowedintrin";
+    public static final String OUTFLOW_NOT_ALLOWED_IN_TRS_IN =
+            "outflownotallowedintrin";
     public static final String PARAMETER_LOCKED = "parameterlockederror";
     public static final String PATH_TO_CONFIG_CAN_NOT_B_NULL = "pathtoconfigcanotnull";
     public static final String PHASE_DOES_NOT_SPECIFED = "phasedosenotspecified";
     public static final String REPO_CAN_NOT_BE_NULL = "repocannotbebull";
-    public static final String SERVICE_MODULE_CAN_NOT_REFER_GLOBAL_PHASE = "servicemodulecannothaveglobal";
+    public static final String SERVICE_MODULE_CAN_NOT_REFER_GLOBAL_PHASE =
+            "servicemodulecannothaveglobal";
     public static final String SERVICE_NAME_ERROR = "servicenameeror";
     public static final String SERVICE_REMOVED = "serviceremoved";
     public static final String SERVICE_XML_NOT_FOUND = "servicexmlnotfound";

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentException.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentException.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentException.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DeploymentException.java Fri Dec 16 09:13:57 2005
@@ -1,31 +1,31 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
 
-package org.apache.axis2.deployment;
 
+package org.apache.axis2.deployment;
 
 import org.apache.axis2.AxisFault;
 
 public class DeploymentException extends AxisFault {
-    public DeploymentException(Throwable cause) {
-        super(cause);
-    }
-
     public DeploymentException(String message) {
         super(message);
+    }
+
+    public DeploymentException(Throwable cause) {
+        super(cause);
     }
 
     public DeploymentException(String message, Throwable cause) {

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DescriptionBuilder.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DescriptionBuilder.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DescriptionBuilder.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/DescriptionBuilder.java Fri Dec 16 09:13:57 2005
@@ -1,18 +1,19 @@
 /*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+*      http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
 
 package org.apache.axis2.deployment;
 
@@ -47,28 +48,29 @@
 /**
  * To do the common tasks for all *Builder class
  */
-public class DescriptionBuilder implements DeploymentConstants{
-
+public class DescriptionBuilder implements DeploymentConstants {
     protected Log log = LogFactory.getLog(getClass());
-    protected InputStream des_inputStream;
     protected AxisConfiguration axisConfig;
-//    protected DeploymentEngine engine;
 
-    public DescriptionBuilder(InputStream serviceInputStream,
-                              AxisConfiguration axisConfig) {
-        this.des_inputStream = serviceInputStream;
-        this.axisConfig = axisConfig;
-    }
+//  protected DeploymentEngine engine;
+
+    protected InputStream des_inputStream;
 
     public DescriptionBuilder() {
     }
 
+    public DescriptionBuilder(InputStream serviceInputStream, AxisConfiguration axisConfig) {
+        this.des_inputStream = serviceInputStream;
+        this.axisConfig = axisConfig;
+    }
+
     /**
      * This will creat OMElemnt for a given descrition document (axis2.xml , services.xml and
      * module.xml)
      *
      * @return OMElement <code>OMElement</code>
      * @throws javax.xml.stream.XMLStreamException
+     *
      */
     public OMElement buildOM() throws XMLStreamException {
         XMLStreamReader xmlReader =
@@ -76,76 +78,147 @@
         OMFactory fac = OMAbstractFactory.getOMFactory();
         StAXOMBuilder staxOMBuilder = new StAXOMBuilder(fac, xmlReader);
         OMElement element = staxOMBuilder.getDocumentElement();
+
         element.build();
+
         return element;
     }
 
+    protected MessageReceiver loadDefaultMessageReceiver() throws DeploymentException {
+        MessageReceiver receiver;
+        String defaultMessageReceiver =
+                "org.apache.axis2.receivers.RawXMLINOutMessageReceiver";
+
+        try {
+
+            /**
+             * Setting default Message Recive as Message Receiver
+             */
+            ClassLoader loader1 = Thread.currentThread().getContextClassLoader();
+            Class messageReceiver = Class.forName(defaultMessageReceiver, true, loader1);
+
+            receiver = ((MessageReceiver) messageReceiver.newInstance());
+        } catch (ClassNotFoundException e) {
+            throw new DeploymentException(
+                    Messages.getMessage(
+                            DeploymentErrorMsgs.ERROR_IN_LOADING_MR, "ClassNotFoundException",
+                            defaultMessageReceiver));
+        } catch (IllegalAccessException e) {
+            throw new DeploymentException(
+                    Messages.getMessage(
+                            DeploymentErrorMsgs.ERROR_IN_LOADING_MR, "IllegalAccessException",
+                            defaultMessageReceiver));
+        } catch (InstantiationException e) {
+            throw new DeploymentException(
+                    Messages.getMessage(
+                            DeploymentErrorMsgs.ERROR_IN_LOADING_MR, "InstantiationException",
+                            defaultMessageReceiver));
+        }
+
+        return receiver;
+    }
+
+    protected MessageReceiver loadMessageReceiver(ClassLoader loader, OMElement reciverElement)
+            throws DeploymentException {
+        OMAttribute recieverName = reciverElement.getAttribute(new QName(CLASSNAME));
+        String className = recieverName.getAttributeValue();
+        MessageReceiver receiver = null;
+
+        try {
+            Class messageReceiver;
+
+            if ((className != null) && !"".equals(className)) {
+                messageReceiver = Class.forName(className, true, loader);
+                receiver = (MessageReceiver) messageReceiver.newInstance();
+            }
+        } catch (ClassNotFoundException e) {
+            throw new DeploymentException(
+                    Messages.getMessage(
+                            DeploymentErrorMsgs.ERROR_IN_LOADING_MR, "ClassNotFoundException", className));
+        } catch (IllegalAccessException e) {
+            throw new DeploymentException(
+                    Messages.getMessage(
+                            DeploymentErrorMsgs.ERROR_IN_LOADING_MR, "IllegalAccessException", className));
+        } catch (InstantiationException e) {
+            throw new DeploymentException(
+                    Messages.getMessage(
+                            DeploymentErrorMsgs.ERROR_IN_LOADING_MR, "InstantiationException", className));
+        }
+
+        return receiver;
+    }
 
     /**
      * To process Flow elements in services.xml
-     * @param flowelement       <code>OMElement</code>
+     *
+     * @param flowelement <code>OMElement</code>
      * @return
-     * @throws DeploymentException  <code>DeploymentException</code>
+     * @throws DeploymentException <code>DeploymentException</code>
      */
     protected Flow processFlow(OMElement flowelement, ParameterInclude parent)
             throws DeploymentException {
         Flow flow = new FlowImpl();
-        if(flowelement == null){
+
+        if (flowelement == null) {
             return flow;
         }
-        Iterator handlers = flowelement.getChildrenWithName(
-                new QName(HANDERST));
+
+        Iterator handlers = flowelement.getChildrenWithName(new QName(HANDERST));
+
         while (handlers.hasNext()) {
-            OMElement  handlerElement =  (OMElement)handlers.next();
-            flow.addHandler(processHandler(handlerElement,parent));
+            OMElement handlerElement = (OMElement) handlers.next();
+
+            flow.addHandler(processHandler(handlerElement, parent));
         }
+
         return flow;
     }
 
     /**
-     *  To process Handler element
-     * @param handler_element    <code>OMElement</code>
+     * To process Handler element
+     *
+     * @param handler_element <code>OMElement</code>
      * @return
-     * @throws DeploymentException    <code>DeploymentException</code>
+     * @throws DeploymentException <code>DeploymentException</code>
      */
-    protected HandlerDescription processHandler(OMElement handler_element,
-                                                ParameterInclude parent)
+    protected HandlerDescription processHandler(OMElement handler_element, ParameterInclude parent)
             throws DeploymentException {
         HandlerDescription handler = new HandlerDescription();
 
-        //Setting Handler name
-        OMAttribute name_attribute = handler_element.getAttribute(
-                new QName(ATTNAME));
-        if(name_attribute == null){
-            throw new DeploymentException(Messages.getMessage(
-                    DeploymentErrorMsgs.INVALID_HANDLER,"Name missing"));
+        // Setting Handler name
+        OMAttribute name_attribute = handler_element.getAttribute(new QName(ATTNAME));
+
+        if (name_attribute == null) {
+            throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.INVALID_HANDLER,
+                    "Name missing"));
         } else {
             handler.setName(new QName(name_attribute.getAttributeValue()));
         }
 
-        //Setting Handler Class name
-        OMAttribute class_attribute = handler_element.getAttribute(
-                new QName(CLASSNAME));
-        if(class_attribute == null){
-            throw new DeploymentException((Messages.getMessage(
-                    DeploymentErrorMsgs.INVALID_HANDLER,"class name missing")));
+        // Setting Handler Class name
+        OMAttribute class_attribute = handler_element.getAttribute(new QName(CLASSNAME));
+
+        if (class_attribute == null) {
+            throw new DeploymentException((Messages.getMessage(DeploymentErrorMsgs.INVALID_HANDLER,
+                    "class name missing")));
         } else {
             handler.setClassName(class_attribute.getAttributeValue());
         }
 
-        //processing phase Rules (order)
-        OMElement order_element = handler_element.getFirstChildWithName(
-                new QName(ORDER));
-        if(order_element == null){
-            throw new DeploymentException((Messages.getMessage(
-                    DeploymentErrorMsgs.INVALID_HANDLER,
+        // processing phase Rules (order)
+        OMElement order_element = handler_element.getFirstChildWithName(new QName(ORDER));
+
+        if (order_element == null) {
+            throw new DeploymentException((Messages.getMessage(DeploymentErrorMsgs.INVALID_HANDLER,
                     "phase rule does not specify")));
         } else {
             Iterator order_itr = order_element.getAllAttributes();
+
             while (order_itr.hasNext()) {
                 OMAttribute orderAttribute = (OMAttribute) order_itr.next();
-                String name  = orderAttribute.getQName().getLocalPart();
+                String name = orderAttribute.getQName().getLocalPart();
                 String value = orderAttribute.getAttributeValue();
+
                 if (AFTER.equals(name)) {
                     handler.getRules().setAfter(value);
                 } else if (BEFORE.equals(name)) {
@@ -154,6 +227,7 @@
                     handler.getRules().setPhaseName(value);
                 } else if (PHASEFIRST.equals(name)) {
                     String boolval = getValue(value);
+
                     if (boolval.equals("true")) {
                         handler.getRules().setPhaseFirst(true);
                     } else if (boolval.equals("false")) {
@@ -161,96 +235,131 @@
                     }
                 } else if (PHASELAST.equals(name)) {
                     String boolval = getValue(value);
+
                     if (boolval.equals("true")) {
                         handler.getRules().setPhaseLast(true);
                     } else if (boolval.equals("false")) {
                         handler.getRules().setPhaseLast(false);
                     }
                 }
-
             }
-            Iterator parameters = handler_element.getChildrenWithName(
-                    new QName(PARAMETER));
-            processParameters(parameters,handler,parent);
+
+            Iterator parameters = handler_element.getChildrenWithName(new QName(PARAMETER));
+
+            processParameters(parameters, handler, parent);
         }
+
         handler.setParent(parent);
+
         return handler;
     }
 
+    protected void processOperationModuleRefs(Iterator moduleRefs, AxisOperation operation)
+            throws DeploymentException {
+        try {
+            while (moduleRefs.hasNext()) {
+                OMElement moduleref = (OMElement) moduleRefs.next();
+                OMAttribute moduleRefAttribute = moduleref.getAttribute(new QName(REF));
+
+                if (moduleRefAttribute != null) {
+                    String refName = moduleRefAttribute.getAttributeValue();
+
+                    if (axisConfig.getModule(new QName(refName)) == null) {
+                        throw new DeploymentException(
+                                Messages.getMessage(DeploymentErrorMsgs.MODULE_NOT_FOUND, refName));
+                    } else {
+                        operation.addModule(new QName(refName));
+                    }
+                }
+            }
+        } catch (AxisFault axisFault) {
+            throw new DeploymentException(Messages.getMessage(DeploymentErrorMsgs.MODULE_NOT_FOUND,
+                    axisFault.getMessage()));
+        }
+    }
+
     /**
      * To get the Parameter object out from the OM
-     * @param parameters <code>Parameter</code>
+     *
+     * @param parameters       <code>Parameter</code>
      * @param parameterInclude <code>ParameterInclude</code>
-     * @param parent <code>ParameterInclude</code>
-     * return : will return parameters , wchih name is WSA-Mapping , since we need to treat them
-     * separately
+     * @param parent           <code>ParameterInclude</code>
+     *                         return : will return parameters , wchih name is WSA-Mapping , since we need to treat them
+     *                         separately
      */
-    protected ArrayList processParameters(Iterator parameters,
-                                          ParameterInclude parameterInclude,
-                                          ParameterInclude parent )
+    protected ArrayList processParameters(Iterator parameters, ParameterInclude parameterInclude,
+                                          ParameterInclude parent)
             throws DeploymentException {
         ArrayList wsamapping = new ArrayList();
+
         while (parameters.hasNext()) {
-            //this is to check whether some one has locked the parmter at the top level
-            OMElement parameterElement = (OMElement) parameters.next();
 
+            // this is to check whether some one has locked the parmter at the top level
+            OMElement parameterElement = (OMElement) parameters.next();
             Parameter parameter = new ParameterImpl();
-            //setting parameterElement
+
+            // setting parameterElement
             parameter.setParameterElement(parameterElement);
 
-            //setting parameter Name
-            OMAttribute paraName = parameterElement.getAttribute(
-                    new QName(ATTNAME));
-            if(paraName == null ){
+            // setting parameter Name
+            OMAttribute paraName = parameterElement.getAttribute(new QName(ATTNAME));
+
+            if (paraName == null) {
                 throw new DeploymentException(
                         Messages.getMessage(DeploymentErrorMsgs.BAD_PARA_ARGU));
             }
+
             parameter.setName(paraName.getAttributeValue());
 
-            //setting parameter Value (the chiled elemnt of the parameter)
+            // setting parameter Value (the chiled elemnt of the parameter)
             OMElement paraValue = parameterElement.getFirstElement();
-            if(paraValue !=null){
+
+            if (paraValue != null) {
                 parameter.setValue(parameterElement);
                 parameter.setParameterType(Parameter.OM_PARAMETER);
             } else {
                 String paratextValue = parameterElement.getText();
+
                 parameter.setValue(paratextValue);
                 parameter.setParameterType(Parameter.TEXT_PARAMETER);
             }
 
-            //setting locking attribute
-            OMAttribute paraLocked = parameterElement.getAttribute(
-                    new QName(ATTLOCKED));
+            // setting locking attribute
+            OMAttribute paraLocked = parameterElement.getAttribute(new QName(ATTLOCKED));
             Parameter parentpara = null;
-            if (parent !=null) {
+
+            if (parent != null) {
                 parentpara = parent.getParameter(parameter.getName());
             }
-            if (paraLocked !=null) {
+
+            if (paraLocked != null) {
                 String lockedValue = paraLocked.getAttributeValue();
-                if("true".equals(lockedValue)){
+
+                if ("true".equals(lockedValue)) {
+
                     // if the parameter is locked at some level parameter value replace by that
-                    if (parent!=null &&
-                            parent.isParameterLocked(parameter.getName())){
-                        throw new DeploymentException(Messages.getMessage(
-                                DeploymentErrorMsgs.CONFIG_NOT_FOUND,
-                                parameter.getName()));
-                    } else{
+                    if ((parent != null) && parent.isParameterLocked(parameter.getName())) {
+                        throw new DeploymentException(
+                                Messages.getMessage(
+                                        DeploymentErrorMsgs.CONFIG_NOT_FOUND, parameter.getName()));
+                    } else {
                         parameter.setLocked(true);
                     }
-
                 } else {
                     parameter.setLocked(false);
                 }
             }
-            if(Constants.WSA_ACTION.equals(paraName.getAttributeValue())){
+
+            if (Constants.WSA_ACTION.equals(paraName.getAttributeValue())) {
                 wsamapping.add(parameter);
+
                 // no need to add this parameter , since this is just for mapping
                 continue;
             }
+
             try {
-                if(parent !=null){
-                    if(parentpara == null ||
-                            !parent.isParameterLocked(parameter.getName())){
+                if (parent != null) {
+                    if ((parentpara == null) || !parent.isParameterLocked(parameter.getName())) {
                         parameterInclude.addParameter(parameter);
                     }
                 } else {
@@ -260,102 +369,10 @@
                 throw new DeploymentException(axisFault);
             }
         }
-        return wsamapping;
-    }
-
-
-    protected void processOperationModuleRefs(Iterator moduleRefs,
-                                              AxisOperation operation)
-            throws DeploymentException {
-        try {
-            while (moduleRefs.hasNext()) {
-                OMElement moduleref = (OMElement) moduleRefs.next();
-                OMAttribute moduleRefAttribute = moduleref.getAttribute(
-                        new QName(REF));
-                if (moduleRefAttribute !=null) {
-                    String refName = moduleRefAttribute.getAttributeValue();
-                    if(axisConfig.getModule(new QName(refName)) == null) {
-                        throw new DeploymentException(Messages.getMessage(
-                                DeploymentErrorMsgs.MODULE_NOT_FOUND,
-                                refName));
-                    } else {
-                        operation.addModule(new QName(refName));
-                    }
-                }
-            }
-        }catch (AxisFault axisFault) {
-            throw new DeploymentException(Messages.getMessage(
-                    DeploymentErrorMsgs.MODULE_NOT_FOUND,
-                    axisFault.getMessage()));
-        }
-    }
 
-    protected MessageReceiver loadMessageReceiver(ClassLoader loader,
-                                                  OMElement reciverElement)
-            throws DeploymentException {
-        OMAttribute recieverName = reciverElement.getAttribute(
-                new QName(CLASSNAME));
-        String className = recieverName.getAttributeValue();
-        MessageReceiver receiver = null;
-        try{
-            Class messageReceiver ;
-            if (className != null &&!"".equals(className)) {
-                messageReceiver = Class.forName(className,true,loader);
-                receiver = (MessageReceiver) messageReceiver.newInstance();
-            }
-        } catch (ClassNotFoundException e) {
-            throw new DeploymentException(Messages.getMessage(
-                    DeploymentErrorMsgs.ERROR_IN_LOADING_MR,
-                    "ClassNotFoundException",
-                    className));
-        } catch (IllegalAccessException e) {
-            throw new DeploymentException(Messages.getMessage(
-                    DeploymentErrorMsgs.ERROR_IN_LOADING_MR,
-                    "IllegalAccessException",
-                    className));
-        } catch (InstantiationException e) {
-            throw new DeploymentException(Messages.getMessage(
-                    DeploymentErrorMsgs.ERROR_IN_LOADING_MR,
-                    "InstantiationException",
-                    className));
-        }
-        return receiver;
-    }
-
-    protected MessageReceiver loadDefaultMessageReceiver()
-            throws DeploymentException {
-        MessageReceiver receiver;
-        String defaultMessageReceiver =
-                "org.apache.axis2.receivers.RawXMLINOutMessageReceiver";
-        try {
-            /**
-             * Setting default Message Recive as Message Receiver
-             */
-            ClassLoader loader1 = Thread.currentThread()
-                    .getContextClassLoader();
-            Class messageReceiver =
-                    Class.forName(defaultMessageReceiver,true,loader1);
-            receiver = ((MessageReceiver) messageReceiver.newInstance());
-        } catch (ClassNotFoundException e) {
-            throw new DeploymentException(Messages.getMessage(
-                    DeploymentErrorMsgs.ERROR_IN_LOADING_MR,
-                    "ClassNotFoundException",
-                    defaultMessageReceiver));
-        } catch (IllegalAccessException e) {
-            throw new DeploymentException(Messages.getMessage(
-                    DeploymentErrorMsgs.ERROR_IN_LOADING_MR,
-                    "IllegalAccessException",
-                    defaultMessageReceiver));
-        } catch (InstantiationException e) {
-            throw new DeploymentException(Messages.getMessage(
-                    DeploymentErrorMsgs.ERROR_IN_LOADING_MR,
-                    "InstantiationException",
-                    defaultMessageReceiver));
-        }
-        return receiver;
+        return wsamapping;
     }
 
-
     /**
      * This method is used to retrive service name form the arechive file name
      * if the archive file name is service1.aar , then axis service name would be service1
@@ -367,14 +384,16 @@
         char seperator = '.';
         String value;
         int index = fileName.lastIndexOf(seperator);
+
         if (index > 0) {
             value = fileName.substring(0, index);
+
             return value;
         }
+
         return fileName;
     }
 
-
     /**
      * this method is to get the value of attribue
      * eg xsd:anyVal --> anyVal
@@ -383,15 +402,15 @@
      */
     protected String getValue(String in) {
         char seperator = ':';
-        String value ;
+        String value;
         int index = in.indexOf(seperator);
+
         if (index > 0) {
             value = in.substring(index + 1, in.length());
+
             return value;
         }
+
         return in;
     }
-
-
-
 }

Modified: webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/FileSystemBasedAxisConfigurationCreteator.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/FileSystemBasedAxisConfigurationCreteator.java?rev=357187&r1=357186&r2=357187&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/FileSystemBasedAxisConfigurationCreteator.java (original)
+++ webservices/axis2/trunk/java/modules/core/src/org/apache/axis2/deployment/FileSystemBasedAxisConfigurationCreteator.java Fri Dec 16 09:13:57 2005
@@ -3,6 +3,7 @@
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.engine.AxisConfiguration;
 import org.apache.axis2.engine.AxisConfigurationCreator;
+
 /*
 * Copyright 2004,2005 The Apache Software Foundation.
 *
@@ -23,11 +24,11 @@
 
 public class FileSystemBasedAxisConfigurationCreteator implements AxisConfigurationCreator {
 
-    private String repoLocation;
     /**
      * To check whether need to create a service side or client side
      */
     private boolean isServer;
+    private String repoLocation;
 
     public FileSystemBasedAxisConfigurationCreteator(String repoLocation, boolean isServer) {
         this.repoLocation = repoLocation;
@@ -41,11 +42,12 @@
      * @return
      * @throws AxisFault
      */
-
     public AxisConfiguration getAxisConfiguration() throws AxisFault {
         DeploymentEngine deploymentEngine;
+
         if (isServer) {
             deploymentEngine = new DeploymentEngine(repoLocation);
+
             return deploymentEngine.load();
         } else {
             return new DeploymentEngine().loadClient(repoLocation);