camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From w...@apache.org
Subject svn commit: r721772 - in /activemq/camel/branches/camel-1.x: ./ camel-core/src/main/java/org/apache/camel/impl/ camel-core/src/main/java/org/apache/camel/util/
Date Sun, 30 Nov 2008 06:53:16 GMT
Author: wtam
Date: Sat Nov 29 22:53:15 2008
New Revision: 721772

URL: http://svn.apache.org/viewvc?rev=721772&view=rev
Log:
[CAMEL-1060] Camel should log when its started

Modified:
    activemq/camel/branches/camel-1.x/   (props changed)
    activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
    activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/impl/ServiceSupport.java
    activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/MainSupport.java

Propchange: activemq/camel/branches/camel-1.x/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Sat Nov 29 22:53:15 2008
@@ -1 +1 @@
-/activemq/camel/trunk:709850,711200,711206,711219-711220,711523,711531,711756,711784,711859,711874,711962,711971,712064,712119,712148,712662,712692,712925,713013,713107,713136,713273,713290,713292,713295,713314,713475,713625,713932,713944,714032,717965,717989,718242,718273,718312-718515,719163-719184,719334,719339,719524,719662,719848,719851,719855,719864,719978-719979,720207,720435-720437,720806,721272,721331,721333-721334,721360,721669
+/activemq/camel/trunk:709850,711200,711206,711219-711220,711523,711531,711756,711784,711859,711874,711962,711971,712064,712119,712148,712662,712692,712925,713013,713107,713136,713273,713290,713292,713295,713314,713475,713625,713932,713944,714032,717965,717989,718242,718273,718312-718515,719163-719184,719334,719339,719524,719662,719848,719851,719855,719864,719978-719979,720207,720435-720437,720806,721272,721331,721333-721334,721360,721669,721764

Propchange: activemq/camel/branches/camel-1.x/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java?rev=721772&r1=721771&r2=721772&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
(original)
+++ activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/impl/DefaultCamelContext.java
Sat Nov 29 22:53:15 2008
@@ -600,6 +600,8 @@
     // -----------------------------------------------------------------------
 
     protected void doStart() throws Exception {
+        LOG.info("Apache Camel " + getVersion() + " (CamelContext:" + getName() + ") is starting");
+
         if (getTrace()) {
             // only add a new tracer if not already configued
             if (Tracer.getTracer(this) == null) {
@@ -630,6 +632,8 @@
         }
         startRouteDefinitions(routeDefinitions);
         startRoutes(routes);
+        
+        LOG.info("Apache Camel " + getVersion() + " (CamelContext:" + getName() + ") started");
     }
 
     protected void startRouteDefinitions(Collection<RouteType> list) throws Exception
{

Modified: activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/impl/ServiceSupport.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/impl/ServiceSupport.java?rev=721772&r1=721771&r2=721772&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/impl/ServiceSupport.java
(original)
+++ activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/impl/ServiceSupport.java
Sat Nov 29 22:53:15 2008
@@ -36,6 +36,7 @@
     private AtomicBoolean stopping = new AtomicBoolean(false);
     private AtomicBoolean stopped = new AtomicBoolean(false);
     private Collection childServices;
+    private String version;
 
     public void start() throws Exception {
         if (started.compareAndSet(false, true)) {
@@ -133,4 +134,25 @@
             return false;
         }
     }
+    
+    protected synchronized String getVersion() {
+        if (version != null) {
+            return version;
+        }
+        
+        Package aPackage = Package.getPackage("org.apache.camel");
+        if (aPackage != null) {
+            version = aPackage.getImplementationVersion();
+            if (version == null) {
+                version = aPackage.getSpecificationVersion();
+                if (version == null) {
+                    version = "";
+                }
+            }
+        } else {
+            version = "";
+        }
+        
+        return version;
+    }
 }

Modified: activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/MainSupport.java
URL: http://svn.apache.org/viewvc/activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/MainSupport.java?rev=721772&r1=721771&r2=721772&view=diff
==============================================================================
--- activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/MainSupport.java
(original)
+++ activemq/camel/branches/camel-1.x/camel-core/src/main/java/org/apache/camel/util/MainSupport.java
Sat Nov 29 22:53:15 2008
@@ -287,21 +287,6 @@
         }
     }
 
-    protected String getVersion() {
-        Package aPackage = Package.getPackage("org.apache.camel");
-        if (aPackage != null) {
-            String version = aPackage.getImplementationVersion();
-            if (version == null) {
-                version = aPackage.getSpecificationVersion();
-                if (version == null) {
-                    version = "";
-                }
-            }
-            return version;
-        }
-        return "";
-    }
-
     /**
      * Parses the command line arguments then runs the program
      */



Mime
View raw message