[jboss-cvs] JBossCache/src-50/org/jboss/cache/pojo/factory ...
Manik Surtani
msurtani at jboss.com
Tue Jan 2 13:26:06 EST 2007
User: msurtani
Date: 07/01/02 13:26:06
Modified: src-50/org/jboss/cache/pojo/factory PCacheFactory.java
Log:
Cleaned up cache factory
Revision Changes Path
1.3 +25 -4 JBossCache/src-50/org/jboss/cache/pojo/factory/PCacheFactory.java
(In the diff below, changes in quantity of whitespace are not shown.)
Index: PCacheFactory.java
===================================================================
RCS file: /cvsroot/jboss/JBossCache/src-50/org/jboss/cache/pojo/factory/PCacheFactory.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -b -r1.2 -r1.3
--- PCacheFactory.java 31 Oct 2006 06:57:28 -0000 1.2
+++ PCacheFactory.java 2 Jan 2007 18:26:06 -0000 1.3
@@ -7,11 +7,8 @@
package org.jboss.cache.pojo.factory;
+import org.jboss.cache.factories.CacheFactory;
import org.jboss.cache.factories.DefaultCacheFactory;
-import org.jboss.cache.Cache;
-import org.jboss.cache.pojo.PojoTreeCache;
-import org.jboss.cache.config.ConfigurationException;
-import org.jboss.cache.config.Configuration;
/**
* Implementation of the Cache Factory
@@ -20,4 +17,28 @@
*/
public class PCacheFactory extends DefaultCacheFactory
{
+ private static CacheFactory singleton = null;
+
+ /**
+ * Protected constructor to prevent instantiation
+ */
+ protected PCacheFactory()
+ {
+ // protected constructor to prevent instantiation
+ }
+
+ public static CacheFactory getInstance()
+ {
+ if (singleton == null)
+ {
+ synchronized (PCacheFactory.class)
+ {
+ if (singleton == null)
+ {
+ singleton = new PCacheFactory();
+ }
+ }
+ }
+ return singleton;
+ }
}
More information about the jboss-cvs-commits
mailing list