(no commit message)
[utils] / support / cdi / src / test / java / org / wamblee / cdi / MySingleton.java
index 4c5974001199562692fb40243be24854a3b091c9..60c0c06fd765a4b602f1b0b695c46549b9ddfda4 100644 (file)
@@ -17,18 +17,21 @@ package org.wamblee.cdi;
 
 import javax.enterprise.context.ApplicationScoped;
 
-
 @ApplicationScoped
 public class MySingleton {
-    
-    private static int instances = 0; 
 
-    public MySingleton() { 
-        System.out.println("Constructing object.");
-        instances++;
+    private static int INSTANCES = 0;
+
+    public MySingleton() {
+        INSTANCES++;
+    }
+
+    public static void reset() {
+        INSTANCES = 0;
     }
-    
+
     public static int getInstances() {
-        return instances;
+        return INSTANCES;
     }
+
 }