camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject svn commit: r948652 - /camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
Date Thu, 27 May 2010 02:02:55 GMT
Author: ningjiang
Date: Thu May 27 02:02:55 2010
New Revision: 948652

URL: http://svn.apache.org/viewvc?rev=948652&view=rev
Log:
CAMEL-2751 Clean up the code of TimerEndpoint

Modified:
    camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java

Modified: camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
URL: http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java?rev=948652&r1=948651&r2=948652&view=diff
==============================================================================
--- camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
(original)
+++ camel/trunk/camel-core/src/main/java/org/apache/camel/component/timer/TimerEndpoint.java
Thu May 27 02:02:55 2010
@@ -147,20 +147,16 @@ public class TimerEndpoint extends Defau
         return true;
     }
 
-    public Timer getTimer() {
-        synchronized (this) {
-            if (timer == null) {
-                TimerComponent tc = (TimerComponent) getComponent();
-                timer = tc.getTimer(this);
-            }
-            return timer;
+    public synchronized Timer getTimer() {
+        if (timer == null) {
+            TimerComponent tc = (TimerComponent)getComponent();
+            timer = tc.getTimer(this);
         }
+        return timer;
     }
 
-    public void setTimer(Timer timer) {
-        synchronized (this) {
-            this.timer = timer;
-        }
+    public synchronized void setTimer(Timer timer) {
+        this.timer = timer;
     }
 
     @ManagedAttribute(description = "Camel id")



Mime
View raw message