commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r925052 - /commons/proper/daemon/trunk/src/java/org/apache/commons/daemon/support/DaemonLoader.java
Date Fri, 19 Mar 2010 00:30:38 GMT
Author: sebb
Date: Fri Mar 19 00:30:38 2010
New Revision: 925052

URL: http://svn.apache.org/viewvc?rev=925052&view=rev
Log:
Context is only used in one method, so no point storing it in a private static variable
Document thread-safety of other static mutables

Modified:
    commons/proper/daemon/trunk/src/java/org/apache/commons/daemon/support/DaemonLoader.java

Modified: commons/proper/daemon/trunk/src/java/org/apache/commons/daemon/support/DaemonLoader.java
URL: http://svn.apache.org/viewvc/commons/proper/daemon/trunk/src/java/org/apache/commons/daemon/support/DaemonLoader.java?rev=925052&r1=925051&r2=925052&view=diff
==============================================================================
--- commons/proper/daemon/trunk/src/java/org/apache/commons/daemon/support/DaemonLoader.java
(original)
+++ commons/proper/daemon/trunk/src/java/org/apache/commons/daemon/support/DaemonLoader.java
Fri Mar 19 00:30:38 2010
@@ -30,14 +30,14 @@ import java.lang.reflect.Method;
 public final class DaemonLoader
 {
 
-    private static Controller controller = null;
-    private static Context context  = null;
-    private static Object daemon    = null;
+    // N.B. These static mutable variables need to be accessed using synch.
+    private static Controller controller = null; //@GuardedBy("this")
+    private static Object daemon    = null; //@GuardedBy("this")
     /* Methods to call */
-    private static Method init      = null;
-    private static Method start     = null;
-    private static Method stop      = null;
-    private static Method destroy   = null;
+    private static Method init      = null; //@GuardedBy("this")
+    private static Method start     = null; //@GuardedBy("this")
+    private static Method stop      = null; //@GuardedBy("this")
+    private static Method destroy   = null; //@GuardedBy("this")
 
     public static void version()
     {
@@ -154,7 +154,7 @@ public final class DaemonLoader
                 controller.setAvailable(false);
 
                 /* Create context */
-                context = new Context();
+                Context context = new Context();
                 context.setArguments(ar);
                 context.setController(controller);
 



Mime
View raw message