[esb-java-dev] svn commit r6137 - in trunk/esb/java: . modules/core/src/main/java/org/wso2/esb modules/core/src/main/java/org/wso2/esb/persistence modules/core/src/main/java/org/wso2/esb/persistence/dao modules/core/src/main/java/org/wso2/esb/registry modules/core/src/main/java/org/wso2/esb/services modules/core/src/main/java/org/wso2/esb/services/tos modules/core/src/main/java/org/wso2/esb/statistics modules/core/src/main/java/org/wso2/esb/statistics/persistence modules/core/src/main/java/org/wso2/esb/transport modules/core/src/main/java/org/wso2/esb/transport/jetty modules/core/src/main/java/org/wso2/esb/transport/tomcat modules/core/src/main/java/org/wso2/esb/util modules/core/src/test/java/org/wso2/esb/util modules/core/src/test/resources modules/distribution/src/main/assembly modules/distribution/src/main/bin modules/distribution/src/main/conf modules/distribution/src/main/conf/tomcat modules/samples/services/FastStockQuoteService modules/samples/services/LoadbalanceFailoverService modules/samples/services/MTOMSwASampleService modules/samples/services/ReliableStockQuoteService modules/samples/services/SecureStockQuoteService modules/samples/services/SimpleStockQuoteService modules/samples/src/main/scripts

svn at wso2.org svn at wso2.org
Mon Aug 6 08:31:04 PDT 2007


Author: indika
Date: Mon Aug  6 08:29:40 2007
New Revision: 6137

Added:
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/Main.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusConstants.java   (contents, props changed)
      - copied, changed from r5159, trunk/esb/java/modules/core/src/main/java/org/wso2/esb/Constants.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/WebServer.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/ESBServlet.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/RequestRedirectionFilter.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/StartUpServlet.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/TomcatServer.java
   trunk/esb/java/modules/distribution/src/main/conf/tomcat/
   trunk/esb/java/modules/distribution/src/main/conf/tomcat/context.xml
   trunk/esb/java/modules/distribution/src/main/conf/tomcat/tomcat-users.xml
   trunk/esb/java/modules/distribution/src/main/conf/tomcat/web.xml
   trunk/esb/java/modules/distribution/src/main/conf/web.xml
Removed:
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/Constants.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBus.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/ServiceHTMLProcessor.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/jetty/
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/util/JettyWebConfiguration.java
Modified:
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusConfiguration.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusController.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusManager.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/persistence/PersistenceManager.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/persistence/dao/RegistryEntryDAO.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/registry/ESBRegistry.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/AbstractESBAdmin.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/ConfigAdmin.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/EndpointAdmin.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/EntriesAdmin.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/LoginAdmin.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/ProxyServiceAdmin.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/RegistryAdmin.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/SequenceAdmin.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/ServerAdmin.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/ServiceAdmin.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/tos/ServerStatus.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/statistics/StatisticsReporterThread.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/statistics/persistence/StatisticsDBUtils.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/util/MIMEType2FileExtensionMap.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/util/XmlConfiguration.java
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/util/XmlConfigurationFactory.java
   trunk/esb/java/modules/core/src/test/java/org/wso2/esb/util/ServiceBusUtils.java
   trunk/esb/java/modules/core/src/test/resources/hibernate.cfg.xml
   trunk/esb/java/modules/distribution/src/main/assembly/bin.xml
   trunk/esb/java/modules/distribution/src/main/bin/install-wso2-esb-service.bat
   trunk/esb/java/modules/distribution/src/main/bin/uninstall-wso2-esb-service.bat
   trunk/esb/java/modules/distribution/src/main/bin/wso2-esb.bat
   trunk/esb/java/modules/distribution/src/main/bin/wso2-esb.sh
   trunk/esb/java/modules/distribution/src/main/conf/axis2.xml
   trunk/esb/java/modules/distribution/src/main/conf/server-web.xml
   trunk/esb/java/modules/distribution/src/main/conf/server.xml
   trunk/esb/java/modules/distribution/src/main/conf/synapse.xml
   trunk/esb/java/modules/distribution/src/main/conf/wrapper.conf
   trunk/esb/java/modules/distribution/src/main/conf/wso2esb.hibernate.cfg.xml
   trunk/esb/java/modules/samples/services/FastStockQuoteService/build.xml
   trunk/esb/java/modules/samples/services/LoadbalanceFailoverService/build.xml
   trunk/esb/java/modules/samples/services/MTOMSwASampleService/build.xml
   trunk/esb/java/modules/samples/services/ReliableStockQuoteService/build.xml
   trunk/esb/java/modules/samples/services/SecureStockQuoteService/build.xml
   trunk/esb/java/modules/samples/services/SimpleStockQuoteService/build.xml
   trunk/esb/java/modules/samples/src/main/scripts/axis2server.bat
   trunk/esb/java/modules/samples/src/main/scripts/axis2server.sh
   trunk/esb/java/modules/samples/src/main/scripts/build.xml
   trunk/esb/java/pom.xml
Log:
Remove the Jetty Transport 
Add a  Tomcat Transport
add capability to run esb as a Embedded Tomcat server  and  a web 
application 
change required scripts  



Added: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/Main.java
==============================================================================
--- (empty file)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/Main.java	Mon Aug  6 08:29:40 2007
@@ -0,0 +1,263 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.wso2.esb;
+
+import org.apache.axis2.AxisFault;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.esb.transport.WebServer;
+import org.wso2.esb.transport.tomcat.TomcatServer;
+import org.wso2.esb.util.XmlConfigurationFactory;
+import org.wso2.utils.ServerConfiguration;
+import org.wso2.utils.ServerException;
+
+import java.io.File;
+
+/**
+ *
+ */
+
+public class Main {
+
+    private static Log log = LogFactory.getLog(Main.class);
+
+    //ESB lifecycle commads
+    public static final String COMMAND_START = "START";
+    public static final String COMMAND_RUN = "RUN";
+    public static final String COMMAND_STOP = "STOP";
+    public static final String COMMAND_STATUS = "STATUS";
+    public static final String COMMAND_HELP = "HELP";
+
+    /**
+     * The Tomcat server used internally to host the admin console
+     */
+    private WebServer webServer;
+
+    private static ServiceBusConfiguration esbConfiguration;
+
+    private String axis2RepoLocation;
+
+    private static boolean isShutdownHookAdded;
+
+    static {
+        ServiceBusManager.initSystemProperties();
+    }
+
+    public Main() {
+        if (System.getProperty(ServiceBusConstants.ESB_HOME) == null) {
+            System.setProperty(ServiceBusConstants.ESB_HOME, ".");
+        }
+        esbConfiguration = ServiceBusConfiguration.getServiceBusInstance();
+        // intializing configs related to JettyServer
+        try {
+            String server_web_xml = System.getProperty(ServiceBusConstants.ESB_SERVER_WEB_XML);
+            if (server_web_xml == null || "".equals(server_web_xml)) {
+                server_web_xml = ServiceBusConstants.ESB_CONF_DIRECTORY + File.separator + ServiceBusConstants.ESB_SERVER_WEB_XML;
+            }
+            XmlConfigurationFactory.init(ServiceBusConstants.ESB_WEB_XML_KEY,
+                                         server_web_xml, ServiceBusConstants.ESB_XML_NAMESPACE);
+        } catch (ServerException e) {
+            log.error("Error loading server-web.xml", e);
+        }
+    }
+
+    public void startServer() throws ServiceBusException {
+        startListeners();
+    }
+
+    public void stopServer() throws ServiceBusException {
+        stopListeners();
+    }
+
+    private void startListeners() throws ServiceBusException {
+
+        webServer = new TomcatServer(esbConfiguration);
+        try {
+            webServer.start();
+        } catch (AxisFault axisFault) {
+            throw new ServiceBusException(axisFault);
+        } catch (Exception e) {
+            throw new ServiceBusException(e);
+        }
+
+
+    }
+
+    //THIS METHOD ONLY FOR TESTING PURPOSES.
+    public void startListener(final int port) throws AxisFault, ServiceBusException {
+        webServer = new TomcatServer(esbConfiguration);
+        try {
+            webServer.start(); //todo: check
+        } catch (Exception e) {
+            throw new ServiceBusException(e);
+        }
+    }
+
+    private void stopListeners() throws ServiceBusException {
+
+        if (webServer != null) {
+            try {
+                webServer.stop();
+            } catch (AxisFault axisFault) {
+                log.fatal("ServiceBus#stopListener encounted an error", axisFault);
+                throw new ServiceBusException("ServiceBus#stopListener encounted an error");
+            } catch (Exception e) {
+                log.fatal("ServiceBus#stopListener encounted an error", e);
+                throw new ServiceBusException("ServiceBus#stopListener encounted an error");
+            }
+        } else {
+            log.fatal("ServiceBus#stopListener encounted an error");
+            throw new ServiceBusException(
+                    "ServiceBus#stopListener encounted an error");
+        }
+    }
+
+    public void status() {
+        //serviceBusManager.status();
+    }
+
+    public void shutdown() throws ServiceBusException {
+        stopListeners();
+    }
+
+    public static void main(String[] args) {//throws Exception {
+        String cmd;
+        if (args.length >= 1) {
+            cmd = args[0];
+        } else {
+            log.error("ERROR :: Wrong number of arguments.");
+            printUsages();
+            return;
+        }
+
+        long before = System.currentTimeMillis();
+        final Main esb = new Main();
+
+        esb.setAxis2RepoLocation(esbConfiguration.getFirstProperty(
+                ServerConfiguration.AXIS2_CONFIG_REPO_LOCATION));
+
+        if (cmd.toUpperCase().equals(COMMAND_START)) {
+            // when starting the server with start command, a server socket starts to
+            // listen to the incomming commands. but no shut down hooks are registered
+            log.info("Using Repository " + new File(".").getAbsolutePath() +
+                     File.separator + esb.getAxis2RepoLocation());
+            startServiceBusController();
+            try {
+                esb.startServer();
+            } catch (ServiceBusException e) {
+                log.fatal(e);
+            }
+            log.info("WSO2 ESB started in " +
+                     (System.currentTimeMillis() - before) + " ms");
+
+        } else if (cmd.toUpperCase().equals(COMMAND_RUN)) {
+
+            // when starting the server with start command, a server socket starts to
+            // listen to the incomming commands. but no shut down hooks are registered
+            log.info("Using Repository " + new File(".").getAbsolutePath() +
+                     File.separator + esb.getAxis2RepoLocation());
+
+            startServiceBusController();
+            try {
+                esb.startServer();
+                esb.addShutdownHook();
+            } catch (ServiceBusException e) {
+                log.fatal(e);
+            }
+            log.info("WSO2 ESB server started in " +
+                     (System.currentTimeMillis() - before) + " ms");
+
+        } else if (cmd.toUpperCase().equals(COMMAND_STOP)) {
+            ServiceBusController esbController =
+                    new ServiceBusController();
+            int serverPort = Integer.parseInt(esbConfiguration.
+                    getFirstProperty(
+                    ServerConfiguration.COMMAND_LISTENER_PORT));
+            esbController.setPort(serverPort);
+            esbController.shutDownServer();
+
+        } else if (cmd.toUpperCase().equals(COMMAND_STATUS)) {
+            esb.status();
+        } else if (cmd.toUpperCase().equals(COMMAND_HELP)) {
+            printUsages();
+        }
+
+    }
+
+    private static void startServiceBusController() {
+        ServiceBusController esbController =
+                new ServiceBusController();
+        int serverPort = Integer.parseInt(esbConfiguration.
+                getFirstProperty(
+                ServerConfiguration.COMMAND_LISTENER_PORT));
+        esbController.setPort(serverPort);
+        Thread t = new Thread(esbController);
+        t.start();
+
+    }
+
+
+    private static void printUsages() {
+        System.out.println(
+                "======================================================");
+        System.out.println(
+                "=                WSO2 ESB Help                       =");
+        System.out.println(
+                "======================================================");
+        System.out.println();
+        System.out.println(" Usage : ESB <action>");
+        System.out.println();
+        System.out.println("<action> \t\t : Current actions supported - " +
+                           COMMAND_RUN + ", " +
+                           COMMAND_START + ", " +
+                           COMMAND_STATUS + "," +
+                           COMMAND_STOP + "," +
+                           COMMAND_HELP);
+        System.out.println();
+    }
+
+
+    public void setAxis2RepoLocation(String axis2RepoLocation) {
+        this.axis2RepoLocation = axis2RepoLocation;
+    }
+
+    private String getAxis2RepoLocation() {
+        return this.axis2RepoLocation;
+    }
+
+    private void addShutdownHook() {
+        if (isShutdownHookAdded) {
+            return;
+        }
+        isShutdownHookAdded = true;
+        Runtime.getRuntime().addShutdownHook(new Thread() {
+            public void run() {
+                log.info("[ESB] Shutting down WSO2 ESB ...");
+                try {
+                    Main.this.shutdown();
+                    log.info("[ESB] Shutting down completed");
+                    log.info("[ESB] Halting JVM");
+                } catch (Exception e) {
+                    log.warn("[ESB] Error occurred while " +
+                             "shutting down WSO2 ESB : " + e);
+                }
+            }
+        });
+    }
+}

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusConfiguration.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusConfiguration.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusConfiguration.java	Mon Aug  6 08:29:40 2007
@@ -16,6 +16,7 @@
 
 package org.wso2.esb;
 
+import org.apache.axiom.om.OMElement;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.wso2.utils.ServerConfiguration;
@@ -31,7 +32,7 @@
 
     private static ServiceBusConfiguration configuration = null;
 
-    public static String defaultConfigurationXMLLocation = "conf/server.xml";
+    public static String defaultConfigurationXMLLocation = "webapp/WEB-INF/classes/conf/server.xml";
 
     private final static ServerConfiguration serverConfiguration = ServerConfiguration.getInstance();
 
