Author: indika
Date: Mon Dec  3 22:54:37 2007
New Revision: 10465

Log:

some clean up 


Removed:
   
trunk/esb/java/modules/core/src/test/java/org/wso2/esb/util/TestConstants.java
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/statistics/StatisticsReporterThread.java
   
trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/HttpsTransportListener.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/core/src/main/java/org/wso2/esb/util/HibernateConfig.java
   
trunk/esb/java/modules/core/src/main/java/org/wso2/esb/util/MIMEType2FileExtensionMap.java

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 Dec  3 22:54:37 2007
@@ -66,9 +66,7 @@
     private ServiceBusConfiguration esbConfiguration;
     private ConfigurationContext configurationContext;
     private NetworkServerControl networkServerControl;
-    /**
-     * The thread which reads statistics from memory and write them to the DB
-     */
+    /*The thread which reads statistics from memory and write them to the DB */
     private StatisticsReporterThread statisticsReporterThread;
     private static ServiceBusManager instance;
 

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 Dec  3 22:54:37 2007
@@ -37,18 +37,20 @@
 public class StatisticsReporterThread extends Thread {
 
     private static Logger log = 
Logger.getLogger(StatisticsReporterThread.class);
+
     private boolean shutdownRequested = false;
 
     PersistenceManager pm = new 
PersistenceManager(HibernateConfigFactory.getDefaultConfig(
-        org.wso2.esb.ServiceBusConstants.WSO2ESB_HB_CONFIG_KEY, 
System.getProperty(ServiceBusConstants.ESB_HIBERNATE_CFG_XML)));
+        org.wso2.esb.ServiceBusConstants.WSO2ESB_HB_CONFIG_KEY, 
System.getProperty(
+        ServiceBusConstants.ESB_HIBERNATE_CFG_XML)));
 
-    /** The reference to the synapse environment   */
+    /* The reference to the synapse environment   */
     private SynapseEnvironment synapseEnvironment;
 
-    /** IP Address of Server */
-    private   String ipAddr;
+    /* IP Address of Server */
+    private String ipAddr;
 
