directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r190942 - /directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/configuration/SyncConfiguration.java
Date Thu, 16 Jun 2005 16:12:40 GMT
Author: akarasulu
Date: Thu Jun 16 09:12:39 2005
New Revision: 190942

URL: http://svn.apache.org/viewcvs?rev=190942&view=rev
Log:
added static private instance that can be reused instead of creating new SC for every sync
operatin

Modified:
    directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/configuration/SyncConfiguration.java

Modified: directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/configuration/SyncConfiguration.java
URL: http://svn.apache.org/viewcvs/directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/configuration/SyncConfiguration.java?rev=190942&r1=190941&r2=190942&view=diff
==============================================================================
--- directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/configuration/SyncConfiguration.java
(original)
+++ directory/apacheds/trunk/core/src/main/java/org/apache/ldap/server/configuration/SyncConfiguration.java
Thu Jun 16 09:12:39 2005
@@ -26,6 +26,8 @@
  */
 public class SyncConfiguration extends Configuration
 {
+    private static SyncConfiguration instance = new SyncConfiguration();
+
     private static final long serialVersionUID = -3260859085299322327L;
 
     /**
@@ -33,5 +35,26 @@
      */
     public SyncConfiguration()
     {
+        if ( instance == null )
+        {
+            instance = this;
+        }
+    }
+
+
+    /**
+     * Returns existing static instance or creates a new one if
+     * it does not exist.
+     *
+     * @return a reusable static instance
+     */
+    public static SyncConfiguration getInstance()
+    {
+        if ( instance == null )
+        {
+            instance = new SyncConfiguration();
+        }
+
+        return instance;
     }
 }



Mime
View raw message