@@ -40,10 +41,11 @@
     }
 
     public static ServiceBusConfiguration getServiceBusInstance() {
+
         if (configuration == null) {
             // intializing the defaultConfigurationXMLLocation
             configuration = new ServiceBusConfiguration();
-            String esbXml = System.getProperty("esb.xml");
+            String esbXml = System.getProperty(ServiceBusConstants.ESB_SERVER_XML);
             try {
                 if (esbXml == null || "".equals(esbXml)) {
                     esbXml = defaultConfigurationXMLLocation;
@@ -60,4 +62,8 @@
     public String getFirstProperty(String key) {
         return serverConfiguration.getFirstProperty(key);
     }
+
+    public OMElement getDocumentElement(){
+        return serverConfiguration.getDocumentElement();
+    }
 }

Copied: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusConstants.java (from r5159, trunk/esb/java/modules/core/src/main/java/org/wso2/esb/Constants.java)
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/Constants.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusConstants.java	Mon Aug  6 08:29:40 2007
@@ -18,9 +18,9 @@
 
 import java.net.URI;
 /*
- * Constants use by WSO2 ESB
+ * ServiceBusConstants use by WSO2 ESB
  */
-public final class Constants {
+public final class ServiceBusConstants {
 
     public static final String MESSAGE_MAP_KEY           = "Message_Map_Key";
     public static final String IN_MESSAGE_MAP_KEY        = "IN_Message_Map_Key";
@@ -32,11 +32,12 @@
     public static final String ESB_INSTANCE        = "WSO2 ESB";
     public static final String ESB_XML_NAMESPACE   = "http://www.wso2.org/projects/esb";
     public static final String ESB_WEB_XML_KEY     = "ESB_WEB_XML_KEY";
+    public static final String ESB_HOME     = "esb.home";
 
     public static final String WELCOME_PAGE        = "INDEX_HTML_FILE";
     public static final String GENERATED_PAGES     = "wso2esb.generated.pages";
 
-    // Constants for ESB registry
+    // ServiceBusConstants for ESB registry
     public static final int LOCAL_HOST_REGISTRY    = 100;
     public static final int REMOTE_HOST_REGISTRY   = 101;
     public static final int REGISTRY_MODE          = LOCAL_HOST_REGISTRY;
@@ -50,7 +51,7 @@
     public static final URI file =
             URI.create("http://wso2.org/projects/esb/registry/types/file");
 
-    // Constants for ESBSendMediator
+    // ServiceBusConstants for ESBSendMediator
     public static final String ESBSEND_ELEMENT          = "send";
     public static final String LOADBALANCE_ELEMENT      = "loadbalance";
     // failover only element
@@ -74,13 +75,23 @@
     public static final String WSO2ESB_HB_CONFIG_KEY ="wso2esb_hb_configuration_key";
     public static int MSG_BUFFER_SIZE = 200;
 
+
+    public static final String ESB_SERVER_XML = "esb.xml";
+    public static final String ESB_SERVER_WEB_XML = "server-web.xml";
+    public static final String ESB_UI_EXTENSIONS_CONFIG_XML = "ui-extensions-config.xml";
+    public static final String ESB_HIBERNATE_CFG_XML = "wso2esb.hibernate.cfg.xml";
+    public static final String ESB_DERBY_SYSTEM_HOME = "derby.system.home";
+    public static final String ESB_CONF_DIRECTORY = "webapp/WEB-INF/classes/conf/";
+
+
+
     public static class Logging {
         public static String ESB_CONSOLE_APPENDER  = "ESB_CONSOLE_APPENDER";
         public static String ESB_LOG_FILE_APPENDER = "ESB_LOG_FILE_APPENDER";
-        public static String ESB_MEMORY_APPENDER   =  "ESB_MEMORY_APPENDER";
+        public static String ESB_MEMORY_APPENDER   = "ESB_MEMORY_APPENDER";
     }
 
-    // Constants for DataBase Access
+    // ServiceBusConstants for DataBase Access
     public static class DBAccess{
         public static final String DERBY_NETWOEK_SERVER_DRIVER
                 = "org.apache.derby.jdbc.ClientDriver"; 

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusController.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusController.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusController.java	Mon Aug  6 08:29:40 2007
@@ -33,17 +33,9 @@
 // use the local loopback address so that only localhost can send the messages
     public static final String LOCAL_HOST_IP = "127.0.0.1";
     public static final String SHUTDOWN_COMMAND = "shutdownserver";
-
-    // ServiceBus instance
-    private ServiceBus esb;
     private int port;
-
     private Log log = LogFactory.getLog(ServiceBusController.class);
 
-    public ServiceBusController(ServiceBus esb) {
-        this.esb = esb;
-    }
-
     public void run() {
         waitForShutDownCommand();
     }

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusManager.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusManager.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusManager.java	Mon Aug  6 08:29:40 2007
@@ -18,23 +18,26 @@
 
 
 import org.apache.axis2.AxisFault;
-import org.apache.axis2.description.Parameter;
+import org.apache.axis2.Constants;
 import org.apache.axis2.context.ConfigurationContext;
 import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.description.Parameter;
 import org.apache.axis2.engine.ListenerManager;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.derby.drda.NetworkServerControl;
 import org.apache.synapse.config.SynapseConfiguration;
+import org.apache.synapse.core.SynapseEnvironment;
 import org.apache.synapse.registry.Registry;
 import org.wso2.adminui.UIProcessingException;
 import org.wso2.adminui.UIProcessor;
-import org.wso2.esb.util.XmlConfigurationFactory;
-import org.wso2.esb.util.JettyWebConfiguration;
 import org.wso2.esb.registry.ESBRegistry;
+import org.wso2.esb.statistics.StatisticsReporterThread;
+import org.wso2.esb.util.XmlConfigurationFactory;
 import org.wso2.utils.ServerException;
 
 import java.io.File;
+import java.io.InputStream;
 import java.net.UnknownHostException;
 import java.util.Hashtable;
 import java.util.Properties;
@@ -46,17 +49,47 @@
 
     private static Log log = LogFactory.getLog(ServiceBusManager.class);
 
-    public static int httpPort  = 8080;
+    public static int httpPort = 8080;
     public static int httpsPort = 9443;
-
+    public static String host="localhost";
     private ServiceBusConfiguration esbConfiguration;
     public ConfigurationContext configurationContext;
     private NetworkServerControl networkServerControl;
+    private ListenerManager listenerManager;
+    /**
+     * The thread which reads statistics from memory and write them to the DB
+     */
+    private StatisticsReporterThread statisticsReporterThread;
+    private static ServiceBusManager instance;
 
-    public ServiceBusManager() {
+    static {
+        initSystemProperties();
+    }
+
+    public static ServiceBusManager getInstance() {
+        if (instance == null) {
+            instance = new ServiceBusManager();
+        }
+        return instance;
+    }
+
+    private ServiceBusManager() {
         this(ServiceBusConfiguration.getServiceBusInstance());
+        if (XmlConfigurationFactory.getXmlConfiguration(ServiceBusConstants.ESB_WEB_XML_KEY) == null) {
+            try {
+                String server_web_xml = System.getProperty(ServiceBusConstants.ESB_SERVER_WEB_XML);
+                if (server_web_xml == null || "".equals(server_web_xml)) {
+                    server_web_xml = "conf" + File.separator + ServiceBusConstants.ESB_SERVER_WEB_XML;
+                }
+                XmlConfigurationFactory.init(ServiceBusConstants.ESB_WEB_XML_KEY,
+                                             server_web_xml, ServiceBusConstants.ESB_XML_NAMESPACE);
+            } catch (ServerException e) {
+                log.error("Error loading server-web.xml", e);
+            }
+        }
     }
 
+
     public ServiceBusManager(ServiceBusConfiguration esbConfiguration) {
         this.esbConfiguration = esbConfiguration;
     }
@@ -73,6 +106,7 @@
      * This implementation does not validaye the user against a database. In future it
      * is envisioned that the ESB will reuse the common authentication components shared
      * between WSAS and ESB
+     *
      * @param username
      * @param password
      * @return true if the user is authenticated successfully
@@ -83,12 +117,13 @@
         String esb_password = esbConfiguration.getFirstProperty("DefaultAdmin.Password");
 
         return username.equals(esb_username) &&
-                password.equals(esb_password);
+               password.equals(esb_password);
     }
 
     /**
      * Starts the Derby database instance in network mode for multi user access
      * Waits till the server can be pinged, upto a maximum of 10 seconds
+     *
      * @throws ServiceBusException
      */
     public void startDataBaseServer() throws ServiceBusException {
@@ -98,7 +133,7 @@
             networkServerControl = new NetworkServerControl();
             networkServerControl.start(null);
 
-            for (int i=0; i<10; i++) {
+            for (int i = 0; i < 10; i++) {
                 Thread.sleep(1000);
                 try {
                     networkServerControl.ping();
@@ -108,7 +143,8 @@
                     log.info("Database server started on " + host + " over port " + port);
                     return;
 
-                } catch (Exception ignore) {}
+                } catch (Exception ignore) {
+                }
             }
             handleFatal("Database server failed to start");
 
@@ -121,6 +157,7 @@
 
     /**
      * Requests the Derby DB to stop itself
+     *
      * @throws ServiceBusException
      */
     public void stopDataBaseServer() throws ServiceBusException {
@@ -138,33 +175,18 @@
 
         log.debug("Starting the ServiceBusManager");
 
-        initSystemProperties();
+//        initSystemProperties();
         startDataBaseServer();
-
         //axis2.xml ; axis2.repo and synapse.xml will inject as System properties
         configurationContext = ConfigurationContextFactory.
-            createConfigurationContextFromFileSystem(null, null);
+                createConfigurationContextFromFileSystem(null, null);
 
         // configuration has now been loaded from the configuration file. now set ESB default values
         // for unspecified entities.
         setESBDefaults(configurationContext);
-
+        startStatisticsReporter();
         initListenerManager();
 
-        // intializing configs related to JettyServer
-        try {
-            String server_web_xml = System.getProperty("server-web.xml") ;
-            if(server_web_xml == null || "".equals(server_web_xml)){
-                server_web_xml = "conf/server-web.xml";
-            }
-            XmlConfigurationFactory.init(Constants.ESB_WEB_XML_KEY,
-                server_web_xml, Constants.ESB_XML_NAMESPACE);
-        } catch (ServerException e) {
-            handleException("Error loading server-web.xml", e);
-        }
-        JettyWebConfiguration.getInstance().setXmlFileKey(Constants.ESB_WEB_XML_KEY);
-        JettyWebConfiguration.getInstance().init();
-
         // Create the index.html page and save it in the ConfigContext
         generateWelcomePage();
 
@@ -202,42 +224,119 @@
 
         Hashtable fileContents = new Hashtable();
         try {
-            UIProcessor.createPages(
-                JettyWebConfiguration.getInstance().adminWebResourceBase, null, fileContents);
+            UIProcessor.createPages(System.getProperty(ServiceBusConstants.ESB_HOME) + File.separator +
+                                    XmlConfigurationFactory.
+                                            getXmlConfiguration(
+                                                    ServiceBusConstants.ESB_WEB_XML_KEY).
+                                            getUniqueValue(
+                                                    "//ns:Mapping[@name=\"admin\"]/ns:ResourceBase")
+                                    + File.separator,
+                                    System.getProperty(ServiceBusConstants.
+                                            ESB_UI_EXTENSIONS_CONFIG_XML),
+                                    fileContents);
         } catch (UIProcessingException e) {
             handleException("Error generating welcome page", e);
         }
-        configurationContext.setProperty(Constants.GENERATED_PAGES, fileContents);
+        configurationContext.setProperty(ServiceBusConstants.GENERATED_PAGES, fileContents);
     }
 
     private void initListenerManager() {
-        ListenerManager listenerManager = new ListenerManager();
+        listenerManager = new ListenerManager();
         listenerManager.init(configurationContext);
         listenerManager.start();
         ListenerManager.defaultConfigurationContext = configurationContext;
     }
 
-    private void initSystemProperties() {
-        String axis2Xml = System.getProperty("axis2.xml");
-        String esbHome  = System.getProperty("esb.home"); // this has to be provided
+    public void stop() throws ServiceBusException, AxisFault {
+        stopStatisticsReporter();
+        stopDataBaseServer();
+        stopListenerManager();
+
+    }
+
+    public void stopListenerManager() throws AxisFault {
+        try {
+            if (listenerManager != null) {
+                listenerManager.destroy();
+            }
+            //we need to call this method to clean the team fils we created.
+            if (configurationContext != null) {
+                configurationContext.terminate();
+            }
+        } catch (Exception ignored) {
+        }
+    }
+
+    public static void initSystemProperties() {
 
+        String axis2Xml = System.getProperty(Constants.AXIS2_CONF);
+        String esbHome = System.getProperty(ServiceBusConstants.ESB_HOME); // this has to be provided
+        if (esbHome == null) {
+            System.setProperty(ServiceBusConstants.ESB_HOME, ".");
+            esbHome = System.getProperty(ServiceBusConstants.ESB_HOME);
+        }
+        System.setProperty(org.apache.synapse.Constants.SYNAPSE_HOME, esbHome);
+        String axis2Repo = System.getProperty(Constants.AXIS2_REPO);
+        if (axis2Repo == null) {
+            System.setProperty(Constants.AXIS2_REPO, esbHome + File.separator + "repository");
+        }
         if (axis2Xml == null) {
-            System.setProperty("axis2.xml",
-                esbHome + File.separator + "conf" + File.separator + "axis2.xml");
+            System.setProperty(Constants.AXIS2_CONF,
+                               esbHome + File.separator + ServiceBusConstants.ESB_CONF_DIRECTORY
+                               + File.separator + Constants.AXIS2_CONF);
         }
 
-        String esbXml = System.getProperty("esb.xml");
+        String esbXml = System.getProperty(ServiceBusConstants.ESB_SERVER_XML);
         if (esbXml == null) {
-            System.setProperty("esb.xml", ServiceBusConfiguration.defaultConfigurationXMLLocation);
+            System.setProperty(ServiceBusConstants.ESB_SERVER_XML,
+                               esbHome + File.separator + ServiceBusConstants.ESB_CONF_DIRECTORY
+                               + File.separator + "server.xml");
         }
 
-        String synapseXml = System.getProperty("synapse.xml");
+        String synapseXml = System.getProperty(org.apache.synapse.Constants.SYNAPSE_XML);
         if (synapseXml == null) {
-            System.setProperty("synapse.xml",
-                esbHome + File.separator + "conf" + File.separator + "synapse.xml");
+            System.setProperty(org.apache.synapse.Constants.SYNAPSE_XML,
+                               esbHome + File.separator + ServiceBusConstants.ESB_CONF_DIRECTORY
+                               + File.separator + org.apache.synapse.Constants.SYNAPSE_XML);
+        }
+
+        String serverWeb = System.getProperty(ServiceBusConstants.ESB_SERVER_WEB_XML);
+        if (serverWeb == null) {
+            System.setProperty(ServiceBusConstants.ESB_SERVER_WEB_XML,
+                               esbHome + File.separator
+                               + ServiceBusConstants.ESB_CONF_DIRECTORY +
+                               ServiceBusConstants.ESB_SERVER_WEB_XML);
+        }
+
+        String ui_extension_xml = System.getProperty(ServiceBusConstants.
+                ESB_UI_EXTENSIONS_CONFIG_XML);
+        if (ui_extension_xml == null) {
+            System.setProperty(ServiceBusConstants.ESB_UI_EXTENSIONS_CONFIG_XML,
+                               "conf" +
+                               File.separator + ServiceBusConstants.ESB_UI_EXTENSIONS_CONFIG_XML);
         }
 
-        System.setProperty("derby.system.home",esbHome + File.separator + "conf");
+        String hibernameConf = System.getProperty(ServiceBusConstants.ESB_HIBERNATE_CFG_XML);
+        if (hibernameConf == null) {
+            InputStream inStream =
+                    Thread.currentThread().getContextClassLoader().
+                            getResourceAsStream(ServiceBusConstants.ESB_HIBERNATE_CFG_XML);
+            if (inStream == null) {
+                System.setProperty(ServiceBusConstants.ESB_HIBERNATE_CFG_XML,
+                                   "conf" + File.separator +
+                                   ServiceBusConstants.ESB_HIBERNATE_CFG_XML);
+            } else {
+                System.setProperty(ServiceBusConstants.ESB_HIBERNATE_CFG_XML,
+                                   ServiceBusConstants.ESB_HIBERNATE_CFG_XML);
+            }
+        }         
+        String derbyHome = System.getProperty(ServiceBusConstants.ESB_DERBY_SYSTEM_HOME);
+        if (derbyHome == null) {
+            System.setProperty(ServiceBusConstants.ESB_DERBY_SYSTEM_HOME,
+                               esbHome +
+                               File.separator
+                               + ServiceBusConstants.ESB_CONF_DIRECTORY);
+        }
     }
 
     private static void handleFatal(String msg) throws ServiceBusException {
@@ -250,4 +349,28 @@
         throw new ServiceBusException(msg, e);
     }
 
+    public void startStatisticsReporter() throws ServiceBusException {
+
+        Parameter synapseEnvParameter = configurationContext.
+                getAxisConfiguration().getParameter(org.apache.synapse.Constants.SYNAPSE_ENV);
+        if (synapseEnvParameter != null) {
+            try {
+                String statisticsPersistenceInterval = esbConfiguration.
+                        getFirstProperty("StatisticsPersistenceInterval");
+                SynapseEnvironment synEnv = (SynapseEnvironment) synapseEnvParameter.getValue();
+                statisticsReporterThread = new StatisticsReporterThread(synEnv);
+                statisticsReporterThread.setDelay(Long.parseLong(statisticsPersistenceInterval));
+                statisticsReporterThread.start();
+            } catch (Exception e) {
+                throw new ServiceBusException(e);
+            }
+        }
+    }
+
+    public void stopStatisticsReporter() throws ServiceBusException {
+        if (statisticsReporterThread != null) {
+            statisticsReporterThread.shutdown();
+        }
+    }
+
 }

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/persistence/PersistenceManager.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/persistence/PersistenceManager.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/persistence/PersistenceManager.java	Mon Aug  6 08:29:40 2007
@@ -17,12 +17,13 @@
 
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
-import org.wso2.esb.persistence.dao.StatisticsDAO;
 import org.wso2.esb.persistence.dao.RegistryEntryDAO;
-import org.wso2.esb.persistence.dataobject.StatisticsDO;
+import org.wso2.esb.persistence.dao.StatisticsDAO;
 import org.wso2.esb.persistence.dataobject.RegistryEntryDO;
+import org.wso2.esb.persistence.dataobject.StatisticsDO;
 import org.wso2.esb.util.HibernateConfig;
 import org.wso2.esb.util.HibernateConfigFactory;
+import org.wso2.esb.ServiceBusConstants;
 
 import java.util.List;
 
@@ -38,7 +39,7 @@
 
     public PersistenceManager() {
         this.hbConfig = HibernateConfigFactory.getDefaultConfig(
-            org.wso2.esb.Constants.WSO2ESB_HB_CONFIG_KEY, "wso2esb.hibernate.cfg.xml");
+            org.wso2.esb.ServiceBusConstants.WSO2ESB_HB_CONFIG_KEY, System.getProperty(ServiceBusConstants.ESB_HIBERNATE_CFG_XML));
     }
 
     public PersistenceManager(HibernateConfig hbConfig) {

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/persistence/dao/RegistryEntryDAO.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/persistence/dao/RegistryEntryDAO.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/persistence/dao/RegistryEntryDAO.java	Mon Aug  6 08:29:40 2007
@@ -19,13 +19,13 @@
 
 package org.wso2.esb.persistence.dao;
 
-import org.wso2.esb.util.HibernateConfig;
-import org.wso2.esb.persistence.dataobject.RegistryEntryDO;
-import org.hibernate.Session;
-import org.hibernate.Transaction;
 import org.hibernate.Criteria;
 import org.hibernate.HibernateException;
+import org.hibernate.Session;
+import org.hibernate.Transaction;
 import org.hibernate.criterion.Expression;
+import org.wso2.esb.persistence.dataobject.RegistryEntryDO;
+import org.wso2.esb.util.HibernateConfig;
 
 public class RegistryEntryDAO extends BaseDAO {
 

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/registry/ESBRegistry.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/registry/ESBRegistry.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/registry/ESBRegistry.java	Mon Aug  6 08:29:40 2007
@@ -19,27 +19,32 @@
 
 package org.wso2.esb.registry;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.OMElement;
+import org.apache.axiom.om.OMNode;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
-import org.apache.synapse.registry.RegistryEntry;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.SynapseException;
 import org.apache.synapse.registry.AbstractRegistry;
 import org.apache.synapse.registry.Registry;
-import org.apache.synapse.SynapseException;
-import org.wso2.esb.Constants;
-import org.wso2.esb.persistence.dataobject.RegistryEntryDO;
+import org.apache.synapse.registry.RegistryEntry;
+import org.wso2.esb.ServiceBusConstants;
 import org.wso2.esb.persistence.PersistenceManager;
+import org.wso2.esb.persistence.dataobject.RegistryEntryDO;
 
-import javax.xml.stream.XMLStreamReader;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLStreamException;
 import javax.net.ssl.HostnameVerifier;
-import javax.net.ssl.SSLSession;
 import javax.net.ssl.HttpsURLConnection;
-import java.net.*;
-import java.io.*;
+import javax.net.ssl.SSLSession;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLConnection;
 import java.util.ArrayList;
 
 /**
@@ -75,13 +80,20 @@
      * Specifies whether the registry is in the local host or a remote registry.
      * Local host means the same computer as ESB is running.
      */
-    private int registryType = Constants.LOCAL_HOST_REGISTRY;
+    private int registryType = ServiceBusConstants.LOCAL_HOST_REGISTRY;
 
     /**
      * Contains the protocol for the registry. Allowd values are FILE, HTTP and HTTPS.
      */
     private int registryProtocol = FILE;
 
+    public ESBRegistry(){
+        String esbHome = System.getProperty(ServiceBusConstants.ESB_HOME) ;
+        if(esbHome != null){
+           this.localRegistry = esbHome;
+        }
+    }
+
     public OMNode lookup(String key) {
 
         log.info("==> Repository fetch of resource with key : " + key);
@@ -89,6 +101,21 @@
         URLConnection urlc = null;
         try {
             URL url = new URL(getRoot() + key);
+            if ("file".equals(url.getProtocol())) {
+                try {
+                    url.openStream();
+                } catch (IOException ignored) {
+                    if (!localRegistry.endsWith(URL_SEPARATOR)) {
+                        localRegistry = localRegistry + URL_SEPARATOR;
+                    }
+                    url = new URL(url.getProtocol() + ":" + localRegistry + key);
+                    try {
+                        url.openStream();
+                    } catch (IOException e) {
+                        return null;
+                    }
+                }
+            }
             urlc = url.openConnection();
             urlc.connect();
         } catch (IOException e) {
@@ -118,11 +145,26 @@
 
         try {
             URL url = new URL(getRoot() + key);
+            if ("file".equals(url.getProtocol())) {
+                try {
+                    url.openStream();
+                } catch (IOException ignored) {
+                    if (!localRegistry.endsWith(URL_SEPARATOR)) {
+                        localRegistry = localRegistry + URL_SEPARATOR;
+                    }
+                    url = new URL(url.getProtocol() + ":" + localRegistry + key);
+                    try {
+                        url.openStream();
+                    } catch (IOException e) {
+                        return null;
+                    }
+                }
+            }
             URLConnection urlc = url.openConnection();
 
             entry.setKey(key);
             entry.setName(url.getFile());
-            entry.setType(Constants.file);
+            entry.setType(ServiceBusConstants.file);
 
             entry.setDescription("Resource at : " + url.toString());
             entry.setLastModified(urlc.getLastModified());
@@ -180,7 +222,7 @@
      */
     public void updateResource(String key, OMElement value) throws Exception {
 
-        if (registryType == Constants.LOCAL_HOST_REGISTRY) {
+        if (registryType == ServiceBusConstants.LOCAL_HOST_REGISTRY) {
             File file = new File(localRegistry + getSystemDependentPath(key));
             if (file.exists()) {
                 BufferedWriter writer = null;
@@ -214,7 +256,7 @@
     public void addResource(String parentName,
                             String resourceName, boolean isLeaf) throws Exception {
 
-        if (registryType == Constants.LOCAL_HOST_REGISTRY) {
+        if (registryType == ServiceBusConstants.LOCAL_HOST_REGISTRY) {
 
             if (isLeaf) {
                 createFile(getSystemDependentPath(parentName), resourceName);
@@ -233,7 +275,7 @@
      */
     public void removeResource(String key) {
 
-        if (registryType == Constants.LOCAL_HOST_REGISTRY) {
+        if (registryType == ServiceBusConstants.LOCAL_HOST_REGISTRY) {
             File resource = new File(localRegistry + getSystemDependentPath(key));
             if (resource.exists()) {
 
@@ -339,7 +381,7 @@
         add entry 'parentName/newFolderName' as key to the database.
         */
 
-        if (registryType == Constants.LOCAL_HOST_REGISTRY) {
+        if (registryType == ServiceBusConstants.LOCAL_HOST_REGISTRY) {
             File parent = new File(localRegistry + parentName);
             if (parent.exists()) {
 
@@ -383,7 +425,7 @@
         using a remote file system or not.
         */
 
-        if (registryType == Constants.LOCAL_HOST_REGISTRY) {
+        if (registryType == ServiceBusConstants.LOCAL_HOST_REGISTRY) {
             File parent = new File(localRegistry + parentName);
             if (parent.exists()) {
 
@@ -436,80 +478,95 @@
 
         if (localRegistry == null) {
             // registry root should always end with "/"
-            if (Constants.LOCAL_REGISTRY_ROOT.endsWith(URL_SEPARATOR)) {
-                localRegistry = Constants.LOCAL_REGISTRY_ROOT;
+            if (ServiceBusConstants.LOCAL_REGISTRY_ROOT.endsWith(URL_SEPARATOR)) {
+                localRegistry = ServiceBusConstants.LOCAL_REGISTRY_ROOT;
             } else {
-                localRegistry = Constants.LOCAL_REGISTRY_ROOT + URL_SEPARATOR;
+                localRegistry = ServiceBusConstants.LOCAL_REGISTRY_ROOT + URL_SEPARATOR;
             }
         }
+        if (name != null && value != null) {
+            if (name.equals("root")) {
 
-        if(name.equals("root")) {
-
-            // root should always end with '/'
-            // therefore, property keys do not have to begin with '/', which could be misleading
-            try {
-                URL url = new URL(value);
+                // root should always end with '/'
+                // therefore, property keys do not have to begin with '/', which could be misleading
+                try {
+                    URL url = new URL(value);
+                    if ("file".equals(url.getProtocol())) {
+                        try {
+                            url.openStream();
+                        } catch (IOException ignored) {
+                            if (!localRegistry.endsWith(URL_SEPARATOR)) {
+                                localRegistry = localRegistry + URL_SEPARATOR;
+                            }
+                            url = new URL(url.getProtocol() + ":" + localRegistry + url.getPath());
+                            try {
+                                url.openStream();
+                            } catch (IOException e) {
+                                log.error(e);
+                            }
+                        }
+                    }
+                    if (url.getProtocol().equals("file")) {
+                        registryProtocol = FILE;
 
-                if (url.getProtocol().equals("file")) {
-                    registryProtocol =  FILE;
+                        registryType = ServiceBusConstants.LOCAL_HOST_REGISTRY;
 
-                    registryType = Constants.LOCAL_HOST_REGISTRY;
+                        if (url.getPath().endsWith(URL_SEPARATOR)) {
+                            localRegistry = getSystemDependentPath(url.getPath());
+                        } else {
+                            localRegistry = getSystemDependentPath(url.getPath()) + File.separator;
+                        }
 
-                    if (url.getPath().endsWith(URL_SEPARATOR)) {
-                        localRegistry = getSystemDependentPath(url.getPath());
-                    } else {
-                        localRegistry = getSystemDependentPath(url.getPath()) + File.separator;
+                    } else if (url.getProtocol().equals("http")) {
+                        registryProtocol = HTTP;
+                    } else if (url.getProtocol().equals("https")) {
+                        registryProtocol = HTTPS;
                     }
 
-                } else if (url.getProtocol().equals("http")) {
-                    registryProtocol = HTTP;
-                } else if (url.getProtocol().equals("https")) {
-                    registryProtocol = HTTPS;
-                }
-
 
-                if(!value.endsWith(URL_SEPARATOR)) {
-                    value = value + URL_SEPARATOR;
-                }
+                    if (!value.endsWith(URL_SEPARATOR)) {
+                        value = value + URL_SEPARATOR;
+                    }
 
 
-            } catch (MalformedURLException e) {
-                // don't set the root if this is not a valid URL
-                throw new RuntimeException("Registry root should be a valid URL.");
+                } catch (MalformedURLException e) {
+                    // don't set the root if this is not a valid URL
+                    throw new RuntimeException("Registry root should be a valid URL.");
+                }
             }
-        }
 
-        if (name.equals("localRegistry")) {
-            registryType = Constants.LOCAL_HOST_REGISTRY;
+            if (name.equals("localRegistry")) {
+                registryType = ServiceBusConstants.LOCAL_HOST_REGISTRY;
 
-            // registry root always ends with "/"
-            if (!value.endsWith(File.separator)) {
-                value = value + File.separator;
+                // registry root always ends with "/"
+                if (!value.endsWith(File.separator)) {
+                    value = value + File.separator;
+                }
+                localRegistry = value;
             }
-            localRegistry = value;
-        }
 
-        if (name.equals("matadataService")) {
-            registryType = Constants.REMOTE_HOST_REGISTRY;
-            metaDataService = value;
-        }
+            if (name.equals("matadataService")) {
+                registryType = ServiceBusConstants.REMOTE_HOST_REGISTRY;
+                metaDataService = value;
+            }
 
-        // check if host name verification is disabled
-        if (name.equalsIgnoreCase("disableHostNameVerification")) {
-            if (value.equalsIgnoreCase("true")) {
-                HostnameVerifier hv = new HostnameVerifier()
-                {
-                    public boolean verify(String urlHostName, SSLSession session)
-                    {
-                        return true;
-                    }
-                };
+            // check if host name verification is disabled
+            if (name.equalsIgnoreCase("disableHostNameVerification")) {
+                if (value.equalsIgnoreCase("true")) {
+                    HostnameVerifier hv = new HostnameVerifier() {
+                        public boolean verify(String urlHostName, SSLSession session) {
+                            return true;
+                        }
+                    };
 
-                HttpsURLConnection.setDefaultHostnameVerifier(hv);
+                    HttpsURLConnection.setDefaultHostnameVerifier(hv);
+                }
             }
-        }
 
-        super.addConfigProperty(name, value);
+            super.addConfigProperty(name, value);
+        } else {
+            log.debug("Name and Value must need");
+        }
     }
 
     /**
@@ -553,7 +610,7 @@
             entry = urlEntry;
         }
 
-        if (registryType == Constants.LOCAL_HOST_REGISTRY) {
+        if (registryType == ServiceBusConstants.LOCAL_HOST_REGISTRY) {
 
             // registry is in the local file system. access it directly.
 
@@ -585,7 +642,7 @@
                     File entryFile = new File
                             (registryRoot + getSystemDependentPath(registryEntry.getKey()));
                     if (entryFile.isDirectory()) {
-                        registryEntry.setType(Constants.folder);
+                        registryEntry.setType(ServiceBusConstants.folder);
                     }
 
                     entries[i] = registryEntry;
@@ -598,7 +655,7 @@
             }
 
 
-        } else if (registryType == Constants.REMOTE_HOST_REGISTRY) {
+        } else if (registryType == ServiceBusConstants.REMOTE_HOST_REGISTRY) {
             // implement for remote registries.
         }
 

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/AbstractESBAdmin.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/AbstractESBAdmin.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/AbstractESBAdmin.java	Mon Aug  6 08:29:40 2007
@@ -21,8 +21,8 @@
 import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.description.Parameter;
 import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.synapse.config.SynapseConfiguration;
 import org.apache.commons.logging.Log;
+import org.apache.synapse.config.SynapseConfiguration;
 
 /*
  *  Abstract Class that handles Admin stuff

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/ConfigAdmin.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/ConfigAdmin.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/ConfigAdmin.java	Mon Aug  6 08:29:40 2007
@@ -23,15 +23,15 @@
 import org.apache.axis2.AxisFault;
 import org.apache.axis2.description.Parameter;
 import org.apache.axis2.util.XMLPrettyPrinter;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.Constants;
 import org.apache.synapse.SynapseException;
-import org.apache.synapse.core.axis2.ProxyService;
-import org.apache.synapse.core.axis2.MessageContextCreatorForAxis2;
 import org.apache.synapse.config.SynapseConfiguration;
 import org.apache.synapse.config.xml.XMLConfigurationBuilder;
 import org.apache.synapse.config.xml.XMLConfigurationSerializer;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.core.axis2.MessageContextCreatorForAxis2;
+import org.apache.synapse.core.axis2.ProxyService;
 
 import javax.xml.stream.XMLStreamException;
 import java.io.*;

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/EndpointAdmin.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/EndpointAdmin.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/EndpointAdmin.java	Mon Aug  6 08:29:40 2007
@@ -18,24 +18,25 @@
 
 import org.apache.axiom.om.OMElement;
 import org.apache.axis2.AxisFault;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.SynapseException;
+import org.apache.synapse.config.SynapseConfiguration;
+import org.apache.synapse.config.xml.SynapseXMLConfigurationFactory;
+import org.apache.synapse.config.xml.endpoints.EndpointAbstractFactory;
+import org.apache.synapse.config.xml.endpoints.EndpointFactory;
 import org.apache.synapse.endpoints.*;
 import org.apache.synapse.endpoints.dispatch.Dispatcher;
 import org.apache.synapse.endpoints.dispatch.HttpSessionDispatcher;
 import org.apache.synapse.endpoints.dispatch.SimpleClientSessionDispatcher;
 import org.apache.synapse.endpoints.dispatch.SoapSessionDispatcher;
 import org.apache.synapse.endpoints.utils.EndpointDefinition;
-import org.apache.synapse.config.SynapseConfiguration;
-import org.apache.synapse.config.xml.XMLConfigurationBuilder;
-import org.apache.synapse.config.xml.SynapseXMLConfigurationFactory;
-import org.apache.synapse.config.xml.endpoints.EndpointAbstractFactory;
-import org.apache.synapse.config.xml.endpoints.EndpointFactory;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.wso2.esb.services.tos.*;
 
 import javax.xml.namespace.QName;
-import java.util.*;
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
 /*
  * 
  */

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/EntriesAdmin.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/EntriesAdmin.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/EntriesAdmin.java	Mon Aug  6 08:29:40 2007
@@ -18,15 +18,15 @@
 
 import org.apache.axiom.om.*;
 import org.apache.axis2.AxisFault;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.SynapseException;
-import org.apache.synapse.endpoints.Endpoint;
-import org.apache.synapse.mediators.base.SequenceMediator;
-import org.apache.synapse.config.SynapseConfiguration;
 import org.apache.synapse.config.Entry;
+import org.apache.synapse.config.SynapseConfiguration;
 import org.apache.synapse.config.xml.Constants;
 import org.apache.synapse.config.xml.EntrySerializer;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.synapse.endpoints.Endpoint;
+import org.apache.synapse.mediators.base.SequenceMediator;
 import org.wso2.esb.services.tos.EntryData;
 
 import javax.xml.namespace.QName;

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/LoginAdmin.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/LoginAdmin.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/LoginAdmin.java	Mon Aug  6 08:29:40 2007
@@ -42,7 +42,7 @@
         }
         // temprary lets allow everyone to acess FixMe Via server.xml or via Database
 
-        ServiceBusManager manager = new ServiceBusManager();
+        ServiceBusManager manager = ServiceBusManager.getInstance();
         boolean logged = manager.authenticate(username, password);
 
         if (logged) {

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/ProxyServiceAdmin.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/ProxyServiceAdmin.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/ProxyServiceAdmin.java	Mon Aug  6 08:29:40 2007
@@ -18,13 +18,13 @@
 
 import org.apache.axiom.om.OMElement;
 import org.apache.axis2.AxisFault;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.SynapseException;
 import org.apache.synapse.config.SynapseConfiguration;
 import org.apache.synapse.config.xml.ProxyServiceFactory;
 import org.apache.synapse.config.xml.ProxyServiceSerializer;
 import org.apache.synapse.core.axis2.ProxyService;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.wso2.esb.services.tos.ProxyData;
 
 import javax.xml.namespace.QName;

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/RegistryAdmin.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/RegistryAdmin.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/RegistryAdmin.java	Mon Aug  6 08:29:40 2007
@@ -16,6 +16,7 @@
 
 package org.wso2.esb.services;
 
+import org.apache.axiom.om.*;
 import org.apache.axis2.AxisFault;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
@@ -24,14 +25,12 @@
 import org.apache.synapse.registry.Registry;
 import org.apache.synapse.registry.RegistryEntry;
 import org.apache.synapse.registry.url.SimpleURLRegistry;
-import org.apache.axiom.om.*;
+import org.wso2.esb.ServiceBusConstants;
 import org.wso2.esb.registry.ESBRegistry;
 import org.wso2.esb.registry.ESBRegistryEntry;
-import org.wso2.esb.Constants;
 
 import javax.xml.namespace.QName;
 import java.util.ArrayList;
-import java.io.File;
 
 public class RegistryAdmin extends AbstractESBAdmin {
 
@@ -116,7 +115,7 @@
                     entryElement.addChild(keyElement);
 
                     OMElement typeElement = fac.createOMElement("type", null);
-                    if (entries[i].getType() != null && entries[i].getType() == Constants.folder) {
+                    if (entries[i].getType() != null && entries[i].getType() == ServiceBusConstants.folder) {
                         typeElement.setText("folder");
                     } else {
                         typeElement.setText("file");

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/SequenceAdmin.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/SequenceAdmin.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/SequenceAdmin.java	Mon Aug  6 08:29:40 2007
@@ -18,15 +18,14 @@
 
 import org.apache.axiom.om.OMElement;
 import org.apache.axis2.AxisFault;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.synapse.SynapseException;
 import org.apache.synapse.config.SynapseConfiguration;
 import org.apache.synapse.config.xml.MediatorFactoryFinder;
 import org.apache.synapse.config.xml.MediatorSerializerFinder;
-import org.apache.synapse.config.xml.XMLConfigurationBuilder;
 import org.apache.synapse.config.xml.SynapseXMLConfigurationFactory;
 import org.apache.synapse.mediators.base.SequenceMediator;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.wso2.esb.services.tos.SequenceData;
 
 import javax.xml.namespace.QName;

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/ServerAdmin.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/ServerAdmin.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/ServerAdmin.java	Mon Aug  6 08:29:40 2007
@@ -17,19 +17,19 @@
 package org.wso2.esb.services;
 
 import org.apache.axis2.AxisFault;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
 import org.apache.log4j.Appender;
 import org.apache.log4j.Layout;
 import org.apache.log4j.Logger;
 import org.apache.log4j.spi.LoggingEvent;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
 import org.wso2.esb.ServiceBusException;
-import org.wso2.esb.services.tos.ServerStatus;
 import org.wso2.esb.services.tos.ServerData;
+import org.wso2.esb.services.tos.ServerStatus;
 import org.wso2.utils.MemoryAppender;
 
-import java.util.List;
 import java.util.ArrayList;
+import java.util.List;
 
 /*
  * Returns ServerStatus for the ESB home page
@@ -47,7 +47,7 @@
 
     public ServerData getServerData() throws AxisFault {
         return new ServerData(
-                org.wso2.esb.Constants.ESB_INSTANCE,
+                org.wso2.esb.ServiceBusConstants.ESB_INSTANCE,
                 getAxisConfig().getRepository().getPath());
     }
 

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/ServiceAdmin.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/ServiceAdmin.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/ServiceAdmin.java	Mon Aug  6 08:29:40 2007
@@ -19,6 +19,7 @@
 import org.apache.log4j.Logger;
 import org.apache.synapse.Constants;
 import org.wso2.esb.ServiceBusException;
+import org.wso2.esb.ServiceBusConstants;
 import org.wso2.esb.persistence.PersistenceManager;
 import org.wso2.esb.persistence.dataobject.StatisticsDO;
 import org.wso2.esb.services.tos.GraphData;
@@ -40,7 +41,7 @@
 
     private static PersistenceManager pm =
             new PersistenceManager(HibernateConfigFactory.getDefaultConfig(
-                    org.wso2.esb.Constants.WSO2ESB_HB_CONFIG_KEY, "wso2esb.hibernate.cfg.xml"));
+                    org.wso2.esb.ServiceBusConstants.WSO2ESB_HB_CONFIG_KEY, System.getProperty(ServiceBusConstants.ESB_HIBERNATE_CFG_XML)));
 
 
     private StatisticsData getData(int category, String serverId) {

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/tos/ServerStatus.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/tos/ServerStatus.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/tos/ServerStatus.java	Mon Aug  6 08:29:40 2007
@@ -22,8 +22,8 @@
 import org.apache.axis2.description.AxisServiceGroup;
 import org.apache.axis2.description.Parameter;
 import org.apache.axis2.engine.AxisConfiguration;
-import org.wso2.statistics.StatisticsConstants;
 import org.wso2.statistics.Counter;
+import org.wso2.statistics.StatisticsConstants;
 import org.wso2.statistics.module.StatisticsModule;
 
 import java.text.SimpleDateFormat;
@@ -89,7 +89,7 @@
         totalMemory = formatMemoryValue(Runtime.getRuntime().totalMemory());
 
         AxisServiceGroup asg =
-                axisConfig.getServiceGroup(org.wso2.esb.Constants.ADMIN_SERVICE_GROUP);
+                axisConfig.getServiceGroup(org.wso2.esb.ServiceBusConstants.ADMIN_SERVICE_GROUP);
 
         int adminservicecout = 0;
         int activeServices = 0;
@@ -139,7 +139,7 @@
         responseCount -= totalResponseFromAdmin;
         faultCount    -= totalFaultCountForAdmin;
         this.services  = activeServices - adminservicecout - 1;
-        serverName     = org.wso2.esb.Constants.ESB_INSTANCE;
+        serverName     = org.wso2.esb.ServiceBusConstants.ESB_INSTANCE;
 
         avgResponseTime = StatisticsModule.responseTimeProcessor.getAvgResponseTime();
         maxResponseTime = StatisticsModule.responseTimeProcessor.getMaxResponseTime();

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/statistics/StatisticsReporterThread.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/statistics/StatisticsReporterThread.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/statistics/StatisticsReporterThread.java	Mon Aug  6 08:29:40 2007
@@ -22,12 +22,13 @@
 import org.wso2.esb.persistence.PersistenceManager;
 import org.wso2.esb.statistics.persistence.StatisticsDBUtils;
 import org.wso2.esb.util.HibernateConfigFactory;
+import org.wso2.esb.ServiceBusConstants;
 
-import java.util.Iterator;
-import java.util.Map;
-import java.util.HashMap;
 import java.net.InetAddress;
 import java.net.UnknownHostException;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
 
 /**
  *
@@ -39,7 +40,7 @@
     private boolean shutdownRequested = false;
 
     PersistenceManager pm = new PersistenceManager(HibernateConfigFactory.getDefaultConfig(
-        org.wso2.esb.Constants.WSO2ESB_HB_CONFIG_KEY, "wso2esb.hibernate.cfg.xml"));
+        org.wso2.esb.ServiceBusConstants.WSO2ESB_HB_CONFIG_KEY, System.getProperty(ServiceBusConstants.ESB_HIBERNATE_CFG_XML)));
 
     /** The reference to the synapse environment   */
     private SynapseEnvironment synapseEnvironment;

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/statistics/persistence/StatisticsDBUtils.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/statistics/persistence/StatisticsDBUtils.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/statistics/persistence/StatisticsDBUtils.java	Mon Aug  6 08:29:40 2007
@@ -17,7 +17,7 @@
 
 import org.apache.synapse.statistics.Statistics;
 import org.apache.synapse.statistics.StatisticsHolder;
-import org.wso2.esb.Constants;
+import org.wso2.esb.ServiceBusConstants;
 import org.wso2.esb.persistence.PersistenceManager;
 import org.wso2.esb.persistence.dataobject.StatisticsDO;
 
@@ -113,7 +113,7 @@
                                      int statisticsCategory, String key,
                                      int direction, Statistics statistics) {
 
-        String queryString = "from " + Constants.DBAccess.STATISTICS_DO + " " +
+        String queryString = "from " + ServiceBusConstants.DBAccess.STATISTICS_DO + " " +
                 " where " + SERVER_ID_ + "= '" + serverId + "' and " +
                 CATEGORY_ + "=" + statisticsCategory + " and " + NAME_ + "= '" + key +
                 "' and " + DIRECTION_ + " = " + direction + "";
@@ -175,7 +175,7 @@
 
     public static StatisticsDO[] getStatistics(PersistenceManager pm, String serverid) {
 
-        String queryString = "from " + Constants.DBAccess.STATISTICS_DO +
+        String queryString = "from " + ServiceBusConstants.DBAccess.STATISTICS_DO +
                 " where " + SERVER_ID_ + " = '" + serverid + "'";
         return pm.selectStatisticsRecords(queryString);
     }
@@ -183,7 +183,7 @@
     public static StatisticsDO[] getStatistics(
             PersistenceManager pm, String serverid, int direction) {
 
-        String queryString = "from  " + Constants.DBAccess.STATISTICS_DO +
+        String queryString = "from  " + ServiceBusConstants.DBAccess.STATISTICS_DO +
                 " where " + SERVER_ID_ + " = '" + serverid +
                 "' and " + DIRECTION_ + " = " + direction + "";
         return pm.selectStatisticsRecords(queryString);
@@ -192,7 +192,7 @@
     public static StatisticsDO[] getStatistics(PersistenceManager pm, String serverid,
                                                int direction, int category) {
 
-        String queryString = "from " + Constants.DBAccess.STATISTICS_DO + " " + " where " +
+        String queryString = "from " + ServiceBusConstants.DBAccess.STATISTICS_DO + " " + " where " +
                 SERVER_ID_ + " = '" + serverid + "' and " + CATEGORY_ + "= " + category + " and " +
                 DIRECTION_ + " = " + direction + "";
         return pm.selectStatisticsRecords(queryString);
@@ -201,7 +201,7 @@
     public static StatisticsDO[] getTotalStatisticsForServer(
             PersistenceManager pm, String serverid) {
 
-        String queryString = "from  " + Constants.DBAccess.STATISTICS_DO + " " +
+        String queryString = "from  " + ServiceBusConstants.DBAccess.STATISTICS_DO + " " +
                 " where " + SERVER_ID_ + " = '" + serverid + "'";
         return pm.selectStatisticsRecords(queryString);
     }
@@ -210,7 +210,7 @@
     public static StatisticsDO[] getStatistics(PersistenceManager pm, String serverid,
                                                int category, String name) {
 
-        String queryString = "from  " + Constants.DBAccess.STATISTICS_DO + " " + " where " +
+        String queryString = "from  " + ServiceBusConstants.DBAccess.STATISTICS_DO + " " + " where " +
                 SERVER_ID_ + " = '" + serverid + "' and " + CATEGORY_ + "= " + category + " and " +
                 NAME_ + " = '" + name + "'";
         return pm.selectStatisticsRecords(queryString);
@@ -219,28 +219,28 @@
     public static StatisticsDO getStatistics(PersistenceManager pm, String serverid, int category,
                                              int direction, String name) {
 
-        String queryString = "from  " + Constants.DBAccess.STATISTICS_DO + " " + " where " +
+        String queryString = "from  " + ServiceBusConstants.DBAccess.STATISTICS_DO + " " + " where " +
                 SERVER_ID_ + " = '" + serverid + "' and " + CATEGORY_ + "= " + category + " and " +
                 NAME_ + " = '" + name + "'" + " and " + DIRECTION_ + " = " + direction + "";
         return (StatisticsDO) pm.createAnewObjectFromStatistics(queryString);
     }
 
     public static StatisticsDO[] getStatistics(PersistenceManager pm, int category, String name) {
-        String queryString = "from  " + Constants.DBAccess.STATISTICS_DO + " " +
+        String queryString = "from  " + ServiceBusConstants.DBAccess.STATISTICS_DO + " " +
                 " where " + CATEGORY_ + "= " + category +
                 " and " + NAME_ + " = '" + name + "'";
         return pm.selectStatisticsRecords(queryString);
     }
 
     public static StatisticsDO[] getStatistics(PersistenceManager pm, int category) {
-        String queryString = "from  " + Constants.DBAccess.STATISTICS_DO + " " +
+        String queryString = "from  " + ServiceBusConstants.DBAccess.STATISTICS_DO + " " +
                 " where " + CATEGORY_ + "= " + category +
                 "";
         return pm.selectStatisticsRecords(queryString);
     }
 
     public static StatisticsDO[] getStatistics(PersistenceManager pm, int category, int direction) {
-        String queryString = "from  " + Constants.DBAccess.STATISTICS_DO + " " + " where " +
+        String queryString = "from  " + ServiceBusConstants.DBAccess.STATISTICS_DO + " " + " where " +
                 CATEGORY_ + "= " + category + " and " + DIRECTION_ + " = " + direction + " ";
         return pm.selectStatisticsRecords(queryString);
     }
@@ -248,7 +248,7 @@
     public static StatisticsDO[] getStatisticsForServer(PersistenceManager pm, String serverid,
                                                         int category) {
 
-        String queryString = "from " + Constants.DBAccess.STATISTICS_DO + " " + " where " +
+        String queryString = "from " + ServiceBusConstants.DBAccess.STATISTICS_DO + " " + " where " +
                 SERVER_ID_ + " = '" + serverid + "' and " + CATEGORY_ + " = " + category + "";
         return pm.selectStatisticsRecords(queryString);
     }
@@ -256,7 +256,7 @@
     public static StatisticsDO[] getStatisticsForServer(PersistenceManager pm, String serverid,
                                                         int direction, int category) {
 
-        String queryString = "from  " + Constants.DBAccess.STATISTICS_DO + " " + " where " +
+        String queryString = "from  " + ServiceBusConstants.DBAccess.STATISTICS_DO + " " + " where " +
                 SERVER_ID_ + " = '" + serverid + "' and " + CATEGORY_ + "= " + category + " and " +
                 DIRECTION_ + " = " + direction + "";
         return pm.selectStatisticsRecords(queryString);
@@ -266,7 +266,7 @@
                                                        int direction, int category) {
 
         String queryString = "select sum(totalCount), sum(faultCount), avg(maxTime), " +
-                "avg(minTime), avg(avgTime) from  " + Constants.DBAccess.STATISTICS_DO + " " +
+                "avg(minTime), avg(avgTime) from  " + ServiceBusConstants.DBAccess.STATISTICS_DO + " " +
                 " where " + SERVER_ID_ + " = '" + serverid + "' and " + CATEGORY_ + "= " +
                 category + " and " + DIRECTION_ + " = " + direction + "";
         return pm.createAnewObjectFromStatistics(queryString);
@@ -274,7 +274,7 @@
 
     public static List getTotalCountForServerS(PersistenceManager pm, int category) {
         String queryString = "select  " + SERVER_ID_ + " ,sum(totalCount) from  " +
-                Constants.DBAccess.STATISTICS_DO + " " +
+                ServiceBusConstants.DBAccess.STATISTICS_DO + " " +
                 " where " + CATEGORY_ + "= " + category + " group by " + SERVER_ID_ + " ";
 
         return pm.selectCustomObjectList(queryString);
@@ -282,25 +282,25 @@
 
     public static Object getServersIds(PersistenceManager pm) {
         String queryString = "select distinct " + SERVER_ID_ + " from  " +
-                Constants.DBAccess.STATISTICS_DO + " ";
+                ServiceBusConstants.DBAccess.STATISTICS_DO + " ";
         return pm.selectCustomObjectList(queryString);
     }
 
     public static Object getUniqueNames(PersistenceManager pm, int category) {
         String queryString = "select distinct " + NAME_ + " from  " +
-                Constants.DBAccess.STATISTICS_DO + " where " + CATEGORY_ + "= " + category + "  ";
+                ServiceBusConstants.DBAccess.STATISTICS_DO + " where " + CATEGORY_ + "= " + category + "  ";
         return pm.selectCustomObjectList(queryString);
     }
 
     public static List getTotalCountForCategory(PersistenceManager pm, int category) {
         String queryString = "select " + NAME_ + ",sum(totalCount) from  " +
-                Constants.DBAccess.STATISTICS_DO + " " +
+                ServiceBusConstants.DBAccess.STATISTICS_DO + " " +
                 " where " + CATEGORY_ + "= " + category + " group by " + NAME_ + " ";
         return pm.selectCustomObjectList(queryString);
     }
 
    public static int clearAll(PersistenceManager pm){
-     String queryString =  "DELETE  " + Constants.DBAccess.STATISTICS_DO;
+     String queryString =  "DELETE  " + ServiceBusConstants.DBAccess.STATISTICS_DO;
      return pm.clearAll(queryString);
    }
 }

Added: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/WebServer.java
==============================================================================
--- (empty file)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/WebServer.java	Mon Aug  6 08:29:40 2007
@@ -0,0 +1,12 @@
+package org.wso2.esb.transport;
+
+/**
+ *
+ */
+public interface WebServer {
+
+    public void start() throws Exception;
+
+    public void stop() throws Exception;
+
+}

Added: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/ESBServlet.java
==============================================================================
--- (empty file)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/ESBServlet.java	Mon Aug  6 08:29:40 2007
@@ -0,0 +1,46 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.wso2.esb.transport.tomcat;
+
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.transport.http.AxisServlet;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+
+/**
+ *
+ */
+
+public class ESBServlet extends AxisServlet {
+
+    private static final long serialVersionUID = 3460108128756524161L;
+
+
+    public void init(ServletConfig config) throws ServletException {
+        ServletContext servletContext = config.getServletContext();
+        this.configContext =
+                (ConfigurationContext) servletContext.getAttribute(CONFIGURATION_CONTEXT);
+        this.axisConfiguration = this.configContext.getAxisConfiguration();
+        servletContext.setAttribute(this.getClass().getName(), this);
+        this.servletConfig = config;
+        initParams();
+    }
+}

Added: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/RequestRedirectionFilter.java
==============================================================================
--- (empty file)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/RequestRedirectionFilter.java	Mon Aug  6 08:29:40 2007
@@ -0,0 +1,77 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.wso2.esb.transport.tomcat;
+
+import org.wso2.esb.ServiceBusManager;
+import org.wso2.utils.NetworkUtils;
+
+import javax.servlet.*;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
+
+/**
+ *
+ */
+
+public class RequestRedirectionFilter implements Filter {
+
+    private String contextRoot;
+    private FilterConfig filterConfig;
+
+    public void init(FilterConfig filterConfig) throws ServletException {
+        this.filterConfig = filterConfig;
+        filterConfig.getServletContext().setAttribute(this.getClass().getName(), this);
+    }
+
+    public void doFilter(ServletRequest request, ServletResponse response,
+                         FilterChain filterChain) throws IOException, ServletException {
+        HttpServletRequest httpServletRequest = (HttpServletRequest) request;
+        HttpServletResponse httpServletResponse = (HttpServletResponse) response;
+
+        initContextRoot(httpServletRequest);
+        System.out.println(httpServletRequest.getRequestURL().toString());
+        if (httpServletRequest.getRequestURL().toString()
+                .indexOf(NetworkUtils.getLocalHostname()) == -1) {
+            httpServletResponse.sendRedirect("https://" +
+                                             NetworkUtils.getLocalHostname() + ":" + ServiceBusManager.httpsPort +
+                                             (contextRoot.equals("/") ? contextRoot : contextRoot + "/")); // set the redirection
+        } else {
+            filterChain.doFilter(request, response);
+        }
+
+    }
+
+    public void destroy() {
+        this.filterConfig = null;
+    }
+
+    private void initContextRoot(HttpServletRequest request) {
+
+        if (contextRoot != null && contextRoot.length() != 0) {
+            return;
+        }
+
+        String contextRoot = request.getContextPath();
+        if (contextRoot != null && contextRoot.length() == 0) {
+            contextRoot = "/";
+        }
+        this.contextRoot = contextRoot;
+    }
+}
\ No newline at end of file

Added: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/StartUpServlet.java
==============================================================================
--- (empty file)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/StartUpServlet.java	Mon Aug  6 08:29:40 2007
@@ -0,0 +1,137 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.wso2.esb.transport.tomcat;
+
+import org.apache.axis2.AxisFault;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.PropertyConfigurator;
+import org.wso2.adminui.AdminUIServletFilter;
+import org.wso2.esb.ServiceBusConstants;
+import org.wso2.esb.ServiceBusException;
+import org.wso2.esb.ServiceBusManager;
+
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletContext;
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Map;
+
+/**
+ *
+ */
+
+
+public class StartUpServlet extends HttpServlet {
+
+    //     public static Map pages ;
+    private static Log log = LogFactory.getLog(StartUpServlet.class);
+    private ServiceBusManager serviceBusManager;
+    public static final String CONFIGURATION_CONTEXT = "CONFIGURATION_CONTEXT";
+
+    public void init() throws ServletException {
+        super.init();
+    }
+
+    public void init(ServletConfig servletConfig) throws ServletException {
+        ServletContext servletContext = servletConfig.getServletContext();
+        String esbhome = System.getProperty(ServiceBusConstants.ESB_HOME);
+        if (esbhome == null || "".equals(esbhome)) {
+            esbhome = servletConfig.getInitParameter(ServiceBusConstants.ESB_HOME);
+            if (esbhome != null) {
+                if (esbhome.endsWith("/")) {
+                    esbhome = esbhome.substring(0, esbhome.lastIndexOf("/"));
+                }
+                System.setProperty(ServiceBusConstants.ESB_HOME, esbhome);
+                try {
+                    URL url = new URL("file:" + esbhome + File.separator
+                                      + ServiceBusConstants.ESB_CONF_DIRECTORY + "log4j.properties");
+                    PropertyConfigurator.configure(url);
+                } catch (MalformedURLException ignore) {
+                }
+            } else {
+                log.fatal("esb.home had not set : startup failed");
+                return;
+            }
+        }
+        if ("true".equals(servletContext.getAttribute("hasAlreadyInit"))) {
+            return;
+        }
+        serviceBusManager = ServiceBusManager.getInstance();
+        try {
+            serviceBusManager.start();
+        } catch (AxisFault axisFault) {
+            log.fatal("WSO2 ESB failed to start ", axisFault);
+            throw new ServletException(axisFault);
+        } catch (ServiceBusException e) {
+            log.fatal("WSO2 ESB failed to start ", e);
+            throw new ServletException(e);
+        }
+
+        servletContext.
+                setAttribute(CONFIGURATION_CONTEXT,
+                             serviceBusManager.configurationContext);
+
+        Map fileContents = (Map) serviceBusManager.configurationContext.
+                getProperty(org.wso2.esb.ServiceBusConstants.GENERATED_PAGES);
+        if (fileContents != null) {
+            AdminUIServletFilter adminUIServletFilter =
+                    (AdminUIServletFilter) servletContext.
+                            getAttribute(AdminUIServletFilter.class.getName());
+            if (adminUIServletFilter != null) {
+                adminUIServletFilter.
+                        init(fileContents,
+                             true,
+                             ServiceBusManager.httpsPort,
+                             ServiceBusManager.httpPort,
+                             serviceBusManager.configurationContext.getServiceContextPath());
+            }
+        }
+        servletContext.setAttribute("hasAlreadyInit", "true");
+    }
+
+
+    protected void doGet(HttpServletRequest request,
+                         HttpServletResponse response) throws ServletException,
+                                                              IOException {
+    }
+
+    protected void doPost(HttpServletRequest request,
+                          HttpServletResponse response) throws ServletException,
+                                                               IOException {
+    }
+
+    public void destroy() {
+        try {
+            if (serviceBusManager != null) {
+                serviceBusManager.stop();
+            }
+        } catch (ServiceBusException e) {
+            log.error(e);
+        } catch (AxisFault axisFault) {
+            log.error(axisFault);
+        }
+    }
+}

Added: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/TomcatServer.java
==============================================================================
--- (empty file)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/TomcatServer.java	Mon Aug  6 08:29:40 2007
@@ -0,0 +1,200 @@
+/*
+ *  Licensed to the Apache Software Foundation (ASF) under one
+ *  or more contributor license agreements.  See the NOTICE file
+ *  distributed with this work for additional information
+ *  regarding copyright ownership.  The ASF licenses this file
+ *  to you 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.wso2.esb.transport.tomcat;
+
+import org.apache.catalina.Context;
+import org.apache.catalina.Engine;
+import org.apache.catalina.Host;
+import org.apache.catalina.connector.Connector;
+import org.apache.catalina.realm.MemoryRealm;
+import org.apache.catalina.startup.Embedded;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.tomcat.util.IntrospectionUtils;
+import org.wso2.esb.ServiceBusConfiguration;
+import org.wso2.esb.ServiceBusConstants;
+import org.wso2.esb.ServiceBusManager;
+import org.wso2.esb.transport.WebServer;
+import org.wso2.esb.util.XmlConfigurationFactory;
+import org.wso2.utils.NetworkUtils;
+
+import java.io.File;
+import java.net.InetAddress;
+
+/**
+ *
+ */
+
+public class TomcatServer implements WebServer {
+
+    private static Log log = LogFactory.getLog(TomcatServer.class);
+    public static final Embedded embedded = new Embedded();
+    private ServiceBusConfiguration esbConfiguration;
+
+    public TomcatServer(ServiceBusConfiguration esbConfiguration) {
+        this.esbConfiguration = esbConfiguration;
+    }
+
+    public void start() throws Exception {
+
+        Engine engine;
+
+        String esbHome = System.getProperty(ServiceBusConstants.ESB_HOME);
+
+        String catalinaHome = new File(esbHome).getAbsolutePath() +
+                              File.separator + "tomcat";
+
+        embedded.setCatalinaHome(catalinaHome);
+        String webappsDir = esbHome + File.separator + "webapp";
+        String docsDir = esbHome + File.separator + "docs";
+        String samplesDir = esbHome + File.separator + "samples";
+
+        // set the memory realm
+        MemoryRealm memRealm = new MemoryRealm();
+        embedded.setRealm(memRealm);
+
+        // Create an engine
+        ServiceBusManager.host = NetworkUtils.getLocalHostname();
+        engine = embedded.createEngine();
+        engine.setName("Catalina");
+        engine.setDefaultHost(ServiceBusManager.host);
+        embedded.addEngine(engine);
+
+        // Create a default virtual host
+        Host defaultHost = embedded.createHost(ServiceBusManager.host, webappsDir);
+        engine.addChild(defaultHost);
+        String esbContextPath = XmlConfigurationFactory.getXmlConfiguration(ServiceBusConstants.ESB_WEB_XML_KEY).
+                getUniqueValue("//ns:Mapping[@name=\"admin\"]/ns:ContextPath");
+
+        if (esbContextPath != null) {
+            if (esbContextPath.equals("/")) {
+                esbContextPath = "";
+            } else {
+                if (!esbContextPath.startsWith("/")) {
+                    esbContextPath = "/" + esbContextPath;
+                }
+            }
+        } else {
+            esbContextPath = "/esb";
+        }
+
+        Context esbContext = embedded.createContext(esbContextPath,
+                                                    new File(webappsDir).getAbsolutePath());
+        defaultHost.addChild(esbContext);
+
+        Context docsContext = embedded.createContext("/docs", new File(docsDir).getAbsolutePath());
+        defaultHost.addChild(docsContext);
+
+        Context samplesContext =
+                embedded.createContext("/samples", new File(samplesDir).getAbsolutePath());
+        defaultHost.addChild(samplesContext);
+
+        defaultHost.setDeployOnStartup(true);
+        embedded.setUseNaming(true);
+        addSSLConnector();
+        // Start the embedded server
+        try {
+            embedded.start();
+            log.info("Tomcat Server Started at  " + "https://" + ServiceBusManager.host + ":" + ServiceBusManager.httpsPort + esbContextPath);
+        } catch (Exception e) {
+            log.fatal("Error starting embedded tomcat server : " + e);
+        }
+
+
+    }
+
+    private void addSSLConnector() {
+
+        String portString = esbConfiguration.getFirstProperty("AdminConsole.Port");
+        if (portString != null) {
+            int port = Integer.parseInt(portString);
+            if (port > 0) {
+                ServiceBusManager.httpsPort = port;
+            }
+        }
+        String ksLocation =
+                esbConfiguration.getFirstProperty("AdminConsole.KeyStore.Location");
+        String absKsLocation;
+        if (!new File(ksLocation).isAbsolute()) {
+            absKsLocation =
+                    new File(System.getProperty(ServiceBusConstants.ESB_HOME) + File.separator +
+                             ksLocation).getAbsolutePath();
+        } else {
+            absKsLocation = ksLocation;
+        }
+        String ksPassword =
+                esbConfiguration.getFirstProperty("AdminConsole.KeyStore.Password");
+
+        String sslProtocol = esbConfiguration.getFirstProperty("AdminConsole.SslProtocol");
+        String maxHttpHeaderSize =
+                esbConfiguration.getFirstProperty("AdminConsole.MaxHttpHeaderSize");
+        String maxThreads =
+                esbConfiguration.getFirstProperty("AdminConsole.MaxThreads");
+        String minSpareThreads =
+                esbConfiguration.getFirstProperty("AdminConsole.MinSpareThreads");
+        String maxSpareThreads =
+                esbConfiguration.getFirstProperty("AdminConsole.MaxSpareThreads");
+        String clientAuth = esbConfiguration.getFirstProperty("AdminConsole.ClientAuth");
+        String disableUploadTimeout =
+                esbConfiguration.getFirstProperty("AdminConsole.DisableUploadTimeout");
+        String acceptCount = esbConfiguration.getFirstProperty("AdminConsole.AcceptCount");
+        // SSLConnector
+        Connector sslConnector =
+                embedded.createConnector((InetAddress) null, ServiceBusManager.httpsPort, true);
+        sslConnector.setScheme("https");
+//        IntrospectionUtils.setProperty(sslConnector, "sslProtocol", "TLS");
+        if (ksPassword != null) {
+            IntrospectionUtils.setProperty(sslConnector, "keypass", ksPassword);
+        }
+        if (ksLocation != null) {
+            IntrospectionUtils.setProperty(sslConnector, "keystore", absKsLocation);
+        }
+        if (sslProtocol != null) {
+            IntrospectionUtils.setProperty(sslConnector, "sslProtocol", sslProtocol);
+        }
+        if (maxHttpHeaderSize != null) {
+            IntrospectionUtils.setProperty(sslConnector, "maxHttpHeaderSize", maxHttpHeaderSize);
+        }
+        if (maxThreads != null) {
+            IntrospectionUtils.setProperty(sslConnector, "maxThreads", maxThreads);
+        }
+        if (maxSpareThreads != null) {
+            IntrospectionUtils.setProperty(sslConnector, "maxSpareThreads", maxSpareThreads);
+        }
+        if (minSpareThreads != null) {
+            IntrospectionUtils.setProperty(sslConnector, "minSpareThreads", minSpareThreads);
+        }
+        if (disableUploadTimeout != null) {
+            IntrospectionUtils.setProperty(sslConnector, "disableUploadTimeout", disableUploadTimeout);
+        }
+        if (clientAuth != null) {
+            IntrospectionUtils.setProperty(sslConnector, "clientAuth", clientAuth);
+        }
+        if (acceptCount != null) {
+            IntrospectionUtils.setProperty(sslConnector, "acceptCount", acceptCount);
+        }
+        sslConnector.setEnableLookups(true);
+        sslConnector.setSecure(true);
+        embedded.addConnector(sslConnector);
+    }
+
+    public void stop() throws Exception {
+        embedded.stop();
+    }
+}

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/util/MIMEType2FileExtensionMap.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/util/MIMEType2FileExtensionMap.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/util/MIMEType2FileExtensionMap.java	Mon Aug  6 08:29:40 2007
@@ -1,14 +1,14 @@
 package org.wso2.esb.util;
 
-import org.apache.log4j.Logger;
 import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
+import org.apache.log4j.Logger;
 
 import javax.xml.namespace.QName;
-import java.util.Map;
+import java.io.File;
 import java.util.HashMap;
 import java.util.Iterator;
-import java.io.File;
+import java.util.Map;
 
 public class MIMEType2FileExtensionMap {
     private Map extensionToMimeMap;

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/util/XmlConfiguration.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/util/XmlConfiguration.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/util/XmlConfiguration.java	Mon Aug  6 08:29:40 2007
@@ -1,15 +1,15 @@
 package org.wso2.esb.util;
 
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import org.apache.axiom.om.OMElement;
 import org.apache.axiom.om.impl.builder.StAXOMBuilder;
 import org.apache.axiom.om.xpath.AXIOMXPath;
-import org.apache.axiom.om.OMElement;
-import org.wso2.utils.ServerException;
-import org.wso2.esb.Constants;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jaxen.JaxenException;
 import org.jaxen.SimpleNamespaceContext;
 import org.jaxen.XPath;
-import org.jaxen.JaxenException;
+import org.wso2.esb.ServiceBusConstants;
+import org.wso2.utils.ServerException;
 
 import javax.xml.stream.XMLStreamException;
 import java.io.FileNotFoundException;
@@ -21,7 +21,7 @@
 
     private StAXOMBuilder builder;
 
-    private String serverNamespace = Constants.ESB_XML_NAMESPACE;
+    private String serverNamespace = ServiceBusConstants.ESB_XML_NAMESPACE;
 
     public XmlConfiguration(String xmlFile) throws ServerException {
         this(xmlFile, null);

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/util/XmlConfigurationFactory.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/util/XmlConfigurationFactory.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/util/XmlConfigurationFactory.java	Mon Aug  6 08:29:40 2007
@@ -2,8 +2,8 @@
 
 import org.wso2.utils.ServerException;
 
-import java.util.Map;
 import java.util.HashMap;
+import java.util.Map;
 
 public class XmlConfigurationFactory {
     private static Map configurations = new HashMap();

Modified: trunk/esb/java/modules/core/src/test/java/org/wso2/esb/util/ServiceBusUtils.java
==============================================================================
--- trunk/esb/java/modules/core/src/test/java/org/wso2/esb/util/ServiceBusUtils.java	(original)
+++ trunk/esb/java/modules/core/src/test/java/org/wso2/esb/util/ServiceBusUtils.java	Mon Aug  6 08:29:40 2007
@@ -21,8 +21,8 @@
 import org.apache.axis2.description.AxisService;
 import org.apache.axis2.description.AxisServiceGroup;
 import org.apache.axis2.rpc.receivers.RPCMessageReceiver;
-import org.wso2.esb.ServiceBus;
 import org.wso2.esb.ServiceBusException;
+import org.wso2.esb.Main;
 import org.wso2.esb.services.LoginAdmin;
 
 import javax.xml.namespace.QName;
@@ -32,7 +32,7 @@
 */
 
 public class ServiceBusUtils {
-    private ServiceBus esb;
+    private Main esb;
 
     public static void deployService(
             ConfigurationContext configurationContext, AxisService service)
@@ -72,7 +72,7 @@
             System.setProperty("synapse.xml", "test-resources/synapse.xml");
 
             //setting up the Testing port
-            esb = new ServiceBus();
+            esb = new Main();
 
             esb.startListener(TestConstants.TESTING_PORT);
             Thread.sleep(1000);
@@ -93,7 +93,7 @@
         configurationContext.getAxisConfiguration().removeService(service.getLocalPart());
     }
 
-    public ServiceBus getServiceBus() {
+    public Main getServiceBus() {
         return this.esb;
     }
 

Modified: trunk/esb/java/modules/core/src/test/resources/hibernate.cfg.xml
==============================================================================
--- trunk/esb/java/modules/core/src/test/resources/hibernate.cfg.xml	(original)
+++ trunk/esb/java/modules/core/src/test/resources/hibernate.cfg.xml	Mon Aug  6 08:29:40 2007
@@ -7,12 +7,12 @@
     <session-factory>
         <!-- Settings for a Derby Network Server database. -->
         <property name="connection.url">
-            jdbc:derby://localhost:1527//home/chathura/temp/db/db1/DB2</property>
+            jdbc:derby://localhost:1528/../../../../database/WSO2ESB_DATABASE;create=true</property>
         <property name="connection.driver_class">org.apache.derby.jdbc.ClientDriver</property>
         <property name="connection.username">wso2esb</property>
         <property name="connection.password">wso2esb</property>
         <property name="dialect">org.hibernate.dialect.DerbyDialect</property>
-        <!--<property name="hibernate.hbm2ddl.auto">create</property>-->
+        <property name="hibernate.hbm2ddl.auto">update</property>
 
 
         <!-- Use the Hibernate built-in pool -->
@@ -25,10 +25,12 @@
         -->
 
         <!-- Print SQL to stdout -->
-        <property name="show_sql">true</property>
+        <property name="show_sql">false</property>
 
         <!-- mapping files -->
+        <mapping resource="statistics.hbm.xml"/>
         <mapping resource="reg-meta-data.hbm.xml"/>
+        <!--<mapping name="org.wso2.esb.statistics.persistence.hibernate.bean.StatisticsDO" />-->
 
     </session-factory>
 </hibernate-configuration>
\ No newline at end of file

Modified: trunk/esb/java/modules/distribution/src/main/assembly/bin.xml
==============================================================================
--- trunk/esb/java/modules/distribution/src/main/assembly/bin.xml	(original)
+++ trunk/esb/java/modules/distribution/src/main/assembly/bin.xml	Mon Aug  6 08:29:40 2007
@@ -77,9 +77,12 @@
 
         <fileSet>
             <directory>src/main/conf</directory>
-            <outputDirectory>wso2esb-${wso2.esb.version}/conf</outputDirectory>
+            <outputDirectory>wso2esb-${wso2.esb.version}/webapp/WEB-INF/classes/conf</outputDirectory>
             <excludes>
-                <exclude>log4j.properties</exclude>
+                <exclude>wrapper.dll</exclude>
+                <exclude>web.xml</exclude>
+                <exclude>tomcat</exclude>                
+                <exclude>tomcat/*</exclude>                
             </excludes>
         </fileSet>
         <fileSet>
@@ -88,7 +91,7 @@
         </fileSet>
         <fileSet>
             <directory>../../modules/core/src/main/resources</directory>
-            <outputDirectory>wso2esb-${wso2.esb.version}/lib</outputDirectory>
+            <outputDirectory>wso2esb-${wso2.esb.version}/webapp/WEB-INF/classes/conf</outputDirectory>
             <includes>
                 <include>identity.jks</include>
                 <include>trust.jks</include>
@@ -97,7 +100,7 @@
         </fileSet>
         <fileSet>
             <directory>src/main/bin</directory>
-            <outputDirectory>wso2esb-${wso2.esb.version}/lib</outputDirectory>
+            <outputDirectory>wso2esb-${wso2.esb.version}/webapp/WEB-INF/lib</outputDirectory>
             <includes>
                 <include>wrapper.dll</include>
             </includes>
@@ -180,7 +183,7 @@
 
         <fileSet>
             <directory>../../modules/core/target</directory>
-            <outputDirectory>wso2esb-${wso2.esb.version}/lib</outputDirectory>
+            <outputDirectory>wso2esb-${wso2.esb.version}/webapp/WEB-INF/lib</outputDirectory>
             <includes>
                 <include>wso2-esb-core-${wso2.esb.version}.jar</include>
             </includes>
@@ -188,26 +191,37 @@
 
         <fileSet>
             <directory>target/temp/lib</directory>
-            <outputDirectory>wso2esb-${wso2.esb.version}/lib/endorsed</outputDirectory>
+            <outputDirectory>wso2esb-${wso2.esb.version}/tomcat/lib/endorsed</outputDirectory>
             <includes>
                 <include>xml-apis-${xml_apis.version}.jar</include>
                 <include>xercesImpl-${xerces.version}.jar</include>
             </includes>
-        </fileSet>
+        </fileSet>           
 
         <fileSet>
             <directory>target/temp/lib/www</directory>
-            <outputDirectory>wso2esb-${wso2.esb.version}/lib/www</outputDirectory>
+            <outputDirectory>wso2esb-${wso2.esb.version}/webapp</outputDirectory>
         </fileSet>
 
         <fileSet>
             <directory>src/main/www</directory>
-            <outputDirectory>wso2esb-${wso2.esb.version}/lib/www</outputDirectory>
+            <outputDirectory>wso2esb-${wso2.esb.version}/webapp</outputDirectory>
         </fileSet>
-        
+        <fileSet>
+            <directory>src/main/conf</directory>
+            <outputDirectory>wso2esb-${wso2.esb.version}/webapp/WEB-INF</outputDirectory>
+            <includes>
+                <include>web.xml</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>src/main/conf/tomcat</directory>
+            <outputDirectory>wso2esb-${wso2.esb.version}/tomcat/conf</outputDirectory>
+        </fileSet>
+
         <fileSet>
             <directory>../../modules/samples/target</directory>
-            <outputDirectory>wso2esb-${wso2.esb.version}/lib</outputDirectory>
+            <outputDirectory>wso2esb-${wso2.esb.version}/webapp/WEB-INF/lib</outputDirectory>
             <includes>
                 <include>wso2-esb-samples-${wso2.esb.version}.jar</include>
             </includes>
@@ -243,8 +257,25 @@
 
     <dependencySets>
         <dependencySet>
-            <outputDirectory>wso2esb-${wso2.esb.version}/lib</outputDirectory>
+            <outputDirectory>wso2esb-${wso2.esb.version}/webapp/WEB-INF/lib</outputDirectory>
             <excludes>
+                <exclude>tomcat:catalina:jar</exclude>
+                <exclude>tomcat:catalina-optional:jar</exclude>
+                <exclude>tomcat:jasper-compiler:jar</exclude>
+                <exclude>tomcat:jasper-compiler-jdt:jar</exclude>
+                <exclude>tomcat:jasper-runtime:jar</exclude>
+                <exclude>tomcat:naming-factory:jar</exclude>
+                <exclude>tomcat:naming-resources:jar</exclude>
+                <exclude>tomcat:servlets-default:jar</exclude>
+                <exclude>tomcat:tomcat-coyote:jar</exclude>
+                <exclude>tomcat:tomcat-http:jar</exclude>
+                <exclude>tomcat:tomcat-util:jar</exclude>
+                <exclude>tomcat:naming-factory-dbcp:jar</exclude>
+                <exclude>tomcat:tomcat-apr:jar</exclude>
+                <exclude>tomcat:jsp-api:jar</exclude>
+                <exclude>tomcat:servlet-api:jar</exclude>
+                <exclude>mx4j:mx4j-tools:jar</exclude>
+                <exclude>mx4j:mx4j-jmx:jar</exclude>
                 <exclude>org.apache.axis2:addressing:mar</exclude>
                 <exclude>org.apache.rampart:rampart:mar</exclude>
                 <exclude>org.apache.sandesha2:sandesha2:mar</exclude>
@@ -265,6 +296,28 @@
             </excludes>
         </dependencySet>
         <dependencySet>
+            <outputDirectory>wso2esb-${wso2.esb.version}/tomcat/lib</outputDirectory>
+            <includes>
+                <include>tomcat:catalina:jar</include>
+                <include>tomcat:servlet-api:jar</include>
+                <include>tomcat:catalina-optional:jar</include>
+                <include>tomcat:jasper-compiler:jar</include>
+                <include>tomcat:jasper-compiler-jdt:jar</include>
+                <include>tomcat:jasper-runtime:jar</include>
+                <include>tomcat:naming-factory:jar</include>
+                <include>tomcat:naming-resources:jar</include>
+                <include>tomcat:servlets-default:jar</include>
+                <include>tomcat:tomcat-coyote:jar</include>
+                <include>tomcat:tomcat-http:jar</include>
+                <include>tomcat:tomcat-util:jar</include>
+                <include>tomcat:naming-factory-dbcp:jar</include>
+                <include>tomcat:tomcat-apr:jar</include>
+                <include>tomcat:jsp-api:jar</include>
+                <include>mx4j:mx4j-tools:jar</include>
+                <include>mx4j:mx4j-jmx:jar</include>
+            </includes>
+        </dependencySet>
+        <dependencySet>
             <outputDirectory>wso2esb-${wso2.esb.version}/repository/modules</outputDirectory>
             <includes>
                 <include>org.apache.axis2:addressing:mar</include>

Modified: trunk/esb/java/modules/distribution/src/main/bin/install-wso2-esb-service.bat
==============================================================================
--- trunk/esb/java/modules/distribution/src/main/bin/install-wso2-esb-service.bat	(original)
+++ trunk/esb/java/modules/distribution/src/main/bin/install-wso2-esb-service.bat	Mon Aug  6 08:29:40 2007
@@ -38,7 +38,7 @@
 :conf
 set _WRAPPER_CONF="%~f1"
 if not %_WRAPPER_CONF%=="" goto startup
-set _WRAPPER_CONF="%_REALPATH%conf\wrapper.conf"
+set _WRAPPER_CONF="%_REALPATH%webapp\WEB-INF\classes\conf\wrapper.conf"
 
 rem
 rem Install the Wrapper as an NT service.

Modified: trunk/esb/java/modules/distribution/src/main/bin/uninstall-wso2-esb-service.bat
==============================================================================
--- trunk/esb/java/modules/distribution/src/main/bin/uninstall-wso2-esb-service.bat	(original)
+++ trunk/esb/java/modules/distribution/src/main/bin/uninstall-wso2-esb-service.bat	Mon Aug  6 08:29:40 2007
@@ -38,7 +38,7 @@
 :conf
 set _WRAPPER_CONF="%~f1"
 if not %_WRAPPER_CONF%=="" goto startup
-set _WRAPPER_CONF="%_REALPATH%conf\wrapper.conf"
+set _WRAPPER_CONF="%_REALPATH%webapp\WEB-INF\classes\conf\wrapper.conf"
 
 rem
 rem Uninstall the Wrapper as an NT service.

Modified: trunk/esb/java/modules/distribution/src/main/bin/wso2-esb.bat
==============================================================================
--- trunk/esb/java/modules/distribution/src/main/bin/wso2-esb.bat	(original)
+++ trunk/esb/java/modules/distribution/src/main/bin/wso2-esb.bat	Mon Aug  6 08:29:40 2007
@@ -21,7 +21,7 @@
 set ESB_HOME=%~dps0..
 
 set _USE_CLASSPATH=yes
-set _SYNAPSE_XML=-Dsynapse.xml="%ESB_HOME%\conf\synapse.xml"
+set _SYNAPSE_XML=-Dsynapse.xml="%ESB_HOME%\webapp\WEB-INF\classes\conf\synapse.xml"
 set _XDEBUG=
 set _PORT=
 
@@ -86,25 +86,27 @@
 rem set the classes by looping through the libs
 setlocal EnableDelayedExpansion
 set ESB_CLASS_PATH="%ESB_HOME%/lib";"%ESB_HOME%/repository/conf"
-FOR %%C in ("%ESB_HOME%\lib\*.jar") DO set ESB_CLASS_PATH=!ESB_CLASS_PATH!;"%%~fC"
-set ESB_CLASS_PATH="%ESB_HOME%\lib";%ESB_CLASS_PATH%
+FOR %%C in ("%ESB_HOME%\tomcat\lib\*.jar") DO set ESB_CLASS_PATH=!ESB_CLASS_PATH!;"%%~fC"
+set ESB_CLASS_PATH="%ESB_HOME%\tomcat\lib";%ESB_CLASS_PATH%
+FOR %%C in ("%ESB_HOME%\webapp\WEB-INF\lib\*.jar") DO set ESB_CLASS_PATH=!ESB_CLASS_PATH!;"%%~fC"
+set ESB_CLASS_PATH="%ESB_HOME%\webapp\WEB-INF\lib";%ESB_CLASS_PATH%
 
 rem use proper bouncy castle version for the JDK
 
 "%JAVA_HOME%\bin\java" -version 2>&1 | findstr "1.4" >NUL
 IF ERRORLEVEL 1 goto checkJdk15
 echo  Using Bouncy castle JAR for Java 1.4
-FOR %%C in ("%ESB_HOME%\lib\bcprov-jdk13*.jar") DO set ESB_CLASS_PATH="%%~fC";!ESB_CLASS_PATH!
+FOR %%C in ("%ESB_HOME%\webapp\WEB-INF\lib\bcprov-jdk13*.jar") DO set ESB_CLASS_PATH="%%~fC";!ESB_CLASS_PATH!
 goto runServer
 
 :checkJdk15
 "%JAVA_HOME%\bin\java" -version 2>&1 | findstr "1.5" >NUL
 IF ERRORLEVEL 1 goto runServer
 echo  Using Bouncy castle JAR for Java 1.5
-FOR %%C in ("%ESB_HOME%\lib\bcprov-jdk15*.jar") DO set ESB_CLASS_PATH="%%~fC";!ESB_CLASS_PATH!
+FOR %%C in ("%ESB_HOME%\webapp\WEB-INF\lib\bcprov-jdk15*.jar") DO set ESB_CLASS_PATH="%%~fC";!ESB_CLASS_PATH!
 
 :runServer
-set ESB_CLASS_PATH=%ESB_HOME%\conf;%ESB_CLASS_PATH%
+set ESB_CLASS_PATH=%ESB_HOME%\webapp\WEB-INF\classes\conf;%ESB_CLASS_PATH%
 
 @rem @echo on
 cd %ESB_HOME%
@@ -112,7 +114,7 @@
 echo Using ESB_HOME:        %ESB_HOME%
 echo Using JAVA_HOME:       %JAVA_HOME%
 echo Using SYNAPSE_XML:     %_SYNAPSE_XML%
-%_JAVACMD% %_SYNAPSE_XML%  -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XMLGrammarCachingConfiguration -Desb.home="%ESB_HOME%" -Desb.xml="%ESB_HOME%\conf\server.xml" -Daxis2.xml="%ESB_HOME%\conf\axis2.xml" -Daxis2.repo="%ESB_HOME%\repository" -Djava.endorsed.dirs=%ESB_ENDORSED% %_XDEBUG% -cp %ESB_CLASS_PATH% org.wso2.esb.ServiceBus START %ESB_CMD_LINE_ARGS%
+%_JAVACMD% %_SYNAPSE_XML%  -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XMLGrammarCachingConfiguration -Desb.home="%ESB_HOME%" -Desb.xml="%ESB_HOME%\webapp\WEB-INF\classes\conf\server.xml" -Daxis2.xml="%ESB_HOME%\webapp\WEB-INF\classes\conf\axis2.xml" -Daxis2.repo="%ESB_HOME%\repository" -Djava.endorsed.dirs=%ESB_ENDORSED% %_XDEBUG% -cp %ESB_CLASS_PATH% org.wso2.esb.Main START %ESB_CMD_LINE_ARGS%
 goto end
 
 :end

Modified: trunk/esb/java/modules/distribution/src/main/bin/wso2-esb.sh
==============================================================================
--- trunk/esb/java/modules/distribution/src/main/bin/wso2-esb.sh	(original)
+++ trunk/esb/java/modules/distribution/src/main/bin/wso2-esb.sh	Mon Aug  6 08:29:40 2007
@@ -75,12 +75,19 @@
 fi
 
 # update classpath
-ESB_CLASSPATH="$ESB_HOME/lib":
-for f in $ESB_HOME/lib/*.jar
+ESB_CLASSPATH="$ESB_HOME/tomcat/lib":
+for f in $ESB_HOME/tomcat/lib/*.jar
 do
   ESB_CLASSPATH=$ESB_CLASSPATH:$f
 done
-ESB_CLASSPATH=$ESB_HOME/conf:$ESB_CLASSPATH:$JAVA_HOME/lib/tools.jar
+
+ESB_CLASSPATH=$ESB_CLASSPATH:"$ESB_HOME/webapp/WEB-INF/lib":
+for f in $ESB_HOME/webapp/WEB-INF/lib/*.jar
+do
+  ESB_CLASSPATH=$ESB_CLASSPATH:$f
+done
+
+ESB_CLASSPATH=$ESB_HOME/webapp/WEB-INF/classes/conf:$ESB_CLASSPATH:$JAVA_HOME/lib/tools.jar
 
 # use proper bouncy castle version for the JDK
 jdk_15=`$JAVA_HOME/bin/java -version 2>&1 | grep 1.5`
@@ -112,7 +119,7 @@
 ESB_ENDORSED=$ESB_HOME/lib/endorsed:$JAVA_HOME/jre/lib/endorsed
 
 # synapse.xml
-ESB_XML=-Dsynapse.xml=$ESB_HOME/conf/synapse.xml
+ESB_XML=-Dsynapse.xml=$ESB_HOME/webapp/WEB-INF/classes/conf/synapse.xml
 
 if [ "$1" = "-xdebug" ]; then
   XDEBUG="-Xdebug -Xnoagent -Xrunjdwp:transport=dt_socket,server=y,address=8000"
@@ -143,4 +150,4 @@
 echo "Using JAVA_HOME:       $JAVA_HOME"
 echo "Using SYNAPSE_XML:     $ESB_XML"
 
-$JAVA_HOME/bin/java $ESB_XML -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XMLGrammarCachingConfiguration -Desb.home=$ESB_HOME -Desb.xml=$ESB_HOME/conf/server.xml -Daxis2.xml=$ESB_HOME/conf/axis2.xml -Daxis2.repo=$ESB_HOME/repository -Djava.endorsed.dirs=$ESB_ENDORSED $XDEBUG -classpath $ESB_CLASSPATH org.wso2.esb.ServiceBus START
+$JAVA_HOME/bin/java $ESB_XML -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XMLGrammarCachingConfiguration -Desb.home=$ESB_HOME -Desb.xml=$ESB_HOME/webapp/WEB-INF/classes/conf/server.xml -Daxis2.xml=$ESB_HOME/webapp/WEB-INF/classes/conf/axis2.xml -Daxis2.repo=$ESB_HOME/repository -Djava.endorsed.dirs=$ESB_ENDORSED $XDEBUG -classpath $ESB_CLASSPATH org.wso2.esb.Main START
\ No newline at end of file

Modified: trunk/esb/java/modules/distribution/src/main/conf/axis2.xml
==============================================================================
--- trunk/esb/java/modules/distribution/src/main/conf/axis2.xml	(original)
+++ trunk/esb/java/modules/distribution/src/main/conf/axis2.xml	Mon Aug  6 08:29:40 2007
@@ -160,21 +160,21 @@
 
     <!--Uncomment this and configure as appropriate for JMS transport support, after setting up your JMS environment (e.g. ActiveMQ)
     <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
-        <parameter name="myTopicConnectionFactory" locked="false">        	        	
+        <parameter name="myTopicConnectionFactory" locked="false">
         	<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
-        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>        	
+        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>
         	<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter>
         </parameter>
 
-        <parameter name="myQueueConnectionFactory" locked="false">        	        	
+        <parameter name="myQueueConnectionFactory" locked="false">
         	<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
-        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>        	
+        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>
         	<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
         </parameter>
 
-        <parameter name="default" locked="false">        	        	
+        <parameter name="default" locked="false">
         	<parameter name="java.naming.factory.initial" locked="false">org.apache.activemq.jndi.ActiveMQInitialContextFactory</parameter>
-        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>        	
+        	<parameter name="java.naming.provider.url" locked="false">tcp://localhost:61616</parameter>
         	<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
         </parameter>
     </transportReceiver>-->
@@ -225,12 +225,12 @@
     <!-- Clustering  -->
     <!-- ================================================= -->
     <!-- Configure and uncomment following for preparing Axis2 to a clustered environment -->
-    <!-- 
+    <!--
     <cluster class="org.apache.axis2.cluster.tribes.TribesClusterManager">
     	<parameter name="param1" locked="false">value1</parameter>
     </cluster>
      -->
-     
+
     <!-- ================================================= -->
     <!-- Phases  -->
     <!-- ================================================= -->
@@ -267,7 +267,7 @@
                      class="org.apache.axis2.engine.HTTPLocationBasedDispatcher">
                 <order phase="Dispatch"/>
             </handler>
-            
+
             <handler name="InstanceDispatcher"
                      class="org.apache.axis2.engine.InstanceDispatcher">
                 <order phase="Dispatch"/>

Modified: trunk/esb/java/modules/distribution/src/main/conf/server-web.xml
==============================================================================
--- trunk/esb/java/modules/distribution/src/main/conf/server-web.xml	(original)
+++ trunk/esb/java/modules/distribution/src/main/conf/server-web.xml	Mon Aug  6 08:29:40 2007
@@ -17,8 +17,8 @@
 <Web xmlns="http://www.wso2.org/projects/esb">
     <UrlContextMappings>
         <Mapping name="admin">
-            <ContextPath>/</ContextPath>
-            <ResourceBase>./lib/www</ResourceBase>
+            <ContextPath>/esb</ContextPath>
+            <ResourceBase>webapp</ResourceBase>
         </Mapping>
         <Mapping name="serviceui">
             <ContextPath>/wservices</ContextPath>

Modified: trunk/esb/java/modules/distribution/src/main/conf/server.xml
==============================================================================
--- trunk/esb/java/modules/distribution/src/main/conf/server.xml	(original)
+++ trunk/esb/java/modules/distribution/src/main/conf/server.xml	Mon Aug  6 08:29:40 2007
@@ -100,5 +100,29 @@
     <!-- Deplay for Statistisc Reporter Thread -->
     <StatisticsPersistenceInterval>60000</StatisticsPersistenceInterval>
 
-    <adminConsolePort>9443</adminConsolePort>
+    <AdminConsole>
+        <Port>9443</Port>
+        <Non-blocking>true</Non-blocking>
+        <SslProtocol>TLS</SslProtocol>
+        <!--<MaxHttpHeaderSize>8192</MaxHttpHeaderSize>-->
+        <!--<MaxThreads>150</MaxThreads>-->
+        <!--<MinSpareThreads>25</MinSpareThreads>-->
+        <!--<MaxSpareThreads>75</MaxSpareThreads>-->
+        <!--<EnableLookups>false</EnableLookups>-->
+        <!--<DisableUploadTimeout>false</DisableUploadTimeout>-->
+        <!--<ClientAuth>false</ClientAuth>-->
+        <!--<AcceptCount>100</AcceptCount>-->
+        <KeyStore>
+            <Location>webapp/WEB-INF/classes/conf/identity.jks</Location>
+            <Type>JKS</Type>
+            <Password>password</Password>
+            <KeyPassword>password</KeyPassword>
+        </KeyStore>
+        <TrustStore>
+            <Location>webapp/WEB-INF/classes/conf/trust.jks</Location>
+            <Type>JKS</Type>
+            <Password>password</Password>
+        </TrustStore>
+
+    </AdminConsole>
 </Server>

Modified: trunk/esb/java/modules/distribution/src/main/conf/synapse.xml
==============================================================================
--- trunk/esb/java/modules/distribution/src/main/conf/synapse.xml	(original)
+++ trunk/esb/java/modules/distribution/src/main/conf/synapse.xml	Mon Aug  6 08:29:40 2007
@@ -1,44 +1,43 @@
 <!--
-  ~ Copyright (c) 2006, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
+  ~  Licensed to the Apache Software Foundation (ASF) under one
+  ~  or more contributor license agreements.  See the NOTICE file
+  ~  distributed with this work for additional information
+  ~  regarding copyright ownership.  The ASF licenses this file
+  ~  to you 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
   ~
-  ~ 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
   ~
-  ~      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.
+  ~  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.
   -->
-
+<!-- introduction to URL source properties, registry based properties and the XSLT mediator -->
 <definitions xmlns="http://ws.apache.org/ns/synapse">
 
+    <!-- the SimpleURLRegistry allows access to a URL based registry (e.g. file:/// or http://) -->
     <registry provider="org.wso2.esb.registry.ESBRegistry">
-        <parameter name="root">file:registry</parameter>
-        <parameter name="cachableDuration">60000</parameter>
+        <!-- the root property of the simple URL registry helps resolve a resource URL as root + key -->
+        <parameter name="root">file:repository/conf/sample/resources/</parameter>
+        <!-- all resources loaded from the URL registry would be cached for this number of milli seconds -->
+        <parameter name="cachableDuration">15000</parameter>
     </registry>
 
-    <sequence name="main">
-        <in>
-            <!-- Log all messages passing through -->
-            <log level="full"/>
-
-            <!-- ensure that the default configuration only sends if it is one of samples -->
-            <!-- Otherwise Synapse would be an open proxy by default (BAD!)               -->
-            <filter source="get-property('To')" regex="http://localhost:9000.*">
-                <!-- Send the messages where they have been sent (i.e. implicit "To" EPR) -->
-                <send/>
-            </filter>
-        </in>
-        <out>
-            <send/>
-        </out>
-    </sequence>
-    <sequence name="fault">
-        <log/>
-    </sequence>
+    <!-- define the request processing XSLT resource as a static URL source -->
+    <localEntry key="xslt-key-req" src="file:repository/conf/sample/resources/transform/transform.xslt"/>
 
-</definitions>
\ No newline at end of file
+    <in>
+        <!-- transform the custom quote request into a standard quote requst expected by the service -->
+        <xslt key="xslt-key-req"/>
+    </in>
+    <out>
+        <!-- transform the standard response back into the custom format the client expects -->
+	    <!-- the key is looked up in the remote registry and loaded as a 'dynamic' registry resource -->
+        <xslt key="transform/transform_back.xslt"/>
+    </out>
+	<send/>
+</definitions> 
\ No newline at end of file

Added: trunk/esb/java/modules/distribution/src/main/conf/tomcat/context.xml
==============================================================================
--- (empty file)
+++ trunk/esb/java/modules/distribution/src/main/conf/tomcat/context.xml	Mon Aug  6 08:29:40 2007
@@ -0,0 +1,12 @@
+<!-- The contents of this file will be loaded for each web application -->
+<Context>
+
+    <!-- Default set of monitored resources -->
+    <WatchedResource>WEB-INF/web.xml</WatchedResource>
+
+    <!-- Uncomment this to disable session persistence across Tomcat restarts -->
+    <!--
+    <Manager pathname="" />
+    -->
+
+</Context>
\ No newline at end of file

Added: trunk/esb/java/modules/distribution/src/main/conf/tomcat/tomcat-users.xml
==============================================================================
--- (empty file)
+++ trunk/esb/java/modules/distribution/src/main/conf/tomcat/tomcat-users.xml	Mon Aug  6 08:29:40 2007
@@ -0,0 +1,19 @@
+<!--
+  ~ Copyright 2005-2007 WSO2, Inc. (http://wso2.com)
+  ~
+  ~ 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.
+  -->
+
+<tomcat-users>
+
+</tomcat-users>
\ No newline at end of file

Added: trunk/esb/java/modules/distribution/src/main/conf/tomcat/web.xml
==============================================================================
--- (empty file)
+++ trunk/esb/java/modules/distribution/src/main/conf/tomcat/web.xml	Mon Aug  6 08:29:40 2007
@@ -0,0 +1,1164 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+    xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+    version="2.4">
+
+  <!-- ======================== Introduction ============================== -->
+  <!-- This document defines default values for *all* web applications      -->
+  <!-- loaded into this instance of Tomcat.  As each application is         -->
+  <!-- deployed, this file is processed, followed by the                    -->
+  <!-- "/WEB-INF/web.xml" deployment descriptor from your own               -->
+  <!-- applications.                                                        -->
+  <!--                                                                      -->
+  <!-- WARNING:  Do not configure application-specific resources here!      -->
+  <!-- They should go in the "/WEB-INF/web.xml" file in your application.   -->
+
+
+  <!-- ================== Built In Servlet Definitions ==================== -->
+
+
+  <!-- The default servlet for all web applications, that serves static     -->
+  <!-- resources.  It processes all requests that are not mapped to other   -->
+  <!-- servlets with servlet mappings (defined either here or in your own   -->
+  <!-- web.xml file.  This servlet supports the following initialization    -->
+  <!-- parameters (default values are in square brackets):                  -->
+  <!--                                                                      -->
+  <!--   debug               Debugging detail level for messages logged     -->
+  <!--                       by this servlet.  [0]                          -->
+  <!--                                                                      -->
+  <!--   fileEncoding        Encoding to be used to read static resources   -->
+  <!--                       [platform default]                             -->
+  <!--                                                                      -->
+  <!--   input               Input buffer size (in bytes) when reading      -->
+  <!--                       resources to be served.  [2048]                -->
+  <!--                                                                      -->
+  <!--   listings            Should directory listings be produced if there -->
+  <!--                       is no welcome file in this directory?  [false] -->
+  <!--                       WARNING: Listings for directories with many    -->
+  <!--                       entries can be slow and may consume            -->
+  <!--                       significant proportions of server resources.   -->
+  <!--                                                                      -->
+  <!--   output              Output buffer size (in bytes) when writing     -->
+  <!--                       resources to be served.  [2048]                -->
+  <!--                                                                      -->
+  <!--   readonly            Is this context "read only", so HTTP           -->
+  <!--                       commands like PUT and DELETE are               -->
+  <!--                       rejected?  [true]                              -->
+  <!--                                                                      -->
+  <!--   readmeFile          File name to display with the directory        -->
+  <!--                       contents. [null]                               -->
+  <!--                                                                      -->
+  <!--   sendfileSize        If the connector used supports sendfile, this  -->
+  <!--                       represents the minimal file size in KB for     -->
+  <!--                       which sendfile will be used. Use a negative    -->
+  <!--                       value to always disable sendfile.  [48]        -->
+  <!--                                                                      -->
+  <!--  For directory listing customization. Checks localXsltFile, then     -->
+  <!--  globalXsltFile, then defaults to original behavior.                 -->
+  <!--                                                                      -->
+  <!--   localXsltFile       Make directory listings an XML doc and         -->
+  <!--                       pass the result to this style sheet residing   -->
+  <!--                       in that directory. This overrides              -->
+  <!--                        globalXsltFile[null]                          -->
+  <!--                                                                      -->
+  <!--   globalXsltFile      Site wide configuration version of             -->
+  <!--                       localXsltFile This argument is expected        -->
+  <!--                       to be a physical file. [null]                  -->
+  <!--                                                                      -->
+  <!--                                                                      -->
+
+    <servlet>
+        <servlet-name>default</servlet-name>
+        <servlet-class>org.apache.catalina.servlets.DefaultServlet</servlet-class>
+        <init-param>
+            <param-name>debug</param-name>
+            <param-value>0</param-value>
+        </init-param>
+        <init-param>
+            <param-name>listings</param-name>
+            <param-value>false</param-value>
+        </init-param>
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+
+  <!-- The "invoker" servlet, which executes anonymous servlet classes      -->
+  <!-- that have not been defined in a web.xml file.  Traditionally, this   -->
+  <!-- servlet is mapped to the URL pattern "/servlet/*", but you can map   -->
+  <!-- it to other patterns as well.  The extra path info portion of such a -->
+  <!-- request must be the fully qualified class name of a Java class that  -->
+  <!-- implements Servlet (or extends HttpServlet), or the servlet name     -->
+  <!-- of an existing servlet definition.     This servlet supports the     -->
+  <!-- following initialization parameters (default values are in square    -->
+  <!-- brackets):                                                           -->
+  <!--                                                                      -->
+  <!--   debug               Debugging detail level for messages logged     -->
+  <!--                       by this servlet.  [0]                          -->
+
+<!--
+    <servlet>
+        <servlet-name>invoker</servlet-name>
+        <servlet-class>
+          org.apache.catalina.servlets.InvokerServlet
+        </servlet-class>
+        <init-param>
+            <param-name>debug</param-name>
+            <param-value>0</param-value>
+        </init-param>
+        <load-on-startup>2</load-on-startup>
+    </servlet>
+-->
+
+
+  <!-- The JSP page compiler and execution servlet, which is the mechanism  -->
+  <!-- used by Tomcat to support JSP pages.  Traditionally, this servlet    -->
+  <!-- is mapped to the URL pattern "*.jsp".  This servlet supports the     -->
+  <!-- following initialization parameters (default values are in square    -->
+  <!-- brackets):                                                           -->
+  <!--                                                                      -->
+  <!--   checkInterval       If development is false and checkInterval is   -->
+  <!--                       greater than zero, background compilations are -->
+  <!--                       enabled. checkInterval is the time in seconds  -->
+  <!--                       between checks to see if a JSP page needs to   -->
+  <!--                       be recompiled. [0]                             -->
+  <!--                                                                      -->
+  <!--   modificationTestInterval                                           -->
+  <!--                       Causes a JSP (and its dependent files) to not  -->
+  <!--                       be checked for modification during the         -->
+  <!--                       specified time interval (in seconds) from the  -->
+  <!--                       last time the JSP was checked for              -->
+  <!--                       modification. A value of 0 will cause the JSP  -->
+  <!--                       to be checked on every access.                 -->
+  <!--                       Used in development mode only. [4]             -->
+  <!--                                                                      -->
+  <!--   compiler            Which compiler Ant should use to compile JSP   -->
+  <!--                       pages.  See the Ant documentation for more     -->
+  <!--                       information. [javac]                           -->
+  <!--                                                                      -->
+  <!--   classdebuginfo      Should the class file be compiled with         -->
+  <!--                       debugging information?  [true]                 -->
+  <!--                                                                      -->
+  <!--   classpath           What class path should I use while compiling   -->
+  <!--                       generated servlets?  [Created dynamically      -->
+  <!--                       based on the current web application]          -->
+  <!--                                                                      -->
+  <!--   development         Is Jasper used in development mode? If true,   -->
+  <!--                       the frequency at which JSPs are checked for    -->
+  <!--                       modification may be specified via the          -->
+  <!--                       modificationTestInterval parameter. [true]     -->
+  <!--                                                                      -->
+  <!--   enablePooling       Determines whether tag handler pooling is      -->
+  <!--                       enabled  [true]                                -->
+  <!--                                                                      -->
+  <!--   fork                Tell Ant to fork compiles of JSP pages so that -->
+  <!--                       a separate JVM is used for JSP page compiles   -->
+  <!--                       from the one Tomcat is running in. [true]      -->
+  <!--                                                                      -->
+  <!--   ieClassId           The class-id value to be sent to Internet      -->
+  <!--                       Explorer when using <jsp:plugin> tags.         -->
+  <!--                       [clsid:8AD9C840-044E-11D1-B3E9-00805F499D93]   -->
+  <!--                                                                      -->
+  <!--   javaEncoding        Java file encoding to use for generating java  -->
+  <!--                       source files. [UTF8]                           -->
+  <!--                                                                      -->
+  <!--   keepgenerated       Should we keep the generated Java source code  -->
+  <!--                       for each page instead of deleting it? [true]   -->
+  <!--                                                                      -->
+  <!--   mappedfile          Should we generate static content with one     -->
+  <!--                       print statement per input line, to ease        -->
+  <!--                       debugging?  [true]                             -->
+  <!--                                                                      -->
+  <!--   trimSpaces          Should white spaces in template text between   -->
+  <!--                       actions or directives be trimmed?  [false]     -->
+  <!--                                                                      -->
+  <!--   suppressSmap        Should the generation of SMAP info for JSR45   -->
+  <!--                       debugging be suppressed?  [false]              -->
+  <!--                                                                      -->
+  <!--   dumpSmap            Should the SMAP info for JSR45 debugging be    -->
+  <!--                       dumped to a file? [false]                      -->
+  <!--                       False if suppressSmap is true                  -->
+  <!--                                                                      -->
+  <!--   genStrAsCharArray   Should text strings be generated as char       -->
+  <!--                       arrays, to improve performance in some cases?  -->
+  <!--                       [false]                                        -->
+  <!--                                                                      -->
+  <!--   errorOnUseBeanInvalidClassAttribute                                -->
+  <!--                       Should Jasper issue an error when the value of -->
+  <!--                       the class attribute in an useBean action is    -->
+  <!--                       not a valid bean class?  [true]                -->
+  <!--                                                                      -->
+  <!--   scratchdir          What scratch directory should we use when      -->
+  <!--                       compiling JSP pages?  [default work directory  -->
+  <!--                       for the current web application]               -->
+  <!--                                                                      -->
+  <!--   xpoweredBy          Determines whether X-Powered-By response       -->
+  <!--                       header is added by generated servlet  [false]  -->
+  <!--                                                                      -->
+  <!--   compilerTargetVM    Compiler target VM                             -->
+  <!--                       default is System.properties                   -->
+  <!--                        java.specification.version > 1.4              -->
+  <!--                        [1.5] else [1.4]                              -->
+  <!--                                                                      -->
+  <!--   compilerSourceVM    Compiler source VM                             -->
+  <!--                       default is System.properties                   -->
+  <!--                        java.specification.version > 1.4              -->
+  <!--                        [1.5] else [1.4]                              -->
+  <!--                                                                      -->
+  <!-- If you wish to use Jikes to compile JSP pages:                       -->
+  <!--   Please see the "Using Jikes" section of the Jasper-HowTo           -->
+  <!--   page in the Tomcat documentation.                                  -->
+
+    <servlet>
+        <servlet-name>jsp</servlet-name>
+        <servlet-class>org.apache.jasper.servlet.JspServlet</servlet-class>
+        <init-param>
+            <param-name>fork</param-name>
+            <param-value>false</param-value>
+        </init-param>
+        <init-param>
+            <param-name>xpoweredBy</param-name>
+            <param-value>false</param-value>
+        </init-param>
+        <load-on-startup>3</load-on-startup>
+    </servlet>
+
+
+  <!-- NOTE: An SSI Filter is also available as an alternative SSI          -->
+  <!-- implementation. Use either the Servlet or the Filter but NOT both.   -->
+  <!--                                                                      -->
+  <!-- Server Side Includes processing servlet, which processes SSI         -->
+  <!-- directives in HTML pages consistent with similar support in web      -->
+  <!-- servers like Apache.  Traditionally, this servlet is mapped to the   -->
+  <!-- URL pattern "*.shtml".  This servlet supports the following          -->
+  <!-- initialization parameters (default values are in square brackets):   -->
+  <!--                                                                      -->
+  <!--   buffered            Should output from this servlet be buffered?   -->
+  <!--                       (0=false, 1=true)  [0]                         -->
+  <!--                                                                      -->
+  <!--   debug               Debugging detail level for messages logged     -->
+  <!--                       by this servlet.  [0]                          -->
+  <!--                                                                      -->
+  <!--   expires             The number of seconds before a page with SSI   -->
+  <!--                       directives will expire.  [No default]          -->
+  <!--                                                                      -->
+  <!--   isVirtualWebappRelative                                            -->
+  <!--                       Should "virtual" paths be interpreted as       -->
+  <!--                       relative to the context root, instead of       -->
+  <!--                       the server root?  (0=false, 1=true) [0]        -->
+  <!--                                                                      -->
+  <!--   inputEncoding       The encoding to assume for SSI resources if    -->
+  <!--                       one is not available from the resource.        -->
+  <!--                       [Platform default]                             -->
+  <!--                                                                      -->
+  <!--   outputEncoding      The encoding to use for the page that results  -->
+  <!--                       from the SSI processing. [UTF-8]               -->
+  <!--                                                                      -->
+  <!--                                                                      -->
+  <!-- IMPORTANT: To use the SSI servlet, you also need to rename the       -->
+  <!--            $CATALINA_HOME/server/lib/servlets-ssi.renametojar file   -->
+  <!--            to $CATALINA_HOME/server/lib/servlets-ssi.jar             -->
+
+<!--
+    <servlet>
+        <servlet-name>ssi</servlet-name>
+        <servlet-class>
+          org.apache.catalina.ssi.SSIServlet
+        </servlet-class>
+        <init-param>
+          <param-name>buffered</param-name>
+          <param-value>1</param-value>
+        </init-param>
+        <init-param>
+          <param-name>debug</param-name>
+          <param-value>0</param-value>
+        </init-param>
+        <init-param>
+          <param-name>expires</param-name>
+          <param-value>666</param-value>
+        </init-param>
+        <init-param>
+          <param-name>isVirtualWebappRelative</param-name>
+          <param-value>0</param-value>
+        </init-param>
+        <load-on-startup>4</load-on-startup>
+    </servlet>
+-->
+
+
+  <!-- Common Gateway Includes (CGI) processing servlet, which supports     -->
+  <!-- execution of external applications that conform to the CGI spec      -->
+  <!-- requirements.  Typically, this servlet is mapped to the URL pattern  -->
+  <!-- "/cgi-bin/*", which means that any CGI applications that are         -->
+  <!-- executed must be present within the web application.  This servlet   -->
+  <!-- supports the following initialization parameters (default values     -->
+  <!-- are in square brackets):                                             -->
+  <!--                                                                      -->
+  <!--   cgiPathPrefix        The CGI search path will start at             -->
+  <!--                        webAppRootDir + File.separator + this prefix. -->
+  <!--                        [WEB-INF/cgi]                                 -->
+  <!--                                                                      -->
+  <!--   debug                Debugging detail level for messages logged    -->
+  <!--                        by this servlet.  [0]                         -->
+  <!--                                                                      -->
+  <!--   executable           Name of the exectuable used to run the        -->
+  <!--                        script. [perl]                                -->
+  <!--                                                                      -->
+  <!--   parameterEncoding    Name of parameter encoding to be used with    -->
+  <!--                        CGI servlet.                                  -->
+  <!--                        [System.getProperty("file.encoding","UTF-8")] -->
+  <!--                                                                      -->
+  <!--   passShellEnvironment Should the shell environment variables (if    -->
+  <!--                        any) be passed to the CGI script? [false]     -->
+  <!--                                                                      -->
+  <!-- IMPORTANT: To use the CGI servlet, you also need to rename the       -->
+  <!--            $CATALINA_HOME/server/lib/servlets-cgi.renametojar file   -->
+  <!--            to $CATALINA_HOME/server/lib/servlets-cgi.jar             -->
+
+<!--
+    <servlet>
+        <servlet-name>cgi</servlet-name>
+        <servlet-class>org.apache.catalina.servlets.CGIServlet</servlet-class>
+        <init-param>
+          <param-name>debug</param-name>
+          <param-value>0</param-value>
+        </init-param>
+        <init-param>
+          <param-name>cgiPathPrefix</param-name>
+          <param-value>WEB-INF/cgi</param-value>
+        </init-param>
+         <load-on-startup>5</load-on-startup>
+    </servlet>
+-->
+
+
+  <!-- ================ Built In Servlet Mappings ========================= -->
+
+
+  <!-- The servlet mappings for the built in servlets defined above.  Note  -->
+  <!-- that, by default, the CGI and SSI servlets are *not* mapped.  You    -->
+  <!-- must uncomment these mappings (or add them to your application's own -->
+  <!-- web.xml deployment descriptor) to enable these services              -->
+
+    <!-- The mapping for the default servlet -->
+    <servlet-mapping>
+        <servlet-name>default</servlet-name>
+        <url-pattern>/</url-pattern>
+    </servlet-mapping>
+
+    <!-- The mapping for the invoker servlet -->
+<!--
+    <servlet-mapping>
+        <servlet-name>invoker</servlet-name>
+        <url-pattern>/servlet/*</url-pattern>
+    </servlet-mapping>
+-->
+
+    <!-- The mapping for the JSP servlet -->
+    <servlet-mapping>
+        <servlet-name>jsp</servlet-name>
+        <url-pattern>*.jsp</url-pattern>
+    </servlet-mapping>
+
+    <servlet-mapping>
+        <servlet-name>jsp</servlet-name>
+        <url-pattern>*.jspx</url-pattern>
+    </servlet-mapping>
+
+    <!-- The mapping for the SSI servlet -->
+<!--
+    <servlet-mapping>
+        <servlet-name>ssi</servlet-name>
+        <url-pattern>*.shtml</url-pattern>
+    </servlet-mapping>
+-->
+
+    <!-- The mapping for the CGI Gateway servlet -->
+
+<!--
+    <servlet-mapping>
+        <servlet-name>cgi</servlet-name>
+        <url-pattern>/cgi-bin/*</url-pattern>
+    </servlet-mapping>
+-->
+
+
+  <!-- ================== Built In Filter Definitions ===================== -->
+
+  <!-- NOTE: An SSI Servlet is also available as an alternative SSI         -->
+  <!-- implementation. Use either the Servlet or the Filter but NOT both.   -->
+  <!--                                                                      -->
+  <!-- Server Side Includes processing filter, which processes SSI          -->
+  <!-- directives in HTML pages consistent with similar support in web      -->
+  <!-- servers like Apache.  Traditionally, this filter is mapped to the    -->
+  <!-- URL pattern "*.shtml", though it can be mapped to "*" as it will     -->
+  <!-- selectively enable/disable SSI processing based on mime types. For   -->
+  <!-- this to work you will need to uncomment the .shtml mime type         -->
+  <!-- definition towards the bottom of this file.                          -->
+  <!-- The contentType init param allows you to apply SSI processing to JSP -->
+  <!-- pages, javascript, or any other content you wish.  This filter       -->
+  <!-- supports the following initialization parameters (default values are -->
+  <!-- in square brackets):                                                 -->
+  <!--                                                                      -->
+  <!--   contentType         A regex pattern that must be matched before    -->
+  <!--                       SSI processing is applied.                     -->
+  <!--                       [text/x-server-parsed-html(;.*)?]              -->
+  <!--                                                                      -->
+  <!--   debug               Debugging detail level for messages logged     -->
+  <!--                       by this servlet.  [0]                          -->
+  <!--                                                                      -->
+  <!--   expires             The number of seconds before a page with SSI   -->
+  <!--                       directives will expire.  [No default]          -->
+  <!--                                                                      -->
+  <!--   isVirtualWebappRelative                                            -->
+  <!--                       Should "virtual" paths be interpreted as       -->
+  <!--                       relative to the context root, instead of       -->
+  <!--                       the server root?  (0=false, 1=true) [0]        -->
+  <!--                                                                      -->
+  <!--                                                                      -->
+  <!-- IMPORTANT: To use the SSI filter, you also need to rename the        -->
+  <!--            $CATALINA_HOME/server/lib/servlets-ssi.renametojar file   -->
+  <!--            to $CATALINA_HOME/server/lib/servlets-ssi.jar             -->
+
+<!--
+    <filter>
+        <filter-name>ssi</filter-name>
+        <filter-class>
+          org.apache.catalina.ssi.SSIFilter
+        </filter-class>
+        <init-param>
+          <param-name>contentType</param-name>
+          <param-value>text/x-server-parsed-html(;.*)?</param-value>
+        </init-param>
+        <init-param>
+          <param-name>debug</param-name>
+          <param-value>0</param-value>
+        </init-param>
+        <init-param>
+          <param-name>expires</param-name>
+          <param-value>666</param-value>
+        </init-param>
+        <init-param>
+          <param-name>isVirtualWebappRelative</param-name>
+          <param-value>0</param-value>
+        </init-param>
+    </filter>
+-->
+
+
+  <!-- ==================== Built In Filter Mappings ====================== -->
+
+  <!-- The mapping for the SSI Filter -->
+<!--
+    <filter-mapping>
+        <filter-name>ssi</filter-name>
+        <url-pattern>*.shtml</url-pattern>
+    </filter-mapping>
+-->
+
+
+  <!-- ==================== Default Session Configuration ================= -->
+  <!-- You can set the default session timeout (in minutes) for all newly   -->
+  <!-- created sessions by modifying the value below.                       -->
+
+    <session-config>
+        <session-timeout>30</session-timeout>
+    </session-config>
+
+
+  <!-- ===================== Default MIME Type Mappings =================== -->
+  <!-- When serving static resources, Tomcat will automatically generate    -->
+  <!-- a "Content-Type" header based on the resource's filename extension,  -->
+  <!-- based on these mappings.  Additional mappings can be added here (to  -->
+  <!-- apply to all web applications), or in your own application's web.xml -->
+  <!-- deployment descriptor.                                               -->
+
+    <mime-mapping>
+        <extension>abs</extension>
+        <mime-type>audio/x-mpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ai</extension>
+        <mime-type>application/postscript</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>aif</extension>
+        <mime-type>audio/x-aiff</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>aifc</extension>
+        <mime-type>audio/x-aiff</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>aiff</extension>
+        <mime-type>audio/x-aiff</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>aim</extension>
+        <mime-type>application/x-aim</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>art</extension>
+        <mime-type>image/x-jg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>asf</extension>
+        <mime-type>video/x-ms-asf</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>asx</extension>
+        <mime-type>video/x-ms-asf</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>au</extension>
+        <mime-type>audio/basic</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>avi</extension>
+        <mime-type>video/x-msvideo</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>avx</extension>
+        <mime-type>video/x-rad-screenplay</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>bcpio</extension>
+        <mime-type>application/x-bcpio</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>bin</extension>
+        <mime-type>application/octet-stream</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>bmp</extension>
+        <mime-type>image/bmp</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>body</extension>
+        <mime-type>text/html</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>cdf</extension>
+        <mime-type>application/x-netcdf</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>cer</extension>
+        <mime-type>application/x-x509-ca-cert</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>class</extension>
+        <mime-type>application/java</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>cpio</extension>
+        <mime-type>application/x-cpio</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>csh</extension>
+        <mime-type>application/x-csh</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>css</extension>
+        <mime-type>text/css</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>dib</extension>
+        <mime-type>image/bmp</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>doc</extension>
+        <mime-type>application/msword</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>dtd</extension>
+        <mime-type>application/xml-dtd</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>dv</extension>
+        <mime-type>video/x-dv</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>dvi</extension>
+        <mime-type>application/x-dvi</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>eps</extension>
+        <mime-type>application/postscript</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>etx</extension>
+        <mime-type>text/x-setext</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>exe</extension>
+        <mime-type>application/octet-stream</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>gif</extension>
+        <mime-type>image/gif</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>gtar</extension>
+        <mime-type>application/x-gtar</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>gz</extension>
+        <mime-type>application/x-gzip</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>hdf</extension>
+        <mime-type>application/x-hdf</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>htc</extension>
+        <mime-type>text/x-component</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>htm</extension>
+        <mime-type>text/html</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>html</extension>
+        <mime-type>text/html</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>hqx</extension>
+        <mime-type>application/mac-binhex40</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ico</extension>
+        <mime-type>image/x-icon</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ief</extension>
+        <mime-type>image/ief</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>jad</extension>
+        <mime-type>text/vnd.sun.j2me.app-descriptor</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>jar</extension>
+        <mime-type>application/java-archive</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>java</extension>
+        <mime-type>text/plain</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>jnlp</extension>
+        <mime-type>application/x-java-jnlp-file</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>jpe</extension>
+        <mime-type>image/jpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>jpeg</extension>
+        <mime-type>image/jpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>jpg</extension>
+        <mime-type>image/jpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>js</extension>
+        <mime-type>text/javascript</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>jsf</extension>
+        <mime-type>text/plain</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>jspf</extension>
+        <mime-type>text/plain</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>kar</extension>
+        <mime-type>audio/midi</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>latex</extension>
+        <mime-type>application/x-latex</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>m3u</extension>
+        <mime-type>audio/x-mpegurl</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mac</extension>
+        <mime-type>image/x-macpaint</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>man</extension>
+        <mime-type>application/x-troff-man</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mathml</extension>
+        <mime-type>application/mathml+xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>me</extension>
+        <mime-type>application/x-troff-me</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mid</extension>
+        <mime-type>audio/midi</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>midi</extension>
+        <mime-type>audio/midi</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mif</extension>
+        <mime-type>application/vnd.mif</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mov</extension>
+        <mime-type>video/quicktime</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>movie</extension>
+        <mime-type>video/x-sgi-movie</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mp1</extension>
+        <mime-type>audio/x-mpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mp2</extension>
+        <mime-type>audio/mpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mp3</extension>
+        <mime-type>audio/mpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mpa</extension>
+        <mime-type>audio/x-mpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mpe</extension>
+        <mime-type>video/mpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mpeg</extension>
+        <mime-type>video/mpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mpega</extension>
+        <mime-type>audio/x-mpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mpg</extension>
+        <mime-type>video/mpeg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>mpv2</extension>
+        <mime-type>video/mpeg2</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ms</extension>
+        <mime-type>application/x-troff-ms</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>nc</extension>
+        <mime-type>application/x-netcdf</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>oda</extension>
+        <mime-type>application/oda</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Database -->
+        <extension>odb</extension>
+        <mime-type>application/vnd.oasis.opendocument.database</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Chart -->
+        <extension>odc</extension>
+        <mime-type>application/vnd.oasis.opendocument.chart</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Formula -->
+        <extension>odf</extension>
+        <mime-type>application/vnd.oasis.opendocument.formula</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Drawing -->
+        <extension>odg</extension>
+        <mime-type>application/vnd.oasis.opendocument.graphics</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Image -->
+        <extension>odi</extension>
+        <mime-type>application/vnd.oasis.opendocument.image</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Master Document -->
+        <extension>odm</extension>
+        <mime-type>application/vnd.oasis.opendocument.text-master</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Presentation -->
+        <extension>odp</extension>
+        <mime-type>application/vnd.oasis.opendocument.presentation</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Spreadsheet -->
+        <extension>ods</extension>
+        <mime-type>application/vnd.oasis.opendocument.spreadsheet</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Text -->
+        <extension>odt</extension>
+        <mime-type>application/vnd.oasis.opendocument.text</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ogg</extension>
+        <mime-type>application/ogg</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Drawing Template -->
+        <extension>otg </extension>
+        <mime-type>application/vnd.oasis.opendocument.graphics-template</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- HTML Document Template -->
+        <extension>oth</extension>
+        <mime-type>application/vnd.oasis.opendocument.text-web</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Presentation Template -->
+        <extension>otp</extension>
+        <mime-type>application/vnd.oasis.opendocument.presentation-template</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Spreadsheet Template -->
+        <extension>ots</extension>
+        <mime-type>application/vnd.oasis.opendocument.spreadsheet-template </mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- OpenDocument Text Template -->
+        <extension>ott</extension>
+        <mime-type>application/vnd.oasis.opendocument.text-template</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>pbm</extension>
+        <mime-type>image/x-portable-bitmap</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>pct</extension>
+        <mime-type>image/pict</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>pdf</extension>
+        <mime-type>application/pdf</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>pgm</extension>
+        <mime-type>image/x-portable-graymap</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>pic</extension>
+        <mime-type>image/pict</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>pict</extension>
+        <mime-type>image/pict</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>pls</extension>
+        <mime-type>audio/x-scpls</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>png</extension>
+        <mime-type>image/png</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>pnm</extension>
+        <mime-type>image/x-portable-anymap</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>pnt</extension>
+        <mime-type>image/x-macpaint</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ppm</extension>
+        <mime-type>image/x-portable-pixmap</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>pps</extension>
+        <mime-type>application/vnd.ms-powerpoint</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ppt</extension>
+        <mime-type>application/vnd.ms-powerpoint</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ps</extension>
+        <mime-type>application/postscript</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>psd</extension>
+        <mime-type>image/x-photoshop</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>qt</extension>
+        <mime-type>video/quicktime</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>qti</extension>
+        <mime-type>image/x-quicktime</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>qtif</extension>
+        <mime-type>image/x-quicktime</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ras</extension>
+        <mime-type>image/x-cmu-raster</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>rdf</extension>
+        <mime-type>application/rdf+xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>rgb</extension>
+        <mime-type>image/x-rgb</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>rm</extension>
+        <mime-type>application/vnd.rn-realmedia</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>roff</extension>
+        <mime-type>application/x-troff</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>rtf</extension>
+        <mime-type>text/rtf</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>rtx</extension>
+        <mime-type>text/richtext</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>sh</extension>
+        <mime-type>application/x-sh</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>shar</extension>
+        <mime-type>application/x-shar</mime-type>
+    </mime-mapping>
+<!--
+    <mime-mapping>
+        <extension>shtml</extension>
+        <mime-type>text/x-server-parsed-html</mime-type>
+    </mime-mapping>
+-->
+    <mime-mapping>
+        <extension>smf</extension>
+        <mime-type>audio/x-midi</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>sit</extension>
+        <mime-type>application/x-stuffit</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>snd</extension>
+        <mime-type>audio/basic</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>src</extension>
+        <mime-type>application/x-wais-source</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>sv4cpio</extension>
+        <mime-type>application/x-sv4cpio</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>sv4crc</extension>
+        <mime-type>application/x-sv4crc</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>svg</extension>
+        <mime-type>image/svg+xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>svgz</extension>
+        <mime-type>image/svg+xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>swf</extension>
+        <mime-type>application/x-shockwave-flash</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>t</extension>
+        <mime-type>application/x-troff</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>tar</extension>
+        <mime-type>application/x-tar</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>tcl</extension>
+        <mime-type>application/x-tcl</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>tex</extension>
+        <mime-type>application/x-tex</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>texi</extension>
+        <mime-type>application/x-texinfo</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>texinfo</extension>
+        <mime-type>application/x-texinfo</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>tif</extension>
+        <mime-type>image/tiff</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>tiff</extension>
+        <mime-type>image/tiff</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>tr</extension>
+        <mime-type>application/x-troff</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>tsv</extension>
+        <mime-type>text/tab-separated-values</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>txt</extension>
+        <mime-type>text/plain</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ulw</extension>
+        <mime-type>audio/basic</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>ustar</extension>
+        <mime-type>application/x-ustar</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>vrml</extension>
+        <mime-type>model/vrml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>vsd</extension>
+        <mime-type>application/x-visio</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>vxml</extension>
+        <mime-type>application/voicexml+xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>wav</extension>
+        <mime-type>audio/x-wav</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- Wireless Bitmap -->
+        <extension>wbmp</extension>
+        <mime-type>image/vnd.wap.wbmp</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- WML Source -->
+        <extension>wml</extension>
+        <mime-type>text/vnd.wap.wml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- Compiled WML -->
+        <extension>wmlc</extension>
+        <mime-type>application/vnd.wap.wmlc</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- WML Script Source -->
+        <extension>wmls</extension>
+        <mime-type>text/vnd.wap.wmlscript</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <!-- Compiled WML Script -->
+        <extension>wmlscriptc</extension>
+        <mime-type>application/vnd.wap.wmlscriptc</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>wrl</extension>
+        <mime-type>model/vrml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>xbm</extension>
+        <mime-type>image/x-xbitmap</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>xht</extension>
+        <mime-type>application/xhtml+xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>xhtml</extension>
+        <mime-type>application/xhtml+xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>xls</extension>
+        <mime-type>application/vnd.ms-excel</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>xml</extension>
+        <mime-type>application/xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>xpm</extension>
+        <mime-type>image/x-xpixmap</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>xsl</extension>
+        <mime-type>application/xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>xslt</extension>
+        <mime-type>application/xslt+xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>xul</extension>
+        <mime-type>application/vnd.mozilla.xul+xml</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>xwd</extension>
+        <mime-type>image/x-xwindowdump</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>Z</extension>
+        <mime-type>application/x-compress</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>z</extension>
+        <mime-type>application/x-compress</mime-type>
+    </mime-mapping>
+    <mime-mapping>
+        <extension>zip</extension>
+        <mime-type>application/zip</mime-type>
+    </mime-mapping>
+
+  <!-- ==================== Default Welcome File List ===================== -->
+  <!-- When a request URI refers to a directory, the default servlet looks  -->
+  <!-- for a "welcome file" within that directory and, if present,          -->
+  <!-- to the corresponding resource URI for display.  If no welcome file   -->
+  <!-- is present, the default servlet either serves a directory listing,   -->
+  <!-- or returns a 404 status, depending on how it is configured.          -->
+  <!--                                                                      -->
+  <!-- If you define welcome files in your own application's web.xml        -->
+  <!-- deployment descriptor, that list *replaces* the list configured      -->
+  <!-- here, so be sure that you include any of the default values that     -->
+  <!-- you wish to include.                                                 -->
+
+    <welcome-file-list>
+        <welcome-file>index.html</welcome-file>
+        <welcome-file>index.htm</welcome-file>
+        <welcome-file>index.jsp</welcome-file>
+    </welcome-file-list>
+
+</web-app>
\ No newline at end of file

Added: trunk/esb/java/modules/distribution/src/main/conf/web.xml
==============================================================================
--- (empty file)
+++ trunk/esb/java/modules/distribution/src/main/conf/web.xml	Mon Aug  6 08:29:40 2007
@@ -0,0 +1,74 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  ~ Copyright 2005-2007 WSO2, Inc. (http://wso2.com)
+  ~
+  ~ 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.
+  -->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems,
+Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
+
+<web-app>
+
+    <display-name>WSO2 ESB</display-name>
+
+    <!--<filter>-->
+        <!--<filter-name>ESBRequestRedirectionFilter</filter-name>-->
+        <!--<filter-class>org.wso2.esb.transport.tomcat.RequestRedirectionFilter</filter-class>-->
+    <!--</filter>-->
+
+    <filter>
+        <filter-name>AdminFilter</filter-name>
+        <filter-class>org.wso2.adminui.AdminUIServletFilter</filter-class>
+    </filter>
+
+
+    <filter-mapping>
+        <filter-name>AdminFilter</filter-name>
+        <url-pattern>/*</url-pattern>
+    </filter-mapping>
+
+    <!--<filter-mapping>-->
+        <!--<filter-name>ESBRequestRedirectionFilter</filter-name>-->
+        <!--<url-pattern>/*</url-pattern>-->
+    <!--</filter-mapping>-->
+
+    <servlet>
+        <servlet-name>ESBStartUpServlet</servlet-name>
+        <servlet-class>org.wso2.esb.transport.tomcat.StartUpServlet</servlet-class>
+        <!-- esb.home parameter must have set if esb is going to deploy in the exsiting tomcat
+         The value must contains the absolute path to the esb home  -->
+        <!--<init-param>-->
+            <!--<param-name>esb.home</param-name>-->
+            <!--<param-value>@esb.home@</param-value>-->
+        <!--</init-param>-->
+        <load-on-startup>1</load-on-startup>
+    </servlet>
+
+    <servlet>
+        <servlet-name>ESBAXISServlet</servlet-name>
+        <servlet-class>org.wso2.esb.transport.tomcat.ESBServlet</servlet-class>
+    </servlet>
+
+    <servlet-mapping>
+        <servlet-name>ESBAXISServlet</servlet-name>
+        <url-pattern>/soap/*</url-pattern>
+    </servlet-mapping>
+
+    <session-config>
+        <!-- 30 minutes -->
+        <session-timeout>30</session-timeout>
+    </session-config>
+
+
+</web-app>
\ No newline at end of file

Modified: trunk/esb/java/modules/distribution/src/main/conf/wrapper.conf
==============================================================================
--- trunk/esb/java/modules/distribution/src/main/conf/wrapper.conf	(original)
+++ trunk/esb/java/modules/distribution/src/main/conf/wrapper.conf	Mon Aug  6 08:29:40 2007
@@ -13,23 +13,28 @@
 # Java Classpath (include wrapper.jar)  Add class path elements as
 #  needed starting from 1
 wrapper.java.classpath.1=%CLASSPATH%
-wrapper.java.classpath.2=./lib/wrapper.jar
-wrapper.java.classpath.3=./lib
-wrapper.java.classpath.4=./lib/*.jar
-wrapper.java.classpath.5=./conf
+wrapper.java.classpath.2=./webapp/WEB-INF/lib/wrapper.jar
+wrapper.java.classpath.3=./webapp/WEB-INF/lib
+wrapper.java.classpath.4=./webapp/WEB-INF/lib/*.jar
+wrapper.java.classpath.5=./tomcat/lib
+wrapper.java.classpath.6=./tomcat/lib/*.jar
+wrapper.java.classpath.7=./webapp/WEB-INF/classes/conf
 # Java Library Path (location of Wrapper.DLL or libwrapper.so)
-wrapper.java.library.path.1=./lib
+wrapper.java.library.path.1=./webapp/WEB-INF/lib
+wrapper.java.library.path.2=./tomcat/lib
 
 # Java Additional Parameters
-wrapper.java.additional.1=-Desb.xml="./conf/server.xml"
-wrapper.java.additional.2=-Dsynapse.xml="./conf/synapse.xml"
-wrapper.java.additional.3=-Daxis2.xml="./conf/axis2.xml"
+wrapper.java.additional.1=-Desb.xml="./webapp/WEB-INF/classes/conf/server.xml"
+wrapper.java.additional.2=-Dsynapse.xml="./webapp/WEB-INF/classes/conf/synapse.xml"
+wrapper.java.additional.3=-Daxis2.xml="./webapp/WEB-INF/classes/conf/axis2.xml"
 wrapper.java.additional.4=-Daxis2.repo="./repository"
-wrapper.java.additional.5=-Djava.endorsed.dirs="./lib/endorsed" 
+wrapper.java.additional.5=-Djava.endorsed.dirs="../tomcat/lib/endorsed"
 wrapper.java.additional.6=-Desb.home="."
-wrapper.java.additional.7=-Dserver-web.xml="./conf/server-web.xml"
-wrapper.java.additional.8=-Dmime-mappings.xml="./conf/mime-mappings.xml"
+wrapper.java.additional.7=-Dserver-web.xml="./webapp/WEB-INF/classes/conf/server-web.xml"
+wrapper.java.additional.8=-Dmime-mappings.xml="./webapp/WEB-INF/classes/conf/mime-mappings.xml"
 wrapper.java.additional.9=-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XMLGrammarCachingConfiguration
+wrapper.java.additional.10=-Dlog4j.configuration="file:./webapp/WEB-INF/classes/conf/log4j.properties"
+
 # Initial Java Heap Size (in MB)
 #wrapper.java.initmemory=3
 
@@ -37,7 +42,7 @@
 #wrapper.java.maxmemory=64
 
 # Application parameters.  Add parameters as needed starting from 1
-wrapper.app.parameter.1=org.wso2.esb.ServiceBus
+wrapper.app.parameter.1=org.wso2.esb.Main
 wrapper.app.parameter.2=START
 #wrapper.app.parameter.3=-sample=8
 

Modified: trunk/esb/java/modules/distribution/src/main/conf/wso2esb.hibernate.cfg.xml
==============================================================================
--- trunk/esb/java/modules/distribution/src/main/conf/wso2esb.hibernate.cfg.xml	(original)
+++ trunk/esb/java/modules/distribution/src/main/conf/wso2esb.hibernate.cfg.xml	Mon Aug  6 08:29:40 2007
@@ -7,7 +7,7 @@
     <session-factory>
         <!-- Settings for a Derby Network Server database. -->
         <property name="connection.url">
-            jdbc:derby://localhost:1528/../database/WSO2ESB_DATABASE;create=true</property>
+            jdbc:derby://localhost:1528/../../../../database/WSO2ESB_DATABASE;create=true</property>
         <property name="connection.driver_class">org.apache.derby.jdbc.ClientDriver</property>
         <property name="connection.username">wso2esb</property>
         <property name="connection.password">wso2esb</property>
@@ -28,8 +28,8 @@
         <property name="show_sql">false</property>
 
         <!-- mapping files -->
-        <mapping resource="statistics.hbm.xml"/>
-        <mapping resource="reg-meta-data.hbm.xml"/>
+        <mapping resource="conf/statistics.hbm.xml"/>
+        <mapping resource="conf/reg-meta-data.hbm.xml"/>
         <!--<mapping name="org.wso2.esb.statistics.persistence.hibernate.bean.StatisticsDO" />-->
 
     </session-factory>

Modified: trunk/esb/java/modules/samples/services/FastStockQuoteService/build.xml
==============================================================================
--- trunk/esb/java/modules/samples/services/FastStockQuoteService/build.xml	(original)
+++ trunk/esb/java/modules/samples/services/FastStockQuoteService/build.xml	Mon Aug  6 08:29:40 2007
@@ -20,7 +20,7 @@
 <project default="build-service">
 
     <property name="synapse.home" value="../../../.."/>
-    <property name="lib" value="${synapse.home}/lib"/>
+    <property name="lib" value="${synapse.home}/webapp/WEB-INF/lib"/>
     <property name="temp.dir" value="temp"/>
     <property name="classes" value="${temp.dir}/classes"/>
     <property name="src" value="src"/>
@@ -29,7 +29,7 @@
     <path id="synapse.class.path">
         <pathelement path="${java.class.path}"/>
         <fileset dir="${synapse.home}">
-            <include name="lib/*.jar"/>
+            <include name="webapp/WEB-INF/lib/*.jar"/>
         </fileset>
     </path>
 

Modified: trunk/esb/java/modules/samples/services/LoadbalanceFailoverService/build.xml
==============================================================================
--- trunk/esb/java/modules/samples/services/LoadbalanceFailoverService/build.xml	(original)
+++ trunk/esb/java/modules/samples/services/LoadbalanceFailoverService/build.xml	Mon Aug  6 08:29:40 2007
@@ -20,7 +20,7 @@
 <project default="build-services">
 
     <property name="synapse.home" value="../../../.."/>
-    <property name="lib" value="${synapse.home}/lib"/>
+    <property name="lib" value="${synapse.home}/webapp/WEB-INF/lib"/>
     <property name="temp.dir" value="temp"/>
     <property name="services" value="../../repository/services"/>
     <property name="classes" value="${temp.dir}/classes"/>
@@ -29,7 +29,7 @@
     <path id="synapse.class.path">
         <pathelement path="${java.class.path}"/>
         <fileset dir="${synapse.home}">
-            <include name="lib/*.jar"/>
+            <include name="webapp/WEB-INF/lib/*.jar"/>
         </fileset>
     </path>
 

Modified: trunk/esb/java/modules/samples/services/MTOMSwASampleService/build.xml
==============================================================================
--- trunk/esb/java/modules/samples/services/MTOMSwASampleService/build.xml	(original)
+++ trunk/esb/java/modules/samples/services/MTOMSwASampleService/build.xml	Mon Aug  6 08:29:40 2007
@@ -20,7 +20,7 @@
 <project default="build-service">
 
     <property name="synapse.home" value="../../../.."/>
-    <property name="lib" value="${synapse.home}/lib"/>
+    <property name="lib" value="${synapse.home}/webapp/WEB-INF/lib"/>
     <property name="temp.dir" value="temp"/>
     <property name="classes" value="${temp.dir}/classes"/>
     <property name="src" value="src"/>
@@ -29,7 +29,7 @@
     <path id="synapse.class.path">
         <pathelement path="${java.class.path}"/>
         <fileset dir="${synapse.home}">
-            <include name="lib/*.jar"/>
+            <include name="webapp/WEB-INF/lib/*.jar"/>
         </fileset>
     </path>
 

Modified: trunk/esb/java/modules/samples/services/ReliableStockQuoteService/build.xml
==============================================================================
--- trunk/esb/java/modules/samples/services/ReliableStockQuoteService/build.xml	(original)
+++ trunk/esb/java/modules/samples/services/ReliableStockQuoteService/build.xml	Mon Aug  6 08:29:40 2007
@@ -20,7 +20,7 @@
 <project default="build-service">
 
     <property name="esb.home" value="../../../.."/>
-    <property name="lib" value="${esb.home}/lib"/>
+    <property name="lib" value="${esb.home}/webapp/WEB-INF/lib"/>
     <property name="temp.dir" value="temp"/>
     <property name="classes" value="${temp.dir}/classes"/>
     <property name="src" value="src"/>
@@ -29,7 +29,7 @@
     <path id="esb.class.path">
         <pathelement path="${java.class.path}"/>
         <fileset dir="${esb.home}">
-            <include name="lib/*.jar"/>
+            <include name="webapp/WEB-INF/lib/*.jar"/>
         </fileset>
     </path>
 

Modified: trunk/esb/java/modules/samples/services/SecureStockQuoteService/build.xml
==============================================================================
--- trunk/esb/java/modules/samples/services/SecureStockQuoteService/build.xml	(original)
+++ trunk/esb/java/modules/samples/services/SecureStockQuoteService/build.xml	Mon Aug  6 08:29:40 2007
@@ -20,7 +20,7 @@
 <project default="build-service">
 
     <property name="synapse.home" value="../../../.."/>
-    <property name="lib" value="${synapse.home}/lib"/>
+    <property name="lib" value="${synapse.home}/webapp/WEB-INF/lib"/>
     <property name="temp.dir" value="temp"/>
     <property name="classes" value="${temp.dir}/classes"/>
     <property name="src" value="src"/>
@@ -29,7 +29,7 @@
     <path id="synapse.class.path">
         <pathelement path="${java.class.path}"/>
         <fileset dir="${synapse.home}">
-            <include name="lib/*.jar"/>
+            <include name="webapp/WEB-INF/lib/*.jar"/>
         </fileset>
     </path>
 

Modified: trunk/esb/java/modules/samples/services/SimpleStockQuoteService/build.xml
==============================================================================
--- trunk/esb/java/modules/samples/services/SimpleStockQuoteService/build.xml	(original)
+++ trunk/esb/java/modules/samples/services/SimpleStockQuoteService/build.xml	Mon Aug  6 08:29:40 2007
@@ -20,7 +20,7 @@
 <project default="build-service">
 
     <property name="synapse.home" value="../../../.."/>
-    <property name="lib" value="${synapse.home}/lib"/>
+    <property name="lib" value="${synapse.home}/webapp/WEB-INF/lib"/>
     <property name="temp.dir" value="temp"/>
     <property name="classes" value="${temp.dir}/classes"/>
     <property name="src" value="src"/>
@@ -29,7 +29,7 @@
     <path id="synapse.class.path">
         <pathelement path="${java.class.path}"/>
         <fileset dir="${synapse.home}">
-            <include name="lib/*.jar"/>
+            <include name="webapp/WEB-INF/lib/*.jar"/>
         </fileset>
     </path>
 

Modified: trunk/esb/java/modules/samples/src/main/scripts/axis2server.bat
==============================================================================
--- trunk/esb/java/modules/samples/src/main/scripts/axis2server.bat	(original)
+++ trunk/esb/java/modules/samples/src/main/scripts/axis2server.bat	Mon Aug  6 08:29:40 2007
@@ -88,25 +88,25 @@
 :runAxis2
 rem set the classes by looping through the libs
 setlocal EnableDelayedExpansion
-set AXIS2_CLASS_PATH=%AXIS2_HOME%/../../lib;%AXIS2_HOME%/../../repository/conf
-FOR %%c in ("%AXIS2_HOME%\..\..\lib\*.jar") DO set AXIS2_CLASS_PATH=!AXIS2_CLASS_PATH!;%%c
+set AXIS2_CLASS_PATH=%AXIS2_HOME%/../../webapp/WEB-INF/lib;%AXIS2_HOME%/../../repository/conf
+FOR %%c in ("%AXIS2_HOME%\..\..\webapp\WEB-INF\lib\*.jar") DO set AXIS2_CLASS_PATH=!AXIS2_CLASS_PATH!;%%c
 
 rem use proper bouncy castle version for the JDK
 
 "%JAVA_HOME%\bin\java" -version 2>&1 | findstr "1.4" >NUL
 IF ERRORLEVEL 1 goto checkJdk15
 echo  Using Bouncy castle JAR for Java 1.4
-FOR %%C in ("%AXIS2_HOME%\..\..\lib\bcprov-jdk13*.jar") DO set AXIS2_CLASS_PATH="%%~fC";!AXIS2_CLASS_PATH!
+FOR %%C in ("%AXIS2_HOME%\..\..\webapp\WEB-INF\lib\bcprov-jdk13*.jar") DO set AXIS2_CLASS_PATH="%%~fC";!AXIS2_CLASS_PATH!
 goto runServer
 
 :checkJdk15
 "%JAVA_HOME%\bin\java" -version 2>&1 | findstr "1.5" >NUL
 IF ERRORLEVEL 1 goto runServer
 echo  Using Bouncy castle JAR for Java 1.5
-FOR %%C in ("%AXIS2_HOME%\..\..\lib\bcprov-jdk15*.jar") DO set AXIS2_CLASS_PATH="%%~fC";!AXIS2_CLASS_PATH!
+FOR %%C in ("%AXIS2_HOME%\..\..\webapp\WEB-INF\lib\bcprov-jdk15*.jar") DO set AXIS2_CLASS_PATH="%%~fC";!AXIS2_CLASS_PATH!
 
 :runServer
-set AXIS2_ENDORSED=%AXIS2_HOME%\..\..\lib\endorsed
+set AXIS2_ENDORSED=%AXIS2_HOME%\..\..\tomcat\lib\endorsed
 echo Using JAVA_HOME    %JAVA_HOME%
 echo Using AXIS2_HOME   %AXIS2_HOME%
 

Modified: trunk/esb/java/modules/samples/src/main/scripts/axis2server.sh
==============================================================================
--- trunk/esb/java/modules/samples/src/main/scripts/axis2server.sh	(original)
+++ trunk/esb/java/modules/samples/src/main/scripts/axis2server.sh	Mon Aug  6 08:29:40 2007
@@ -80,8 +80,8 @@
 fi
 
 # update classpath
-AXIS2_CLASSPATH="$AXIS2_HOME/../../lib"
-for f in "$AXIS2_HOME"/../../lib/*.jar
+AXIS2_CLASSPATH="$AXIS2_HOME/../../webapp/WEB-INF/lib"
+for f in "$AXIS2_HOME"/../../webapp/WEB-INF/lib/*.jar
 do
   AXIS2_CLASSPATH="$AXIS2_CLASSPATH":$f
 done
@@ -93,13 +93,13 @@
 
 if [ "$jdk_15" ]; then
     echo " Using Bouncy castle JAR for Java 1.5"
-    for f in $AXIS2_HOME/../../lib/bcprov-jdk15*.jar
+    for f in $AXIS2_HOME/../../webapp/WEB-INF/lib/bcprov-jdk15*.jar
     do
       AXIS2_CLASSPATH=$f:$AXIS2_CLASSPATH
     done
 elif [ "$jdk_14" ]; then
     echo " Using Bouncy castle JAR for Java 1.4"
-    for f in $AXIS2_HOME/../../lib/bcprov-jdk13*.jar
+    for f in $AXIS2_HOME/../../webapp/WEB-INF/lib/bcprov-jdk13*.jar
     do
       AXIS2_CLASSPATH=$f:$AXIS2_CLASSPATH
     done

Modified: trunk/esb/java/modules/samples/src/main/scripts/build.xml
==============================================================================
--- trunk/esb/java/modules/samples/src/main/scripts/build.xml	(original)
+++ trunk/esb/java/modules/samples/src/main/scripts/build.xml	Mon Aug  6 08:29:40 2007
@@ -100,7 +100,7 @@
             <sysproperty key="policy" value="${policy}"/>
             <sysproperty key="rest" value="${rest}"/>
             <sysproperty key="wsrm" value="${wsrm}"/>
-            <sysproperty key="javax.net.ssl.trustStore" value="./../../lib/trust.jks"/>
+            <sysproperty key="javax.net.ssl.trustStore" value="./../../webapp/WEB-INF/lib/trust.jks"/>
             <sysproperty key="javax.net.ssl.trustStorePassword" value="password"/>
             <!--
             <jvmarg value="-Xdebug"/>
@@ -137,7 +137,7 @@
             <sysproperty key="opt_mode" value="${opt_mode}"/>
             <sysproperty key="opt_url"  value="${opt_url}"/>
             <sysproperty key="opt_file" value="${opt_file}"/>
-            <sysproperty key="javax.net.ssl.trustStore" value="./../../lib/trust.jks"/>
+            <sysproperty key="javax.net.ssl.trustStore" value="./../../webapp/WEB-INF/lib/trust.jks"/>
             <sysproperty key="javax.net.ssl.trustStorePassword" value="password"/>
             <!--
             <jvmarg value="-Xdebug"/>
@@ -174,8 +174,8 @@
         <mkdir dir="${class.dir}"/>
         <path id="javac.classpath">
             <pathelement path="${class.dir}"/>
-            <pathelement path="../../lib"/>
-            <fileset dir="../../lib">
+            <pathelement path="../../webapp/WEB-INF/lib"/>
+            <fileset dir="../../webapp/WEB-INF/lib">
                 <include name="**/*.jar"/>
             </fileset>
         </path>
@@ -187,4 +187,4 @@
         </javac>
     </target>
 
-</project>
+</project>
\ No newline at end of file

Modified: trunk/esb/java/pom.xml
==============================================================================
--- trunk/esb/java/pom.xml	(original)
+++ trunk/esb/java/pom.xml	Mon Aug  6 08:29:40 2007
@@ -167,7 +167,7 @@
             <name>Ibiblio Maven 2 Repo</name>
             <url>http://www.ibiblio.org/maven2</url>
             <releases>
-            	<updatePolicy>never</updatePolicy>
+                <updatePolicy>never</updatePolicy>
             </releases>
             <snapshots>
                 <enabled>false</enabled>
@@ -178,7 +178,7 @@
             <name>Apache Maven 2 Snapshot Repository</name>
             <url>http://people.apache.org/repo/m2-snapshot-repository/</url>
             <releases>
-            	<updatePolicy>never</updatePolicy>
+                <updatePolicy>never</updatePolicy>
             </releases>
             <snapshots>
                 <updatePolicy>interval:60</updatePolicy>
@@ -189,7 +189,7 @@
             <name>WSO2 Maven 2 Repository</name>
             <url>http://dist.wso2.org/maven2/</url>
             <releases>
-            	<updatePolicy>never</updatePolicy>
+                <updatePolicy>never</updatePolicy>
             </releases>
             <snapshots>
                 <updatePolicy>daily</updatePolicy>
@@ -231,7 +231,7 @@
                 <artifactId>axiom-dom</artifactId>
                 <version>${axiom.version}</version>
             </dependency>
-            
+
             <dependency>
                 <groupId>org.apache.neethi</groupId>
                 <artifactId>neethi</artifactId>
@@ -286,7 +286,27 @@
                     <groupId>org.apache.axis2</groupId>
                     <artifactId>axis2</artifactId>
                 </exclusion>
-            </exclusions>            
+                <exclusion>
+                    <groupId>org.mortbay.jetty</groupId>
+                    <artifactId>jetty</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.mortbay.jetty</groupId>
+                    <artifactId>jetty-util</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.mortbay.jetty</groupId>
+                    <artifactId>servlet-api</artifactId>
+                </exclusion>
+                <exclusion>
+                    <groupId>org.mortbay.jetty</groupId>
+                    <artifactId>servlet-api</artifactId>
+                 </exclusion>
+                <exclusion>
+                    <groupId>org.slf4j</groupId>
+                    <artifactId>slf4j-log4j12</artifactId>
+                 </exclusion>
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.wso2.statistics</groupId>
@@ -324,7 +344,7 @@
                     <groupId>org.apache.axis2</groupId>
                     <artifactId>axis2</artifactId>
                 </exclusion>
-            </exclusions>                        
+            </exclusions>
         </dependency>
         <dependency>
             <groupId>org.wso2.adminui</groupId>
@@ -404,29 +424,8 @@
             <artifactId>axiom-dom</artifactId>
         </dependency>
 
-        <!-- Jetty dependencies -->
-        <dependency>
-            <groupId>org.mortbay.jetty</groupId>
-            <artifactId>jetty</artifactId>
-            <version>${jetty.version}</version>
-        </dependency>
-        <!--<dependency>-->
-            <!--<groupId>org.mortbay.jetty</groupId>-->
-            <!--<artifactId>jetty-util</artifactId>-->
-            <!--<version>${jetty.version}</version>-->
-        <!--</dependency>-->
-        <!--<dependency>-->
-            <!--<groupId>org.mortbay.jetty</groupId>-->
-            <!--<artifactId>servlet-api</artifactId>-->
-            <!--<version>${jetty.servlet.version}</version>-->
-        <!--</dependency>-->
-        <dependency>
-            <groupId>org.slf4j</groupId>
-            <artifactId>slf4j-log4j12</artifactId>
-            <version>${slf4j.version}</version>
-        </dependency>
 
-<!-- direct dependencies for 3rd party JARs / Util JARs -->
+        <!-- direct dependencies for 3rd party JARs / Util JARs -->
         <dependency>
             <groupId>commons-logging</groupId>
             <artifactId>commons-logging</artifactId>
@@ -539,29 +538,133 @@
             <version>${wrapper.version}</version>
         </dependency>
 
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>catalina</artifactId>
+            <version>${tomcat.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>catalina-optional</artifactId>
+            <version>${tomcat.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>jasper-compiler</artifactId>
+            <version>${tomcat.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>jasper-compiler-jdt</artifactId>
+            <version>${tomcat.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>jasper-runtime</artifactId>
+            <version>${tomcat.version}</version>
+        </dependency>
+          <dependency>
+                <groupId>tomcat</groupId>
+                <artifactId>servlet-api</artifactId>
+                <version>${tomcat.version}</version>
+            </dependency>
+        <!--<dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>jsp-api</artifactId>
+            <version>${tomcat.version}</version>
+        </dependency>-->
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>naming-factory</artifactId>
+            <version>${tomcat.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>naming-resources</artifactId>
+            <version>${tomcat.version}</version>
+        </dependency>
+
+        <!--<dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>servlet-api</artifactId>
+            <version>${tomcat.version}</version>
+        </dependency>-->
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>servlets-default</artifactId>
+            <version>${tomcat.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>tomcat-coyote</artifactId>
+            <version>${tomcat.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>tomcat-http</artifactId>
+            <version>${tomcat.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>tomcat-util</artifactId>
+            <version>${tomcat.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>tomcat</groupId>
+            <artifactId>naming-factory-dbcp</artifactId>
+            <version>${tomcat.version}</version>
+        </dependency>
+        <dependency>
+            <groupId>mx4j</groupId>
+            <artifactId>mx4j</artifactId>
+            <version>${mx4j.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>mx4j</groupId>
+            <artifactId>mx4j-tools</artifactId>
+            <version>${mx4j.version}</version>
+        </dependency>
+
+        <dependency>
+            <groupId>mx4j</groupId>
+            <artifactId>mx4j-jmx</artifactId>
+            <version>${mx4j.version}</version>
+        </dependency>
     </dependencies>
 
     <pluginRepositories>
-            <pluginRepository>
-                <id>apache-snapshot</id>
-                <name>Apache Snapshot repository</name>
-                <url>http://people.apache.org/repo/m2-snapshot-repository/</url>
-                <snapshots>
-                    <enabled>true</enabled>
-                </snapshots>
-            </pluginRepository>
-            <pluginRepository>
-                <id>ibiblio-m2</id>
-                <name>Ibiblio Maven 2 Repo</name>
-                <url>http://www.ibiblio.org/maven2/</url>
-                <releases>
-                    <updatePolicy>never</updatePolicy>
-                </releases>
-                <snapshots>
-                    <enabled>false</enabled>
-                </snapshots>
-            </pluginRepository>
-        </pluginRepositories>
+        <pluginRepository>
+            <id>apache-snapshot</id>
+            <name>Apache Snapshot repository</name>
+            <url>http://people.apache.org/repo/m2-snapshot-repository/</url>
+            <snapshots>
+                <enabled>true</enabled>
+            </snapshots>
+        </pluginRepository>
+        <pluginRepository>
+            <id>ibiblio-m2</id>
+            <name>Ibiblio Maven 2 Repo</name>
+            <url>http://www.ibiblio.org/maven2/</url>
+            <releases>
+                <updatePolicy>never</updatePolicy>
+            </releases>
+            <snapshots>
+                <enabled>false</enabled>
+            </snapshots>
+        </pluginRepository>
+    </pluginRepositories>
 
 
     <build>
@@ -622,7 +725,7 @@
         <geronimo.spec.jta.version>1.0.1B-rc4</geronimo.spec.jta.version>
         <derby.version>10.1.1.0</derby.version>
         <hibernate.version>3.1.3</hibernate.version>
-        <jetty.version>6.1.2</jetty.version>
+        <!--<jetty.version>6.1.2</jetty.version>-->
         <!--<jetty.servlet.version>2.5-6.0.2</jetty.servlet.version>-->
         <slf4j.version>1.0.1</slf4j.version>
 
@@ -653,5 +756,7 @@
         <xmlunit.version>1.0</xmlunit.version>
         <log4j.version>1.2.13</log4j.version>
         <wrapper.version>0.0</wrapper.version>
+        <tomcat.version>5.5.15</tomcat.version>
+        <mx4j.version>3.0.1</mx4j.version>
     </properties>
 </project>




More information about the Esb-java-dev mailing list