[esb-java-dev] svn commit r6492 - in trunk/esb/java: . modules/core/src/main/java/org/wso2/esb modules/core/src/main/java/org/wso2/esb/modules/authentication/META-INF modules/core/src/main/java/org/wso2/esb/services/META-INF modules/core/src/main/java/org/wso2/esb/transport/tomcat modules/core/src/test/java/org/wso2/esb/util modules/distribution/src/main/assembly modules/distribution/src/main/bin modules/distribution/src/main/conf

svn at wso2.org svn at wso2.org
Wed Aug 22 23:37:37 PDT 2007


Author: indika
Date: Wed Aug 22 23:37:02 2007
New Revision: 6492

Added:
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/HttpsTransportListener.java
   trunk/esb/java/modules/distribution/src/main/bin/libwrapper.so   (contents, props changed)
   trunk/esb/java/modules/distribution/src/main/bin/wrapper   (contents, props changed)
   trunk/esb/java/modules/distribution/src/main/bin/wso2-esb-daemon.sh
Removed:
   trunk/esb/java/modules/core/src/test/java/org/wso2/esb/util/ServiceBusUtils.java
Modified:
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusConstants.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/modules/authentication/META-INF/module.xml
   trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/META-INF/services.xml
   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/assembly/bin.xml
   trunk/esb/java/modules/distribution/src/main/conf/axis2.xml
   trunk/esb/java/modules/distribution/src/main/conf/wrapper.conf
   trunk/esb/java/pom.xml
Log:
add capability of running a  ESB as a Linux | Unix daemon 
move to axis 2 1.3


Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusConstants.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusConstants.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/ServiceBusConstants.java	Wed Aug 22 23:37:02 2007
@@ -27,7 +27,10 @@
     public static final String OUT_MESSAGE_MAP_KEY       = "OUT_Message_Map_Key";
     public static final String IN_FAULT_MESSAGE_MAP_KEY  = "IN_FAULT_Message_Map_Key";
     public static final String OUT_FAULT_MESSAGE_MAP_KEY = "OUT_FAULT_Message_Map_Key";
-
+    public static final String ADMIN_TRANSPORT = "admin/https";
+    public static final String HTTP_TRANSPORT = "http";
+    public static final String HTTPS_TRANSPORT = "https";
+    
     public static final String ADMIN_SERVICE_GROUP = "ESBAdmin";
     public static final String ESB_INSTANCE        = "WSO2 ESB";
     public static final String ESB_XML_NAMESPACE   = "http://www.wso2.org/projects/esb";

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	Wed Aug 22 23:37:02 2007
@@ -52,11 +52,11 @@
 
     private static Log log = LogFactory.getLog(ServiceBusManager.class);
 
-    public static int httpPort = 8080;
-    public static int httpsPort = 9443;
-    public static String host = "localhost";
+    private int httpPort = 8080;
+    private int httpsPort = 9443;
+    private String host = "localhost";
     private ServiceBusConfiguration esbConfiguration;
