Index: C:/Naidu/Projects/eclipse/june_policy_workspace/apache/imperius-splcore/src/main/java/org/apache/imperius/spl/datastore/impl/PolicyParserImpl.java =================================================================== --- C:/Naidu/Projects/eclipse/june_policy_workspace/apache/imperius-splcore/src/main/java/org/apache/imperius/spl/datastore/impl/PolicyParserImpl.java (revision 669804) +++ C:/Naidu/Projects/eclipse/june_policy_workspace/apache/imperius-splcore/src/main/java/org/apache/imperius/spl/datastore/impl/PolicyParserImpl.java (working copy) @@ -55,10 +55,10 @@ static boolean showTree = false; + private static PolicyParserImpl singletonObj = null; - public PolicyParserImpl() + private PolicyParserImpl() { - //System.out.println("in policyparserimpl ctor"); logger = SPLLogger.getSPLLogger().getLogger(); init(); } @@ -70,7 +70,16 @@ logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "init"); } - + + public static synchronized PolicyParserImpl getInstance() + { + if(singletonObj == null) + { + singletonObj = new PolicyParserImpl(); + } + return singletonObj; + } + public void shutDown() { logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "shutDown"); @@ -78,7 +87,7 @@ } - public SPLPolicy createInternalPolicyObject(String policyRuleName, + public synchronized SPLPolicy createInternalPolicyObject(String policyRuleName, String policyString) throws SPLException { logger.entering(sourceClass,Thread.currentThread().getName()+" " @@ -164,7 +173,7 @@ } - public static SPLPolicy doTreeAction(String f, AST t, String[] tokenNames) throws SPLException + public static synchronized SPLPolicy doTreeAction(String f, AST t, String[] tokenNames) throws SPLException { logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "doTreeAction");