db-jdo-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c..@apache.org
Subject svn commit: r509807 - /db/jdo/trunk/api20/src/java/javax/jdo/JDOHelper.java
Date Tue, 20 Feb 2007 23:32:33 GMT
Author: clr
Date: Tue Feb 20 15:32:32 2007
New Revision: 509807

URL: http://svn.apache.org/viewvc?view=rev&rev=509807
Log:
JDO-444 Added public constructor and getInstance method to JDOHelper

Modified:
    db/jdo/trunk/api20/src/java/javax/jdo/JDOHelper.java

Modified: db/jdo/trunk/api20/src/java/javax/jdo/JDOHelper.java
URL: http://svn.apache.org/viewvc/db/jdo/trunk/api20/src/java/javax/jdo/JDOHelper.java?view=diff&rev=509807&r1=509806&r2=509807
==============================================================================
--- db/jdo/trunk/api20/src/java/javax/jdo/JDOHelper.java (original)
+++ db/jdo/trunk/api20/src/java/javax/jdo/JDOHelper.java Tue Feb 20 15:32:32 2007
@@ -33,6 +33,7 @@
 
 import java.util.ArrayList;
 import java.util.Collection;
+import java.util.HashMap;
 import java.util.Iterator;
 import java.util.Map;
 import java.util.Properties;
@@ -66,7 +67,7 @@
  * transactional, dirty, new, deleted, or detached; and to get its associated
  * <code>PersistenceManager</code> if it has one.
  * 
- * @version 2.0
+ * @version 2.1
  */
 public class JDOHelper extends Object {
       
@@ -87,7 +88,28 @@
             }
         );
 
-   /** The stateless instance used for handling non-binary-compatible
+    /** The singleton instance of JDOHelper.
+     * @since 2.1
+     */
+    private static JDOHelper instance = new JDOHelper();
+
+    /**
+     * Return the singleton instance of JDOHelper. This instance is 
+     * thread-safe.
+     * @since 2.1
+     * @return the thread-safe singleton JDOHelper
+     */
+    public static JDOHelper getInstance() {
+        return instance;
+    }
+
+    /** Some applications might prefer to use instance
+     * methods instead of static methods.
+     * @since 2.1
+     */
+    public JDOHelper() {}
+
+    /** The stateless instance used for handling non-binary-compatible
     *  implementations of getPersistenceManager.
     */
     static StateInterrogationObjectReturn getPersistenceManager =



Mime
View raw message