-    private long delay = 60*1000;
+    private long delay = 60 * 1000;
 
     /**
      * To construct it is need synapse Env. and PersistenceManager
@@ -111,9 +113,9 @@
                 Map proxyMap = new HashMap();
                 
proxyMap.putAll(statisticsCollector.getProxyServiceStatistics());
                 statisticsCollector.resetProxyServiceStatistics();
-                for (Iterator proxyServiceStatistics = 
proxyMap.values().iterator(); proxyServiceStatistics.hasNext();) {
+                for (Iterator psStats = proxyMap.values().iterator(); 
psStats.hasNext();) {
 
-                    Object statisticsHolderObject = 
proxyServiceStatistics.next();
+                    Object statisticsHolderObject = psStats.next();
                     if (statisticsHolderObject instanceof StatisticsHolder) {
                         StatisticsHolder statisticsHolder =
                             (StatisticsHolder) statisticsHolderObject;

Modified: 
trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/HttpsTransportListener.java
==============================================================================
--- 
trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/HttpsTransportListener.java
 (original)
+++ 
trunk/esb/java/modules/core/src/main/java/org/wso2/esb/transport/tomcat/HttpsTransportListener.java
 Mon Dec  3 22:54:37 2007
@@ -45,7 +45,16 @@
         this.configurationContext = configContext;
         Parameter portParam = transportIn.getParameter(PARAM_PORT);
         if (portParam != null) {
-            this.port = 
Integer.parseInt(portParam.getValue().toString().trim());
+            Object value = portParam.getValue();
+            if (value != null) {
+                try {
+                    this.port = Integer.parseInt(value.toString().trim());
+                } catch (NumberFormatException ignored) {
+                    this.port = ServiceBusManager.getInstance().getHttpsPort();
+                    log.info("The given port number( " + value + " ) was an 
invalid number." +
+                        " Therefore,the default port number ( " + this.port + 
" ) will use ");
+                }
+            }
         } else {
             this.port = ServiceBusManager.getInstance().getHttpsPort();
         }
@@ -61,13 +70,7 @@
         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);
-        }
+    public EndpointReference[] getEPRsForService(String serviceName, String 
ip) throws AxisFault {       
         return new EndpointReference[]{getEPRForService(serviceName, ip)};
     }
 }

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
 Mon Dec  3 22:54:37 2007
@@ -47,7 +47,6 @@
 
 public class StartUpServlet extends HttpServlet {
 
-    //     public static Map pages ;
     private static Log log = LogFactory.getLog(StartUpServlet.class);
     private final static String HAS_ALREADY_INIT = "hasAlreadyInit";
     private final static String TRUE = "true";

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
   Mon Dec  3 22:54:37 2007
@@ -81,8 +81,9 @@
         // Create a default virtual host
         Host defaultHost = embedded.createHost(host, webappsDir);
         engine.addChild(defaultHost);
-        String esbContextPath = 
XmlConfigurationFactory.getXmlConfiguration(ServiceBusConstants.ESB_WEB_XML_KEY).
-            getUniqueValue("//ns:[EMAIL PROTECTED]"admin\"]/ns:ContextPath");
+        String esbContextPath =
+            
XmlConfigurationFactory.getXmlConfiguration(ServiceBusConstants.ESB_WEB_XML_KEY).
+                getUniqueValue("//ns:[EMAIL 
PROTECTED]"admin\"]/ns:ContextPath");
 
         if (esbContextPath != null) {
             if (esbContextPath.equals("/")) {
@@ -116,7 +117,8 @@
         // Start the embedded server
         try {
             embedded.start();
-            log.info("Tomcat Server Started at  " + "https://"; + host + ":" + 
manager.getHttpsPort() + esbContextPath);
+            log.info("Tomcat Server Started at  " + "https://"; + host + ":"
+                + manager.getHttpsPort() + esbContextPath);
         } catch (Exception e) {
             log.fatal("Error starting embedded tomcat server : " + e);
         }
@@ -164,7 +166,6 @@
         Connector sslConnector =
             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/core/src/main/java/org/wso2/esb/util/HibernateConfig.java
==============================================================================
--- 
trunk/esb/java/modules/core/src/main/java/org/wso2/esb/util/HibernateConfig.java
    (original)
+++ 
trunk/esb/java/modules/core/src/main/java/org/wso2/esb/util/HibernateConfig.java
    Mon Dec  3 22:54:37 2007
@@ -27,8 +27,8 @@
  * Each of the modules/services deployed should also maintain there own single 
instance
  */
 public class HibernateConfig {
-    public final SessionFactory SESSION_FACTORY;
-    public final ThreadLocal SESSION = new ThreadLocal();
+    private final SessionFactory SESSION_FACTORY;
+    private final ThreadLocal SESSION = new ThreadLocal();
 
     /**
      * Constructor for initializing this Object providing the DB Connection 
Identifier
@@ -125,8 +125,9 @@
      * <p/>
      * This will pickup hibernate.cfg.xml from the classpath
      * and load the configuration from this file.
+     * @param conFigFileName   hibernate.cfg.xml - hibernate configuration file
      */
-    HibernateConfig(String conFigFileName) {
+    public HibernateConfig(String conFigFileName) {
         try {
             // Create the SessionFactory from hibernate.cfg.xml, which has to 
be in the classpath
             SESSION_FACTORY =

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 Dec  3 22:54:37 2007
@@ -12,7 +12,7 @@
 
 public class MIMEType2FileExtensionMap {
     private Map extensionToMimeMap;
-    public static MIMEType2FileExtensionMap instance;
+    private static MIMEType2FileExtensionMap instance;
     private static Logger log = 
Logger.getLogger(MIMEType2FileExtensionMap.class);
 
     public static MIMEType2FileExtensionMap getInstance(){

_______________________________________________
Esb-java-dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/esb-java-dev

Reply via email to