-    public ConfigurationContext configurationContext;
+    private ConfigurationContext configurationContext;
     private NetworkServerControl networkServerControl;
     private ListenerManager listenerManager;
     /**
@@ -85,7 +85,7 @@
                     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);
+                        server_web_xml, ServiceBusConstants.ESB_XML_NAMESPACE);
             } catch (ServerException e) {
                 log.error("Error loading server-web.xml", e);
             }
@@ -120,7 +120,7 @@
         String esb_password = esbConfiguration.getFirstProperty("DefaultAdmin.Password");
 
         return username.equals(esb_username) &&
-               password.equals(esb_password);
+                password.equals(esb_password);
     }
 
     /**
@@ -228,15 +228,15 @@
         Hashtable fileContents = new Hashtable();
         try {
             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);
+                    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);
         }
@@ -295,38 +295,38 @@
         }
         if (axis2Xml == null) {
             System.setProperty(Constants.AXIS2_CONF,
-                               esbHome + File.separator + ServiceBusConstants.ESB_CONF_DIRECTORY
-                               + File.separator + Constants.AXIS2_CONF);
+                    esbHome + File.separator + ServiceBusConstants.ESB_CONF_DIRECTORY
+                            + File.separator + Constants.AXIS2_CONF);
         }
 
         String esbXml = System.getProperty(ServiceBusConstants.ESB_SERVER_XML);
         if (esbXml == null) {
             System.setProperty(ServiceBusConstants.ESB_SERVER_XML,
-                               esbHome + File.separator + ServiceBusConstants.ESB_CONF_DIRECTORY
-                               + File.separator + "server.xml");
+                    esbHome + File.separator + ServiceBusConstants.ESB_CONF_DIRECTORY
+                            + File.separator + "server.xml");
         }
 
         String synapseXml = System.getProperty(org.apache.synapse.Constants.SYNAPSE_XML);
         if (synapseXml == null) {
             System.setProperty(org.apache.synapse.Constants.SYNAPSE_XML,
-                               esbHome + File.separator + ServiceBusConstants.ESB_CONF_DIRECTORY
-                               + File.separator + 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);
+                    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);
+                    "conf" +
+                            File.separator + ServiceBusConstants.ESB_UI_EXTENSIONS_CONFIG_XML);
         }
 
         String hibernameConf = System.getProperty(ServiceBusConstants.ESB_HIBERNATE_CFG_XML);
@@ -336,19 +336,19 @@
                             getResourceAsStream(ServiceBusConstants.ESB_HIBERNATE_CFG_XML);
             if (inStream == null) {
                 System.setProperty(ServiceBusConstants.ESB_HIBERNATE_CFG_XML,
-                                   "conf" + File.separator +
-                                   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);
+                        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);
+                    esbHome +
+                            File.separator
+                            + ServiceBusConstants.ESB_CONF_DIRECTORY);
         }
     }
 
@@ -434,4 +434,36 @@
             }
         }
     }
+
+    public int getHttpPort() {
+        return httpPort;
+    }
+
+    public void setHttpPort(int httpPort) {
+        this.httpPort = httpPort;
+    }
+
+    public int getHttpsPort() {
+        return httpsPort;
+    }
+
+    public void setHttpsPort(int httpsPort) {
+        this.httpsPort = httpsPort;
+    }
+
+    public String getHost() {
+        return host;
+    }
+
+    public void setHost(String host) {
+        this.host = host;
+    }
+
+    public ConfigurationContext getConfigurationContext() {
+        return configurationContext;
+    }
+
+    public void setConfigurationContext(ConfigurationContext configurationContext) {
+        this.configurationContext = configurationContext;
+    }
 }

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/modules/authentication/META-INF/module.xml
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/modules/authentication/META-INF/module.xml	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/modules/authentication/META-INF/module.xml	Wed Aug 22 23:37:02 2007
@@ -15,10 +15,10 @@
   -->
 
 <module name="AuthenticationModule">
-    <inflow>
+    <InFlow>
         <handler name="AuthenticationHandler"
                  class="org.wso2.esb.modules.authentication.handler.AuthenticationHandler">
             <order phase="AuthPhase"/>
         </handler>
-    </inflow>
+    </InFlow>
 </module>
\ No newline at end of file

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/META-INF/services.xml
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/META-INF/services.xml	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/services/META-INF/services.xml	Wed Aug 22 23:37:02 2007
@@ -16,7 +16,7 @@
 
 <serviceGroup name="ESBAdmin">
 
-    <module ref="authentication"/>
+    <module ref="AuthenticationModule"/>
 
     <service name="LoginAdmin" scope="transportsession">
         <schema schemaNamespace="http://org.apache.axis2/xsd" elementFormDefaultQualified="false"/>

Modified: 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/ESBServlet.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/ESBServlet.java	Wed Aug 22 23:37:02 2007
@@ -16,11 +16,17 @@
 package org.wso2.esb.transport.tomcat;
 
 import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
 import org.apache.axis2.transport.http.AxisServlet;
+import org.apache.axis2.description.TransportInDescription;
+import org.wso2.esb.ServiceBusConstants;
 
 import javax.servlet.ServletConfig;
 import javax.servlet.ServletContext;
 import javax.servlet.ServletException;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import java.io.IOException;
 
 /**
  *
@@ -40,4 +46,15 @@
         this.servletConfig = config;
         initParams();
     }
+
+
+    protected MessageContext createMessageContext(HttpServletRequest req, HttpServletResponse resp) throws IOException {
+        MessageContext msgContext = super.createMessageContext(req, resp);
+        TransportInDescription adminTransIn = axisConfiguration.getTransportIn(
+                ServiceBusConstants.ADMIN_TRANSPORT);
+        if (adminTransIn != null) {
+            msgContext.setTransportIn(adminTransIn);
+        }
+        return msgContext;
+    }
 }

Added: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/HttpsTransportListener.java
==============================================================================
--- (empty file)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/HttpsTransportListener.java	Wed Aug 22 23:37:02 2007
@@ -0,0 +1,73 @@
+/*
+ *  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.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.description.TransportInDescription;
+import org.apache.axis2.description.Parameter;
+import org.apache.axis2.context.ConfigurationContext;
+import org.wso2.utils.NetworkUtils;
+import org.wso2.utils.transport.AbstractTransportListener;
+import org.wso2.esb.ServiceBusManager;
+import org.wso2.esb.ServiceBusConstants;
+
+import java.net.SocketException;
+
+/**
+ *
+ */
+
+public class HttpsTransportListener extends AbstractTransportListener {
+
+    private static Log log = LogFactory.getLog(HttpsTransportListener.class);
+
+    public void init(ConfigurationContext configContext,
+                     TransportInDescription transportIn) throws AxisFault {
+        this.configurationContext = configContext;
+        Parameter portParam = transportIn.getParameter(PARAM_PORT);
+        if (portParam != null) {
+            this.port = Integer.parseInt(portParam.getValue().toString().trim());
+        } else {
+            this.port = ServiceBusManager.getInstance().getHttpsPort();
+        }
+        this.tInDescription = transportIn;
+    }
+
+    public void start() throws AxisFault {
+
+    }
+
+    public EndpointReference getEPRForService(String serviceName,
+                                              String ip) throws AxisFault {
+        return getEPR(ServiceBusConstants.HTTPS_TRANSPORT, serviceName, ip);
+    }
+
+    public EndpointReference[] getEPRsForService(String serviceName, String ip) throws AxisFault {
+        try {
+            ip = NetworkUtils.getLocalHostname();
+        } catch (SocketException e) {
+            log.error(e);
+            throw AxisFault.makeFault(e);
+        }
+        return new EndpointReference[]{getEPRForService(serviceName, ip)};
+    }
+}

Modified: 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/RequestRedirectionFilter.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/RequestRedirectionFilter.java	Wed Aug 22 23:37:02 2007
@@ -65,7 +65,7 @@
         if (httpServletRequest.getRequestURL().toString()
                 .indexOf(NetworkUtils.getLocalHostname()) == -1) {
             httpServletResponse.sendRedirect("https://" +
-                                             NetworkUtils.getLocalHostname() + ":" + ServiceBusManager.httpsPort +
+                                             NetworkUtils.getLocalHostname() + ":" + ServiceBusManager.getInstance().getHttpsPort() +
                                              (contextRoot.equals("/") ? contextRoot : contextRoot + "/")); // set the redirection
         } else {
             filterChain.doFilter(request, response);

Modified: 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/StartUpServlet.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/StartUpServlet.java	Wed Aug 22 23:37:02 2007
@@ -19,6 +19,7 @@
 package org.wso2.esb.transport.tomcat;
 
 import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 import org.apache.log4j.PropertyConfigurator;
@@ -50,6 +51,8 @@
     private static Log log = LogFactory.getLog(StartUpServlet.class);
     private ServiceBusManager serviceBusManager;
     public static final String CONFIGURATION_CONTEXT = "CONFIGURATION_CONTEXT";
+    private final static String HAS_ALREADY_INIT = "hasAlreadyInit";
+    private final static String TRUE = "true";
 
     public void init() throws ServletException {
         super.init();
@@ -57,7 +60,7 @@
 
     public void init(ServletConfig servletConfig) throws ServletException {
         ServletContext servletContext = servletConfig.getServletContext();
-        if ("true".equals(servletContext.getAttribute("hasAlreadyInit"))) {
+        if (TRUE.equals(servletContext.getAttribute(HAS_ALREADY_INIT))) {
             return;
         }
         String esbhome = System.getProperty(ServiceBusConstants.ESB_HOME);
@@ -70,7 +73,7 @@
                 System.setProperty(ServiceBusConstants.ESB_HOME, esbhome);
                 try {
                     URL url = new URL("file:" + esbhome + File.separator
-                                      + ServiceBusConstants.ESB_CONF_DIRECTORY + "log4j.properties");
+                            + ServiceBusConstants.ESB_CONF_DIRECTORY + "log4j.properties");
                     PropertyConfigurator.configure(url);
                 } catch (MalformedURLException ignore) {
                 }
@@ -89,12 +92,12 @@
             log.fatal("WSO2 ESB failed to start ", e);
             throw new ServletException(e);
         }
-
+        ConfigurationContext configctx = serviceBusManager.getConfigurationContext();
         servletContext.
                 setAttribute(CONFIGURATION_CONTEXT,
-                             serviceBusManager.configurationContext);
+                        configctx);
 
-        Map fileContents = (Map) serviceBusManager.configurationContext.
+        Map fileContents = (Map) configctx.
                 getProperty(org.wso2.esb.ServiceBusConstants.GENERATED_PAGES);
         if (fileContents != null) {
             AdminUIServletFilter adminUIServletFilter =
@@ -103,24 +106,24 @@
             if (adminUIServletFilter != null) {
                 adminUIServletFilter.
                         init(fileContents,
-                             true,
-                             ServiceBusManager.httpsPort,
-                             ServiceBusManager.httpPort,
-                             serviceBusManager.configurationContext.getServiceContextPath());
+                                true,
+                                serviceBusManager.getHttpsPort(),
+                                serviceBusManager.getHttpPort(),
+                                configctx.getServiceContextPath());
             }
         }
