Index: C:/Naidu/Projects/eclipse/june_policy_workspace/apache/imperius-splcore/src/main/java/org/apache/imperius/spl/datastore/impl/PolicyDataStoreImpl.java =================================================================== --- C:/Naidu/Projects/eclipse/june_policy_workspace/apache/imperius-splcore/src/main/java/org/apache/imperius/spl/datastore/impl/PolicyDataStoreImpl.java (revision 669804) +++ C:/Naidu/Projects/eclipse/june_policy_workspace/apache/imperius-splcore/src/main/java/org/apache/imperius/spl/datastore/impl/PolicyDataStoreImpl.java (working copy) @@ -55,14 +55,14 @@ private PolicyRepository _policyRepository = null; - private static final String sourceClass = "PolicyDataStoreImpl"; private static Logger logger = SPLLogger.getSPLLogger().getLogger(); - public PolicyDataStoreImpl() + private static PolicyDataStoreImpl singletonObj = null; + + private PolicyDataStoreImpl() { - init(); } @@ -70,14 +70,22 @@ { logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "init"); - _policyCache = new PolicyCache(); - _policyRepository = new PolicyRepositoryImpl(); - _policyParser = new PolicyParserImpl(); + _policyCache = PolicyCache.getInstance(); + _policyRepository = PolicyRepositoryImpl.getInstance(); + _policyParser = PolicyParserImpl.getInstance(); logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "init"); } + + public static synchronized PolicyDataStoreImpl getInstance() + { + if(singletonObj == null) + { + singletonObj = new PolicyDataStoreImpl(); + } + return singletonObj; + } - public void shutdown() { logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "shutdown"); @@ -227,8 +235,8 @@ } - public SPLPolicy getInternalPolicyObject(String policyRuleName) - throws SPLException + public synchronized SPLPolicy getInternalPolicyObject(String policyRuleName) + throws SPLException { logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getInternalPolicyObject");