synapse-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From asan...@apache.org
Subject svn commit: r590925 - in /webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse: ServerManager.java config/SynapseConfiguration.java
Date Thu, 01 Nov 2007 08:13:31 GMT
Author: asankha
Date: Thu Nov  1 01:13:30 2007
New Revision: 590925

URL: http://svn.apache.org/viewvc?rev=590925&view=rev
Log:
start Tasks only after Synapse initialization is completed

Modified:
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ServerManager.java
    webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/SynapseConfiguration.java

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ServerManager.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ServerManager.java?rev=590925&r1=590924&r2=590925&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ServerManager.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/ServerManager.java
Thu Nov  1 01:13:30 2007
@@ -31,6 +31,7 @@
 import java.io.File;
 import java.net.ServerSocket;
 import java.util.Iterator;
+import java.util.Collection;
 
 /**
  * To manage the Synapse Server  instances. This class is responsible for
@@ -66,10 +67,10 @@
     public void start() {
 
         if (axis2Repolocation == null) {
-            System.out.println("The Axis2 Repository must be provided");
+            log.fatal("The Axis2 Repository must be provided");
             return;
         }
-        System.out.println("[SynapseServer] Using the Axis2 Repository "
+        log.info("Using the Axis2 Repository "
                            + new File(axis2Repolocation).getAbsolutePath());
         try {
             configctx = ConfigurationContextFactory.
@@ -94,7 +95,7 @@
                 if (trsIn.getParameter("port") != null) {
                     msg += " on port " + trsIn.getParameter("port").getValue();
                 }
-                System.out.println(msg);
+                log.info(msg);
             }
 
             // now initialize SynapseConfig
@@ -115,12 +116,21 @@
                 throw new SynapseException(message + "Synapse Environment");
             } else {
                 ((SynapseEnvironment) synEnv.getValue()).setInitialized(true);
+                // initialize the startups
+                Collection startups = ((SynapseConfiguration) synCfg.getValue()).getStartups();
+                for (Iterator it = startups.iterator(); it.hasNext();) {
+                    Object o = it.next();
+                    if (o instanceof ManagedLifecycle) {
+                        ManagedLifecycle m = (ManagedLifecycle) o;
+                        m.init((SynapseEnvironment) synEnv.getValue());
+                    }
+                }
             }
-            System.out.println("[SynapseServer] Ready");
+            log.info("Ready for processing");
 
         } catch (Throwable t) {
             t.printStackTrace();
-            System.out.println("[SynapseServer] Startup failed...");
+            log.fatal("[SynapseServer] Startup failed...");
         }
     }
 
@@ -176,7 +186,7 @@
                     trsIn.getParameter("port").setValue(Integer.toString(port));
                     break;
                 } catch (Exception e) {
-                    System.out.println("[SynapseServer] Port " + port + " already in use.
Trying alternate");
+                    log.warn("[SynapseServer] Port " + port + " already in use. Trying alternate");
                     if (port == 8080) {
                         port = 8008;
                     } else {

Modified: webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/SynapseConfiguration.java
URL: http://svn.apache.org/viewvc/webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/SynapseConfiguration.java?rev=590925&r1=590924&r2=590925&view=diff
==============================================================================
--- webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/SynapseConfiguration.java
(original)
+++ webservices/synapse/trunk/java/modules/core/src/main/java/org/apache/synapse/config/SynapseConfiguration.java
Thu Nov  1 01:13:30 2007
@@ -780,17 +780,6 @@
                 m.init(se);
             }
         }
-
-        // initialize the startups
-        if (startups != null) {
-            for (Iterator it = startups.values().iterator(); it.hasNext();) {
-                Object o = it.next();
-                if (o instanceof ManagedLifecycle) {
-                    ManagedLifecycle m = (ManagedLifecycle) o;
-                    m.init(se);
-                }
-            }
-        }
     }
 
     private void handleException(String msg) {



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


Mime
View raw message