-        servletContext.setAttribute("hasAlreadyInit", "true");
+        servletContext.setAttribute(HAS_ALREADY_INIT, TRUE);
     }
 
 
     protected void doGet(HttpServletRequest request,
                          HttpServletResponse response) throws ServletException,
-                                                              IOException {
+            IOException {
     }
 
     protected void doPost(HttpServletRequest request,
                           HttpServletResponse response) throws ServletException,
-                                                               IOException {
+            IOException {
     }
 
     public void destroy() {

Modified: trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/TomcatServer.java
==============================================================================
--- trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/TomcatServer.java	(original)
+++ trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/TomcatServer.java	Wed Aug 22 23:37:02 2007
@@ -46,6 +46,7 @@
     private static Log log = LogFactory.getLog(TomcatServer.class);
     public static final Embedded embedded = new Embedded();
     private ServiceBusConfiguration esbConfiguration;
+    private final ServiceBusManager manager = ServiceBusManager.getInstance();
 
     public TomcatServer(ServiceBusConfiguration esbConfiguration) {
         this.esbConfiguration = esbConfiguration;
@@ -54,11 +55,10 @@
     public void start() throws Exception {
 
         Engine engine;
-
         String esbHome = System.getProperty(ServiceBusConstants.ESB_HOME);
 
         String catalinaHome = new File(esbHome).getAbsolutePath() +
-                              File.separator + "tomcat";
+                File.separator + "tomcat";
 
         embedded.setCatalinaHome(catalinaHome);
         String webappsDir = esbHome + File.separator + "webapp";
@@ -70,14 +70,15 @@
         embedded.setRealm(memRealm);
 
         // Create an engine
-        ServiceBusManager.host = NetworkUtils.getLocalHostname();
+        String host = NetworkUtils.getLocalHostname();
+        manager.setHost(host);
         engine = embedded.createEngine();
         engine.setName("Catalina");
-        engine.setDefaultHost(ServiceBusManager.host);
+        engine.setDefaultHost(manager.getHost());
         embedded.addEngine(engine);
 
         // Create a default virtual host
-        Host defaultHost = embedded.createHost(ServiceBusManager.host, webappsDir);
+        Host defaultHost = embedded.createHost(host, webappsDir);
         engine.addChild(defaultHost);
         String esbContextPath = XmlConfigurationFactory.getXmlConfiguration(ServiceBusConstants.ESB_WEB_XML_KEY).
                 getUniqueValue("//ns:Mapping[@name=\"admin\"]/ns:ContextPath");
@@ -95,7 +96,7 @@
         }
 
         Context esbContext = embedded.createContext(esbContextPath,
-                                                    new File(webappsDir).getAbsolutePath());
+                new File(webappsDir).getAbsolutePath());
         defaultHost.addChild(esbContext);
 
         Context docsContext = embedded.createContext("/docs", new File(docsDir).getAbsolutePath());
@@ -111,7 +112,7 @@
         // Start the embedded server
         try {
             embedded.start();
-            log.info("Tomcat Server Started at  " + "https://" + ServiceBusManager.host + ":" + ServiceBusManager.httpsPort + esbContextPath);
+            log.info("Tomcat Server Started at  " + "https://" + host + ":" + manager.getHttpsPort() + esbContextPath);
         } catch (Exception e) {
             log.fatal("Error starting embedded tomcat server : " + e);
         }
@@ -125,7 +126,7 @@
         if (portString != null) {
             int port = Integer.parseInt(portString);
             if (port > 0) {
-                ServiceBusManager.httpsPort = port;
+                manager.setHttpsPort(port);
             }
         }
         String ksLocation =
@@ -134,7 +135,7 @@
         if (!new File(ksLocation).isAbsolute()) {
             absKsLocation =
                     new File(System.getProperty(ServiceBusConstants.ESB_HOME) + File.separator +
-                             ksLocation).getAbsolutePath();
+                            ksLocation).getAbsolutePath();
         } else {
             absKsLocation = ksLocation;
         }
@@ -156,8 +157,8 @@
         String acceptCount = esbConfiguration.getFirstProperty("AdminConsole.AcceptCount");
         // SSLConnector
         Connector sslConnector =
-                embedded.createConnector((InetAddress) null, ServiceBusManager.httpsPort, true);
-        sslConnector.setScheme("https");
+                embedded.createConnector((InetAddress) null, manager.getHttpsPort(), true);
+        sslConnector.setScheme(ServiceBusConstants.HTTPS_TRANSPORT);
 //        IntrospectionUtils.setProperty(sslConnector, "sslProtocol", "TLS");
         if (ksPassword != null) {
             IntrospectionUtils.setProperty(sslConnector, "keypass", ksPassword);

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	Wed Aug 22 23:37:02 2007
@@ -60,6 +60,13 @@
             <directory>src/main/bin</directory>
             <outputDirectory>wso2esb-${wso2.esb.version}/bin</outputDirectory>
             <includes>
+                <include>wso2-esb-daemon.sh</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>src/main/bin</directory>
+            <outputDirectory>wso2esb-${wso2.esb.version}/bin</outputDirectory>
+            <includes>
                 <include>wso2-esb.bat</include>
             </includes>
         </fileSet>
@@ -68,7 +75,8 @@
             <outputDirectory>wso2esb-${wso2.esb.version}</outputDirectory>
             <includes>
                 <include>wrapper.exe</include>
-            </includes>           
+                <include>wrapper</include>
+            </includes>
         </fileSet>
         <fileSet>
             <directory>../../repository</directory>
@@ -77,12 +85,13 @@
 
         <fileSet>
             <directory>src/main/conf</directory>
-            <outputDirectory>wso2esb-${wso2.esb.version}/webapp/WEB-INF/classes/conf</outputDirectory>
+            <outputDirectory>wso2esb-${wso2.esb.version}/webapp/WEB-INF/classes/conf
+            </outputDirectory>
             <excludes>
                 <exclude>wrapper.dll</exclude>
                 <exclude>web.xml</exclude>
-                <exclude>tomcat</exclude>                
-                <exclude>tomcat/*</exclude>                
+                <exclude>tomcat</exclude>
+                <exclude>tomcat/*</exclude>
             </excludes>
         </fileSet>
         <fileSet>
@@ -91,7 +100,8 @@
         </fileSet>
         <fileSet>
             <directory>../../modules/core/src/main/resources</directory>
-            <outputDirectory>wso2esb-${wso2.esb.version}/webapp/WEB-INF/classes/conf</outputDirectory>
+            <outputDirectory>wso2esb-${wso2.esb.version}/webapp/WEB-INF/classes/conf
+            </outputDirectory>
             <includes>
                 <include>identity.jks</include>
                 <include>trust.jks</include>
@@ -103,6 +113,7 @@
             <outputDirectory>wso2esb-${wso2.esb.version}/webapp/WEB-INF/lib</outputDirectory>
             <includes>
                 <include>wrapper.dll</include>
+                <include>libwrapper.so</include>
             </includes>
         </fileSet>
 
@@ -122,14 +133,16 @@
 
         <fileSet>
             <directory>../../repository/conf/sample/resources/misc/client</directory>
-            <outputDirectory>wso2esb-${wso2.esb.version}/samples/axis2Client/client_repo/conf</outputDirectory>
+            <outputDirectory>wso2esb-${wso2.esb.version}/samples/axis2Client/client_repo/conf
+            </outputDirectory>
             <includes>
                 <include>axis2.xml</include>
             </includes>
         </fileSet>
         <fileSet>
             <directory>../../repository/conf/sample/resources/misc/server</directory>
-            <outputDirectory>wso2esb-${wso2.esb.version}/samples/axis2Server/repository/conf</outputDirectory>
+            <outputDirectory>wso2esb-${wso2.esb.version}/samples/axis2Server/repository/conf
+            </outputDirectory>
             <includes>
                 <include>axis2.xml</include>
             </includes>
@@ -196,7 +209,7 @@
                 <include>xml-apis-${xml_apis.version}.jar</include>
                 <include>xercesImpl-${xerces.version}.jar</include>
             </includes>
-        </fileSet>           
+        </fileSet>
 
         <fileSet>
             <directory>target/temp/lib/www</directory>
@@ -328,7 +341,8 @@
             <outputFileNameMapping>${artifactId}.${extension}</outputFileNameMapping>
         </dependencySet>
         <dependencySet>
-            <outputDirectory>wso2esb-${wso2.esb.version}/samples/axis2Client/client_repo/modules</outputDirectory>
+            <outputDirectory>wso2esb-${wso2.esb.version}/samples/axis2Client/client_repo/modules
+            </outputDirectory>
             <includes>
                 <include>org.apache.axis2:addressing:mar</include>
                 <include>org.apache.rampart:rampart:mar</include>
@@ -337,7 +351,8 @@
             <outputFileNameMapping>${artifactId}.${extension}</outputFileNameMapping>
         </dependencySet>
         <dependencySet>
-            <outputDirectory>wso2esb-${wso2.esb.version}/samples/axis2Server/repository/modules</outputDirectory>
+            <outputDirectory>wso2esb-${wso2.esb.version}/samples/axis2Server/repository/modules
+            </outputDirectory>
             <includes>
                 <include>org.apache.axis2:addressing:mar</include>
                 <include>org.apache.rampart:rampart:mar</include>

Added: trunk/esb/java/modules/distribution/src/main/bin/libwrapper.so
==============================================================================
Binary file. No diff available.

Added: trunk/esb/java/modules/distribution/src/main/bin/wrapper
==============================================================================
Binary file. No diff available.

Added: trunk/esb/java/modules/distribution/src/main/bin/wso2-esb-daemon.sh
==============================================================================
--- (empty file)
+++ trunk/esb/java/modules/distribution/src/main/bin/wso2-esb-daemon.sh	Wed Aug 22 23:37:02 2007
@@ -0,0 +1,551 @@
+#! /bin/sh
+
+#
+# Copyright (c) 1999, 2006 Tanuki Software Inc.
+#
+# Java Service Wrapper sh script.  Suitable for starting and stopping
+#  wrapped Java applications on UNIX platforms.
+#
+
+#-----------------------------------------------------------------------------
+# These settings can be modified to fit the needs of your application
+
+# Application
+APP_NAME="ESB"
+APP_LONG_NAME="WSO2 Enterprise Service Bus (ESB)"
+
+# Wrapper
+WRAPPER_CMD="./wrapper"
+WRAPPER_CONF="./webapp/WEB-INF/classes/conf/wrapper.conf"
+
+# Priority at which to run the wrapper.  See "man nice" for valid priorities.
+#  nice is only used if a priority is specified.
+PRIORITY=
+
+# Location of the pid file.
+PIDDIR="."
+
+# If uncommented, causes the Wrapper to be shutdown using an anchor file.
+#  When launched with the 'start' command, it will also ignore all INT and
+#  TERM signals.
+#IGNORE_SIGNALS=true
+
+# If specified, the Wrapper will be run as the specified user.
+# IMPORTANT - Make sure that the user has the required privileges to write
+#  the PID file and wrapper.log files.  Failure to be able to write the log
+#  file will cause the Wrapper to exit without any way to write out an error
+#  message.
+# NOTE - This will set the user which is used to run the Wrapper as well as
+#  the JVM and is not useful in situations where a privileged resource or
+#  port needs to be allocated prior to the user being changed.
+#RUN_AS_USER=
+
+# The following two lines are used by the chkconfig command. Change as is
+#  appropriate for your application.  They should remain commented.
+# chkconfig: 2345 20 80
+# description: @app.long.name@
+
+# Do not modify anything beyond this point
+#-----------------------------------------------------------------------------
+
+# Get the fully qualified path to the script
+case $0 in
+    /*)
+        SCRIPT="$0"
+        ;;
+    *)
+        PWD=`pwd`
+        SCRIPT="$PWD/$0"
+        ;;
+esac
+
+# Resolve the true real path without any sym links.
+CHANGED=true
+while [ "X$CHANGED" != "X" ]
+do
+    # Change spaces to ":" so the tokens can be parsed.
+    SAFESCRIPT=`echo $SCRIPT | sed -e 's; ;:;g'`
+    # Get the real path to this script, resolving any symbolic links
+    TOKENS=`echo $SAFESCRIPT | sed -e 's;/; ;g'`
+    REALPATH=
+    for C in $TOKENS; do
+        # Change any ":" in the token back to a space.
+        C=`echo $C | sed -e 's;:; ;g'`
+        REALPATH="$REALPATH/$C"
+        # If REALPATH is a sym link, resolve it.  Loop for nested links.
+        while [ -h "$REALPATH" ] ; do
+            LS="`ls -ld "$REALPATH"`"
+            LINK="`expr "$LS" : '.*-> \(.*\)$'`"
+            if expr "$LINK" : '/.*' > /dev/null; then
+                # LINK is absolute.
+                REALPATH="$LINK"
+            else
+                # LINK is relative.
+                REALPATH="`dirname "$REALPATH"`""/$LINK"
+            fi
+        done
+    done
+
+    if [ "$REALPATH" = "$SCRIPT" ]
+    then
+        CHANGED=""
+    else
+        SCRIPT="$REALPATH"
+    fi
+
+done
+
+# Change the current directory to the location of the script
+PRGDIR=`dirname "$REALPATH"`
+REALDIR=`cd "$PRGDIR/..";pwd`
+
+
+# If the PIDDIR is relative, set its value relative to the full REALPATH to avoid problems if
+#  the working directory is later changed.
+FIRST_CHAR=`echo $PIDDIR | cut -c1,1`
+if [ "$FIRST_CHAR" != "/" ]
+then
+    PIDDIR=$REALDIR/$PIDDIR
+fi
+# Same test for WRAPPER_CMD
+FIRST_CHAR=`echo $WRAPPER_CMD | cut -c1,1`
+if [ "$FIRST_CHAR" != "/" ]
+then
+    WRAPPER_CMD=$REALDIR/$WRAPPER_CMD
+fi
+# Same test for WRAPPER_CONF
+FIRST_CHAR=`echo $WRAPPER_CONF | cut -c1,1`
+if [ "$FIRST_CHAR" != "/" ]
+then
+    WRAPPER_CONF=$REALDIR/$WRAPPER_CONF
+fi
+
+# Process ID
+ANCHORFILE="$PIDDIR/$APP_NAME.anchor"
+PIDFILE="$PIDDIR/$APP_NAME.pid"
+LOCKDIR="/var/lock/subsys"
+LOCKFILE="$LOCKDIR/$APP_NAME"
+pid=""
+
+# Resolve the location of the 'ps' command
+PSEXE="/usr/bin/ps"
+if [ ! -x "$PSEXE" ]
+then
+    PSEXE="/bin/ps"
+    if [ ! -x "$PSEXE" ]
+    then
+        echo "Unable to locate 'ps'."
+        echo "Please report this message along with the location of the command on your system."
+        exit 1
+    fi
+fi
+
+# Resolve the os
+DIST_OS=`uname -s | tr [:upper:] [:lower:] | tr -d [:blank:]`
+case "$DIST_OS" in
+    'sunos')
+        DIST_OS="solaris"
+        ;;
+    'hp-ux' | 'hp-ux64')
+        DIST_OS="hpux"
+        ;;
+    'darwin')
+        DIST_OS="macosx"
+        ;;
+    'unix_sv')
+        DIST_OS="unixware"
+        ;;
+esac
+
+# Resolve the architecture
+DIST_ARCH=`uname -p | tr [:upper:] [:lower:] | tr -d [:blank:]`
+if [ "$DIST_ARCH" = "unknown" ]
+then
+    DIST_ARCH=`uname -m | tr [:upper:] [:lower:] | tr -d [:blank:]`
+fi
+case "$DIST_ARCH" in
+    'amd64' | 'athlon' | 'ia32' | 'ia64' | 'i386' | 'i486' | 'i586' | 'i686' | 'x86_64')
+        DIST_ARCH="x86"
+        ;;
+    'ip27')
+        DIST_ARCH="mips"
+        ;;
+    'power' | 'powerpc' | 'power_pc' | 'ppc64')
+        DIST_ARCH="ppc"
+        ;;
+    'pa_risc' | 'pa-risc')
+        DIST_ARCH="parisc"
+        ;;
+    'sun4u' | 'sparcv9')
+        DIST_ARCH="sparc"
+        ;;
+    '9000/800')
+        DIST_ARCH="parisc"
+        ;;
+esac
+
+outputFile() {
+    if [ -f "$1" ]
+    then
+        echo "  $1 (Found but not executable.)";
+    else
+        echo "  $1"
+    fi
+}
+
+# Decide on the wrapper binary to use.
+# If a 32-bit wrapper binary exists then it will work on 32 or 64 bit
+#  platforms, if the 64-bit binary exists then the distribution most
+#  likely wants to use long names.  Otherwise, look for the default.
+# For macosx, we also want to look for universal binaries.
+WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32"
+if [ -x "$WRAPPER_TEST_CMD" ]
+then
+    WRAPPER_CMD="$WRAPPER_TEST_CMD"
+else
+    if [ "$DIST_OS" = "macosx" ]
+    then
+        WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-universal-32"
+        if [ -x "$WRAPPER_TEST_CMD" ]
+        then
+            WRAPPER_CMD="$WRAPPER_TEST_CMD"
+        else
+            WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64"
+            if [ -x "$WRAPPER_TEST_CMD" ]
+            then
+                WRAPPER_CMD="$WRAPPER_TEST_CMD"
+            else
+                WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-universal-64"
+                if [ -x "$WRAPPER_TEST_CMD" ]
+                then
+                    WRAPPER_CMD="$WRAPPER_TEST_CMD"
+                else
+                    if [ ! -x "$WRAPPER_CMD" ]
+                    then
+                        echo "Unable to locate any of the following binaries:"
+                        outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32"
+                        outputFile "$WRAPPER_CMD-$DIST_OS-universal-32"
+                        outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64"
+                        outputFile "$WRAPPER_CMD-$DIST_OS-universal-64"
+                        outputFile "$WRAPPER_CMD"
+                        exit 1
+                    fi
+                fi
+            fi
+        fi
+    else
+        WRAPPER_TEST_CMD="$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64"
+        if [ -x "$WRAPPER_TEST_CMD" ]
+        then
+            WRAPPER_CMD="$WRAPPER_TEST_CMD"
+        else
+            if [ ! -x "$WRAPPER_CMD" ]
+            then
+                echo "Unable to locate any of the following binaries:"
+                outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-32"
+                outputFile "$WRAPPER_CMD-$DIST_OS-$DIST_ARCH-64"
+                outputFile "$WRAPPER_CMD"
+                exit 1
+            fi
+        fi
+    fi
+fi
+
+# Build the nice clause
+if [ "X$PRIORITY" = "X" ]
+then
+    CMDNICE=""
+else
+    CMDNICE="nice -$PRIORITY"
+fi
+
+# Build the anchor file clause.
+if [ "X$IGNORE_SIGNALS" = "X" ]
+then
+   ANCHORPROP=
+   IGNOREPROP=
+else
+   ANCHORPROP=wrapper.anchorfile=\"$ANCHORFILE\"
+   IGNOREPROP=wrapper.ignore_signals=TRUE
+fi
+
+# Build the lock file clause.  Only create a lock file if the lock directory exists on this platform.
+LOCKPROP=
+if [ -d $LOCKDIR ]
+then
+    if [ -w $LOCKDIR ]
+    then
+        LOCKPROP=wrapper.lockfile=\"$LOCKFILE\"
+    fi
+fi
+
+checkUser() {
+    # $1 touchLock flag
+    # $2 command
+
+    # Check the configured user.  If necessary rerun this script as the desired user.
+    if [ "X$RUN_AS_USER" != "X" ]
+    then
+        # Resolve the location of the 'id' command
+        IDEXE="/usr/xpg4/bin/id"
+        if [ ! -x "$IDEXE" ]
+        then
+            IDEXE="/usr/bin/id"
+            if [ ! -x "$IDEXE" ]
+            then
+                echo "Unable to locate 'id'."
+                echo "Please report this message along with the location of the command on your system."
+                exit 1
+            fi
+        fi
+
+        if [ "`$IDEXE -u -n`" = "$RUN_AS_USER" ]
+        then
+            # Already running as the configured user.  Avoid password prompts by not calling su.
+            RUN_AS_USER=""
+        fi
+    fi
+    if [ "X$RUN_AS_USER" != "X" ]
+    then
+        # If LOCKPROP and $RUN_AS_USER are defined then the new user will most likely not be
+        # able to create the lock file.  The Wrapper will be able to update this file once it
+        # is created but will not be able to delete it on shutdown.  If $2 is defined then
+        # the lock file should be created for the current command
+        if [ "X$LOCKPROP" != "X" ]
+        then
+            if [ "X$1" != "X" ]
+            then
+                # Resolve the primary group
+                RUN_AS_GROUP=`groups $RUN_AS_USER | awk '{print $3}' | tail -1`
+                if [ "X$RUN_AS_GROUP" = "X" ]
+                then
+                    RUN_AS_GROUP=$RUN_AS_USER
+                fi
+                touch $LOCKFILE
+                chown $RUN_AS_USER:$RUN_AS_GROUP $LOCKFILE
+            fi
+        fi
+
+        # Still want to change users, recurse.  This means that the user will only be
+        #  prompted for a password once. Variables shifted by 1
+        su -m $RUN_AS_USER -c "\"$REALPATH\" $2"
+
+        # Now that we are the original user again, we may need to clean up the lock file.
+        if [ "X$LOCKPROP" != "X" ]
+        then
+            getpid
+            if [ "X$pid" = "X" ]
+            then
+                # Wrapper is not running so make sure the lock file is deleted.
+                if [ -f "$LOCKFILE" ]
+                then
+                    rm "$LOCKFILE"
+                fi
+            fi
+        fi
+
+        exit 0
+    fi
+}
+
+getpid() {
+    if [ -f "$PIDFILE" ]
+    then
+        if [ -r "$PIDFILE" ]
+        then
+            pid=`cat "$PIDFILE"`
+            if [ "X$pid" != "X" ]
+            then
+                # It is possible that 'a' process with the pid exists but that it is not the
+                #  correct process.  This can happen in a number of cases, but the most
+                #  common is during system startup after an unclean shutdown.
+                # The ps statement below looks for the specific wrapper command running as
+                #  the pid.  If it is not found then the pid file is considered to be stale.
+                pidtest=`$PSEXE -p $pid -o args | grep "$WRAPPER_CMD" | tail -1`
+                if [ "X$pidtest" = "X" ]
+                then
+                    # This is a stale pid file.
+                    rm -f "$PIDFILE"
+                    echo "Removed stale pid file: $PIDFILE"
+                    pid=""
+                fi
+            fi
+        else
+            echo "Cannot read $PIDFILE."
+            exit 1
+        fi
+    fi
+}
+
+testpid() {
+    pid=`$PSEXE -p $pid | grep $pid | grep -v grep | awk '{print $1}' | tail -1`
+    if [ "X$pid" = "X" ]
+    then
+        # Process is gone so remove the pid file.
+        rm -f "$PIDFILE"
+        pid=""
+    fi
+}
+
+console() {
+    echo "Running $APP_LONG_NAME..."
+    getpid
+    if [ "X$pid" = "X" ]
+    then
+        # The string passed to eval must handles spaces in paths correctly.
+        COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=$APP_NAME wrapper.pidfile=\"$PIDFILE\" $ANCHORPROP $LOCKPROP"
+        eval $COMMAND_LINE
+    else
+        echo "$APP_LONG_NAME is already running."
+        exit 1
+    fi
+}
+
+start() {
+    echo "Starting $APP_LONG_NAME..."
+    getpid
+    if [ "X$pid" = "X" ]
+    then
+        # The string passed to eval must handles spaces in paths correctly.
+        COMMAND_LINE="$CMDNICE \"$WRAPPER_CMD\" \"$WRAPPER_CONF\" wrapper.syslog.ident=$APP_NAME wrapper.pidfile=\"$PIDFILE\" wrapper.daemonize=TRUE $ANCHORPROP $IGNOREPROP $LOCKPROP"
+        eval $COMMAND_LINE
+    else
+        echo "$APP_LONG_NAME is already running."
+        exit 1
+    fi
+}
+
+stopit() {
+    echo "Stopping $APP_LONG_NAME..."
+    getpid
+    if [ "X$pid" = "X" ]
+    then
+        echo "$APP_LONG_NAME was not running."
+    else
+        if [ "X$IGNORE_SIGNALS" = "X" ]
+        then
+            # Running so try to stop it.
+            kill $pid
+            if [ $? -ne 0 ]
+            then
+                # An explanation for the failure should have been given
+                echo "Unable to stop $APP_LONG_NAME."
+                exit 1
+            fi
+        else
+            rm -f "$ANCHORFILE"
+            if [ -f "$ANCHORFILE" ]
+            then
+                # An explanation for the failure should have been given
+                echo "Unable to stop $APP_LONG_NAME."
+                exit 1
+            fi
+        fi
+
+        # We can not predict how long it will take for the wrapper to
+        #  actually stop as it depends on settings in wrapper.conf.
+        #  Loop until it does.
+        savepid=$pid
+        CNT=0
+        TOTCNT=0
+        while [ "X$pid" != "X" ]
+        do
+            # Show a waiting message every 5 seconds.
+            if [ "$CNT" -lt "5" ]
+            then
+                CNT=`expr $CNT + 1`
+            else
+                echo "Waiting for $APP_LONG_NAME to exit..."
+                CNT=0
+            fi
+            TOTCNT=`expr $TOTCNT + 1`
+
+            sleep 1
+
+            testpid
+        done
+
+        pid=$savepid
+        testpid
+        if [ "X$pid" != "X" ]
+        then
+            echo "Failed to stop $APP_LONG_NAME."
+            exit 1
+        else
+            echo "Stopped $APP_LONG_NAME."
+        fi
+    fi
+}
+
+status() {
+    getpid
+    if [ "X$pid" = "X" ]
+    then
+        echo "$APP_LONG_NAME is not running."
+        exit 1
+    else
+        echo "$APP_LONG_NAME is running ($pid)."
+        exit 0
+    fi
+}
+
+dump() {
+    echo "Dumping $APP_LONG_NAME..."
+    getpid
+    if [ "X$pid" = "X" ]
+    then
+        echo "$APP_LONG_NAME was not running."
+
+    else
+        kill -3 $pid
+
+        if [ $? -ne 0 ]
+        then
+            echo "Failed to dump $APP_LONG_NAME."
+            exit 1
+        else
+            echo "Dumped $APP_LONG_NAME."
+        fi
+    fi
+}
+
+case "$1" in
+
+    'console')
+        checkUser touchlock $1
+        console
+        ;;
+
+    'start')
+        checkUser touchlock $1
+        start
+        ;;
+
+    'stop')
+        checkUser "" $1
+        stopit
+        ;;
+
+    'restart')
+        checkUser touchlock $1
+        stopit
+        start
+        ;;
+
+    'status')
+        checkUser "" $1
+        status
+        ;;
+
+    'dump')
+        checkUser "" $1
+        dump
+        ;;
+
+    *)
+        echo "Usage: $0 { console | start | stop | restart | status | dump }"
+        exit 1
+        ;;
+esac
+
+exit 0
\ 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	Wed Aug 22 23:37:02 2007
@@ -56,7 +56,6 @@
     <!--<parameter name="ModulesDirectory" locked="false">modules</parameter>-->
 
 
-
     <!--Following params will set the proper context paths for invocations. All the endpoints will have a commons context-->
     <!--root which can configured using the following contextRoot parameter-->
     <parameter name="contextRoot" locked="false">/</parameter>
@@ -105,11 +104,11 @@
     <!--format  serialization in Axis2. These message formats are expected to be resolved based on the content type. -->
     <messageFormatters>
         <messageFormatter contentType="application/x-www-form-urlencoded"
-                         class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
+                          class="org.apache.axis2.transport.http.XFormURLEncodedFormatter"/>
         <messageFormatter contentType="multipart/form-data"
-                         class="org.apache.axis2.transport.http.MultipartFormDataFormatter"/>
+                          class="org.apache.axis2.transport.http.MultipartFormDataFormatter"/>
         <messageFormatter contentType="application/xml"
-                         class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
+                          class="org.apache.axis2.transport.http.ApplicationXMLFormatter"/>
     </messageFormatters>
 
     <!-- ================================================= -->
@@ -119,11 +118,11 @@
     <!--formats in Axis2. These message formats are expected to be resolved based on the content type. -->
     <messageBuilders>
         <messageBuilder contentType="application/xml"
-                         class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
+                        class="org.apache.axis2.builder.ApplicationXMLBuilder"/>
         <messageBuilder contentType="application/x-www-form-urlencoded"
-                         class="org.apache.axis2.builder.XFormURLEncodedBuilder"/>
+                        class="org.apache.axis2.builder.XFormURLEncodedBuilder"/>
         <messageBuilder contentType="multipart/form-data"
-                         class="org.apache.axis2.builder.MultipartFormDataBuilder"/>
+                        class="org.apache.axis2.builder.MultipartFormDataBuilder"/>
     </messageBuilders>
 
     <!-- ================================================= -->
@@ -131,14 +130,14 @@
     <!-- ================================================= -->
     <!-- the non blocking http transport based on HttpCore + NIO extensions -->
     <transportReceiver name="http" class="org.apache.axis2.transport.nhttp.HttpCoreNIOListener">
-    	<parameter name="port" locked="false">8080</parameter>
-    	<parameter name="non-blocking" locked="false">true</parameter>
+        <parameter name="port" locked="false">8080</parameter>
+        <parameter name="non-blocking" locked="false">true</parameter>
     </transportReceiver>
 
     <!-- the non blocking https transport based on HttpCore + SSL-NIO extensions -->
     <transportReceiver name="https" class="org.apache.axis2.transport.nhttp.HttpCoreNIOSSLListener">
-    	<parameter name="port" locked="false">8443</parameter>
-    	<parameter name="non-blocking" locked="false">true</parameter>
+        <parameter name="port" locked="false">8443</parameter>
+        <parameter name="non-blocking" locked="false">true</parameter>
         <parameter name="keystore" locked="false">
             <KeyStore>
                 <Location>identity.jks</Location>
@@ -158,6 +157,11 @@
             supports optional|require or defaults to none -->
     </transportReceiver>
 
+    <transportReceiver name="admin/https" class="org.wso2.esb.transport.tomcat.HttpsTransportListener">
+        <!--<parameter name="port" locked="false">9443</parameter>-->
+        <!--<parameter name="non-blocking" locked="false">true</parameter>-->
+    </transportReceiver>
+
     <!--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">
@@ -183,9 +187,9 @@
     <!-- Transport Outs -->
     <!-- ================================================= -->
 
-    <transportSender name="jms"   class="org.apache.axis2.transport.jms.JMSSender"/>
+    <transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/>
     <!-- the non-blocking http transport based on HttpCore + NIO extensions -->
-    <transportSender name="http"  class="org.apache.axis2.transport.nhttp.HttpCoreNIOSender">
+    <transportSender name="http" class="org.apache.axis2.transport.nhttp.HttpCoreNIOSender">
         <parameter name="non-blocking" locked="false">true</parameter>
     </transportSender>
     <transportSender name="https" class="org.apache.axis2.transport.nhttp.HttpCoreNIOSSLSender">
@@ -238,40 +242,34 @@
         <!--  System pre defined phases       -->
         <phase name="Transport">
             <handler name="RequestURIBasedDispatcher"
-                     class="org.apache.axis2.engine.RequestURIBasedDispatcher">
+                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher">
                 <order phase="Transport"/>
             </handler>
             <handler name="SOAPActionBasedDispatcher"
-                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
+                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher">
                 <order phase="Transport"/>
             </handler>
         </phase>
+        <phase name="Addressing">
+            <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
+                <order phase="Addressing"/>
+            </handler>
+        </phase>
         <phase name="Security"/>
         <phase name="PreDispatch"/>
         <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
-            <handler name="AddressingBasedDispatcher"
-                     class="org.apache.axis2.engine.AddressingBasedDispatcher">
-                <order phase="Dispatch"/>
-            </handler>
+            <handler name="RequestURIBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
+            <handler name="SOAPActionBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
             <handler name="RequestURIOperationDispatcher"
-                     class="org.apache.axis2.engine.RequestURIOperationDispatcher">
-                <order phase="Dispatch"/>
-            </handler>
-
+                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
             <handler name="SOAPMessageBodyBasedDispatcher"
-                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
-                <order phase="Dispatch"/>
-            </handler>
+                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
 
             <handler name="HTTPLocationBasedDispatcher"
-                     class="org.apache.axis2.engine.HTTPLocationBasedDispatcher">
-                <order phase="Dispatch"/>
-            </handler>
-
-            <handler name="InstanceDispatcher"
-                     class="org.apache.axis2.engine.InstanceDispatcher">
-                <order phase="Dispatch"/>
-            </handler>
+                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
         </phase>
         <!--  System pre defined phases       -->
         <phase name="OpPhase"/>
@@ -294,41 +292,26 @@
         <phase name="Security"/>
     </phaseOrder>
     <phaseOrder type="InFaultFlow">
+        <phase name="Addressing">
+            <handler name="AddressingBasedDispatcher"
+                     class="org.apache.axis2.dispatchers.AddressingBasedDispatcher">
+                <order phase="Addressing"/>
+            </handler>
+        </phase>
+        <phase name="Security"/>
         <phase name="PreDispatch"/>
         <phase name="Dispatch" class="org.apache.axis2.engine.DispatchPhase">
             <handler name="RequestURIBasedDispatcher"
-                     class="org.apache.axis2.engine.RequestURIBasedDispatcher">
-                <order phase="Dispatch"/>
-            </handler>
-
+                     class="org.apache.axis2.dispatchers.RequestURIBasedDispatcher"/>
             <handler name="SOAPActionBasedDispatcher"
-                     class="org.apache.axis2.engine.SOAPActionBasedDispatcher">
-                <order phase="Dispatch"/>
-            </handler>
-
-            <handler name="AddressingBasedDispatcher"
-                     class="org.apache.axis2.engine.AddressingBasedDispatcher">
-                <order phase="Dispatch"/>
-            </handler>
+                     class="org.apache.axis2.dispatchers.SOAPActionBasedDispatcher"/>
             <handler name="RequestURIOperationDispatcher"
-                     class="org.apache.axis2.engine.RequestURIOperationDispatcher">
-                <order phase="Dispatch"/>
-            </handler>
-
+                     class="org.apache.axis2.dispatchers.RequestURIOperationDispatcher"/>
             <handler name="SOAPMessageBodyBasedDispatcher"
-                     class="org.apache.axis2.engine.SOAPMessageBodyBasedDispatcher">
-                <order phase="Dispatch"/>
-            </handler>
+                     class="org.apache.axis2.dispatchers.SOAPMessageBodyBasedDispatcher"/>
 
             <handler name="HTTPLocationBasedDispatcher"
-                     class="org.apache.axis2.engine.HTTPLocationBasedDispatcher">
-                <order phase="Dispatch"/>
-            </handler>
-
-            <handler name="InstanceDispatcher"
-                     class="org.apache.axis2.engine.InstanceDispatcher">
-                <order phase="PostDispatch"/>
-            </handler>
+                     class="org.apache.axis2.dispatchers.HTTPLocationBasedDispatcher"/>
         </phase>
         <!--      user can add his own phases to this area  -->
         <phase name="OpPhase"/>

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	Wed Aug 22 23:37:02 2007
@@ -24,16 +24,16 @@
 wrapper.java.library.path.2=./tomcat/lib
 
 # Java Additional Parameters
-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="../tomcat/lib/endorsed"
-wrapper.java.additional.6=-Desb.home="."
-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.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=../tomcat/lib/endorsed
+wrapper.java.additional.6=-Desb.home=.
+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"
+wrapper.java.additional.10=-Dlog4j.configuration=file:./webapp/WEB-INF/classes/conf/log4j.properties
 
 # Initial Java Heap Size (in MB)
 #wrapper.java.initmemory=3

Modified: trunk/esb/java/pom.xml
==============================================================================
--- trunk/esb/java/pom.xml	(original)
+++ trunk/esb/java/pom.xml	Wed Aug 22 23:37:02 2007
@@ -735,8 +735,7 @@
         <smack.version>2.2.1</smack.version>
 
         <!-- Axis2 1.2 and its dependencies -->
-        <axis2.version>1.2</axis2.version>
-        <rampart.version>SNAPSHOT</rampart.version>
+        <axis2.version>1.3</axis2.version>
         <axiom.version>1.2.4</axiom.version>
         <xml_schema.version>1.3.1</xml_schema.version>
         <wsdl4j.version>1.6.2</wsdl4j.version>
@@ -744,10 +743,11 @@
         <xerces.version>2.8.1</xerces.version>
         <xml_apis.version>1.3.03</xml_apis.version>
 
-        <!-- rampart, sandesha, neethi -->
-        <addressing.version>1.2</addressing.version>
+        <!-- addressing, rampart, sandesha, neethi -->
+        <addressing.version>1.3</addressing.version>
+        <rampart.version>SNAPSHOT</rampart.version>
         <sandesha2.version>SNAPSHOT</sandesha2.version>
-        <neethi.version>2.0.1</neethi.version>
+        <neethi.version>2.0.2</neethi.version>
         <wss4j.version>SNAPSHOT</wss4j.version>
 
         <!-- misc -->




More information about the Esb-java-dev mailing list