incubator-imperius-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ke...@apache.org
Subject svn commit: r611261 [5/43] - in /incubator/imperius/trunk: ./ imperius-javaspl/ imperius-javaspl/src/main/java/org/apache/imperius/javaspl/ imperius-splcore/ imperius-splcore/src/main/antlr/org/apache/imperius/spl/parser/compiler/ imperius-splcore/src/...
Date Fri, 11 Jan 2008 18:57:14 GMT
Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/datastore/impl/PolicyRepositoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/datastore/impl/PolicyRepositoryImpl.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/datastore/impl/PolicyRepositoryImpl.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/datastore/impl/PolicyRepositoryImpl.java Fri Jan 11 10:56:30 2008
@@ -1,387 +1,387 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Prashant Baliga <prabalig@in.ibm.com>
- *
- * Modified : 11/1/07 
- * Store policy objects individually
- */
-
-package org.apache.imperius.spl.datastore.impl;
-
-import java.io.FileInputStream;
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.util.*;
-import java.util.logging.*;
-
-import org.apache.imperius.spl.datastore.PolicyRepository;
-import org.apache.imperius.spl.parser.exceptions.*;
-import org.apache.imperius.util.SPLLogger;
-
-
-
-public class PolicyRepositoryImpl implements PolicyRepository
-{
-
-    private static HashMap _policyMap = new HashMap();
-
-  
-    private static String _fileName = null;
-
-
-    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-
-    private static final String sourceClass = "PolicyRepositoryImpl";
-    
-    PolicyRepositoryImpl()
-    {
-    	init();
-    }
-
-    public void init() 
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "init");
-       _fileName = SPLLogger.SPL_HOME + SPLLogger.fileSeparator
-                + "PolicyStorage.DAT";
-//        POLICY_CLASS_NAME = "CIM_SPLPolicyRule";
-//        NAMESPACE = "root/cimv2";
-        _readSerializedPolicyStorage();
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "init");
-    }
-
-    public void shutdown()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "shutdown");
-        // TODO Auto-generated method stub
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "shutdown");
-    }
-
-    public Map getAllPolicies() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getAllPolicies");
-        Map allPolicies = new Hashtable();
-        _readSerializedPolicyStorage();
-        Iterator instanceKeySet = _policyMap.keySet().iterator();
-        while (instanceKeySet.hasNext())
-        {
-            // to allPolicies and return it
-            String key = (String) instanceKeySet.next();
-            String policyString = (String)_policyMap.get(key);
-            allPolicies.put(key, policyString);
-          
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getAllPolicies");
-        return allPolicies;
-    }
-
-    public List getAllPolicyNames() throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getAllPolicyNames");
-        List policyNames = new ArrayList();
-        _readSerializedPolicyStorage();
-        
-        Iterator instanceKeySet = _policyMap.keySet().iterator();
-        while (instanceKeySet.hasNext())
-        {
-            // add all Policy names from policyMap to PolicyNames and return it
-            String policyName = (String) instanceKeySet.next();
-            policyNames.add(policyName);
-            
-        }
-        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getAllPolicyNames");
-        return policyNames;
-    }
-
-    public void updatePolicy(String policyRuleName, String policyString)
-            throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "updatePolicy");
-        _readSerializedPolicyStorage();
-        
-        if (policyRuleName != null && policyString != null)
-        {
-            
-            if (_policyMap.containsKey(policyRuleName))
-            {
-                if (logger.isLoggable(Level.FINE))
-                {	
-                    logger.fine(Thread.currentThread().getName()+" updating Repository");
-                }    
-                // updating Repository
-                deletePolicy(policyRuleName);
-                insertPolicy(policyRuleName, policyString);
-                _serializePolicyStorage();
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "updatePolicy");
-            }
-            else
-            {
-                logger.severe(Thread.currentThread().getName()+" "+"The Policy does not exist");
-                throw new PolicyDoesNotExistException(
-                        "The Policy does not exist");
-            }
-        }
-        else
-        {
-            logger.severe(Thread.currentThread().getName()+" " + 
-            		"The Policy cannot be found due to Invalid Policy Parameters");
-            throw new InvalidPolicyParameterException(
-                    "The Policy cannot be found due to Invalid Policy Parameters");
-        }
-    }
-
-    public String getPolicyString(String policyRuleName) throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getPolicy");
-        _readSerializedPolicyStorage();
-        
-        if (policyRuleName != null)
-        {
-            if (_policyMap.containsKey(policyRuleName))
-            {
-                if (logger.isLoggable(Level.FINE))
-                {	
-                    logger.fine(Thread.currentThread().getName()+ 
-                    		" return Policy from policyMap");
-                }    
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getPolicy");
-                // return Policy from policyMap
-                String policy = (String) _policyMap.get(policyRuleName);
-                return policy;
-            }
-            else
-            {
-                logger.severe(Thread.currentThread().getName()+" "+"The Policy does not exist");
-                throw new PolicyDoesNotExistException(
-                        "The Policy does not exist");
-            }
-        }
-        else
-        {
-            logger.severe(Thread.currentThread().getName()+" " + 
-                    		"The Policy cannot be found due to Invalid Policy Parameters");
-            throw new InvalidPolicyParameterException(
-                    "The Policy cannot be found due to Invalid Policy Parameters");
-        }
-    }
-
-    public boolean insertPolicy(String policyRuleName, String policyString)
-            throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "insertPolicy");
-        _readSerializedPolicyStorage();
-        
-        if (policyRuleName != null && policyString != null)
-        {
-            
-            if (_policyMap.containsKey(policyRuleName))
-            {
-                logger.severe(Thread.currentThread().getName()+" "+"The Policy already Exists");
-                throw new PolicyAlreadyExistsInRepositoryException(
-                        "The Policy already Exists");
-            }
-            else
-            {
-                if (logger.isLoggable(Level.FINE))
-                    logger.fine(Thread.currentThread().getName()+" add policy to policyMap ");
-                // add policy to policyMap
-                _policyMap.put((String) policyRuleName, (String) policyString);
-                _serializePolicyStorage();
-
-                
-                
-                return true;
-            }
-        }
-        else
-        {
-            logger.severe(Thread.currentThread().getName()+" " + 
-            		"The Policy cannot be found due to Invalid Policy Parameters");
-            throw new InvalidPolicyParameterException(
-                    "The Policy cannot be found due to Invalid Policy Parameters");
-        }
-    }
-
-    /**
-     * removes a policy from the Hashtable
-     * 
-     * @param PolicyRuleName
-     * @throws CIMException
-     */
-    public void deletePolicy(String policyRuleName) throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "deletePolicy");
-        _readSerializedPolicyStorage();
-        
-        if (policyRuleName != null)
-        {
-            
-            if (!_policyMap.containsKey(policyRuleName))
-            {
-                logger.severe(Thread.currentThread().getName()+" "+"The Policy does not exist");
-                throw new PolicyDoesNotExistException(
-                        "The Policy does not exist");
-            }
-            else
-            {
-                if (logger.isLoggable(Level.FINE))
-                {	
-                    logger.fine(Thread.currentThread().getName() + 
-                    		" removing policy from policyMap");
-                }    
-                // removing policy from policyMap
-                _policyMap.remove(policyRuleName);
-                _serializePolicyStorage();
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "deletePolicy");
-            }
-        }
-        else
-        {
-            logger.severe(Thread.currentThread().getName()+" " + 
-                    		"The Policy cannot be found due to Invalid Policy Parameters");
-            throw new InvalidPolicyParameterException(
-                    "The Policy cannot be found due to Invalid Policy Parameters");
-        }
-    }
-
-    public boolean policyExists(String PolicyRuleName) throws SPLException
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "policyExists");
-        _readSerializedPolicyStorage();
-        
-        if (PolicyRuleName != null)
-        {
-            if (logger.isLoggable(Level.FINE))
-            {	
-                logger.fine(Thread.currentThread().getName()+ 
-                		" check to see if Policy exists in policyMap");
-            }    
-            // check to see if Policy exists in policyMap
-            
-            if (_policyMap.containsKey(PolicyRuleName))
-            {
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "policyExists");
-                return true;
-            }
-
-            else
-            {
-                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "policyExists");
-                return false;
-            }
-
-        }
-        else
-        {
-            logger.severe(Thread.currentThread().getName()+" " + 
-                    		"The Policy cannot be found due to Invalid Policy Parameters");
-            throw new InvalidPolicyParameterException(
-                    "The Policy cannot be found due to Invalid Policy Parameters");
-        }
-    }
-
-  
-
-   
-
-    synchronized private static void _readSerializedPolicyStorage()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" " +
-        		"_readSerializedPolicyStorage");
-        FileInputStream fis = null;
-        ObjectInputStream in = null;
-        File file = new File(_fileName);
-        try
-        {
-            if (logger.isLoggable(Level.FINE))
-            {	
-                logger.fine(Thread.currentThread().getName() + 
-                		" read from the serialized file if it exists, else create" +
-                		"it and serialize an empty policyMap to it");
-            }    
-            // read from the serialized file if it exists, else create it and
-            // serialize an empty policyMap to it
-            if (!file.exists())
-            {
-                
-                FileOutputStream fos = new FileOutputStream(file);
-                ObjectOutputStream out = new ObjectOutputStream(fos);
-                out.writeObject(_policyMap);
-                out.close();
-                fos.close();
-            }
-
-            fis = new FileInputStream(file);
-            in = new ObjectInputStream(fis);
-            _policyMap = (HashMap) in.readObject();
-
-            in.close();
-            fis.close();
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" " + 
-            		"_readSerializedPolicyStorage");
-        }
-        catch (IOException ex)
-        {
-            logger.severe(Thread.currentThread().getName()+" " + 
-            		"Error reading serialized policyMap");
-            ex.printStackTrace();
-        }
-        catch (ClassNotFoundException ex)
-        {
-            logger.severe(Thread.currentThread().getName()+" " + 
-                    		"Error reading seralized policyMap Object: class not found");
-            ex.printStackTrace();
-        }
-
-    }
-
-    synchronized private static void _serializePolicyStorage()
-    {
-        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "_serializePolicyStorage");
-        FileOutputStream fos = null;
-        ObjectOutputStream out = null;
-        
-        File file = new File(_fileName);
-        try
-        {
-            if (logger.isLoggable(Level.FINE))
-            {	
-                logger.fine(Thread.currentThread().getName() + 
-                		" serialize an policyMap to File System");
-            }    
-            // serialize an policyMap to File System
-
-            
-            fos = new FileOutputStream(file);
-            out = new ObjectOutputStream(fos);
-            out.writeObject(_policyMap);
-            out.close();
-            fos.close();
-            logger.exiting(sourceClass,Thread.currentThread().getName()+" " +
-            		"_serializePolicyStorage");
-        }
-        catch (IOException ex)
-        {
-            logger.severe(Thread.currentThread().getName()+" "+"Error serializing policyMap");
-            ex.printStackTrace();
-        }
-    }
-
-	
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Prashant Baliga <prabalig@in.ibm.com>
+ *
+ * Modified : 11/1/07 
+ * Store policy objects individually
+ */
+
+package org.apache.imperius.spl.datastore.impl;
+
+import java.io.FileInputStream;
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.util.*;
+import java.util.logging.*;
+
+import org.apache.imperius.spl.datastore.PolicyRepository;
+import org.apache.imperius.spl.parser.exceptions.*;
+import org.apache.imperius.util.SPLLogger;
+
+
+
+public class PolicyRepositoryImpl implements PolicyRepository
+{
+
+    private static HashMap _policyMap = new HashMap();
+
+  
+    private static String _fileName = null;
+
+
+    private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+
+    private static final String sourceClass = "PolicyRepositoryImpl";
+    
+    PolicyRepositoryImpl()
+    {
+    	init();
+    }
+
+    public void init() 
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "init");
+       _fileName = SPLLogger.SPL_HOME + SPLLogger.fileSeparator
+                + "PolicyStorage.DAT";
+//        POLICY_CLASS_NAME = "CIM_SPLPolicyRule";
+//        NAMESPACE = "root/cimv2";
+        _readSerializedPolicyStorage();
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "init");
+    }
+
+    public void shutdown()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "shutdown");
+        // TODO Auto-generated method stub
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "shutdown");
+    }
+
+    public Map getAllPolicies() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getAllPolicies");
+        Map allPolicies = new Hashtable();
+        _readSerializedPolicyStorage();
+        Iterator instanceKeySet = _policyMap.keySet().iterator();
+        while (instanceKeySet.hasNext())
+        {
+            // to allPolicies and return it
+            String key = (String) instanceKeySet.next();
+            String policyString = (String)_policyMap.get(key);
+            allPolicies.put(key, policyString);
+          
+        }
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getAllPolicies");
+        return allPolicies;
+    }
+
+    public List getAllPolicyNames() throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getAllPolicyNames");
+        List policyNames = new ArrayList();
+        _readSerializedPolicyStorage();
+        
+        Iterator instanceKeySet = _policyMap.keySet().iterator();
+        while (instanceKeySet.hasNext())
+        {
+            // add all Policy names from policyMap to PolicyNames and return it
+            String policyName = (String) instanceKeySet.next();
+            policyNames.add(policyName);
+            
+        }
+        logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getAllPolicyNames");
+        return policyNames;
+    }
+
+    public void updatePolicy(String policyRuleName, String policyString)
+            throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "updatePolicy");
+        _readSerializedPolicyStorage();
+        
+        if (policyRuleName != null && policyString != null)
+        {
+            
+            if (_policyMap.containsKey(policyRuleName))
+            {
+                if (logger.isLoggable(Level.FINE))
+                {	
+                    logger.fine(Thread.currentThread().getName()+" updating Repository");
+                }    
+                // updating Repository
+                deletePolicy(policyRuleName);
+                insertPolicy(policyRuleName, policyString);
+                _serializePolicyStorage();
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "updatePolicy");
+            }
+            else
+            {
+                logger.severe(Thread.currentThread().getName()+" "+"The Policy does not exist");
+                throw new PolicyDoesNotExistException(
+                        "The Policy does not exist");
+            }
+        }
+        else
+        {
+            logger.severe(Thread.currentThread().getName()+" " + 
+            		"The Policy cannot be found due to Invalid Policy Parameters");
+            throw new InvalidPolicyParameterException(
+                    "The Policy cannot be found due to Invalid Policy Parameters");
+        }
+    }
+
+    public String getPolicyString(String policyRuleName) throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "getPolicy");
+        _readSerializedPolicyStorage();
+        
+        if (policyRuleName != null)
+        {
+            if (_policyMap.containsKey(policyRuleName))
+            {
+                if (logger.isLoggable(Level.FINE))
+                {	
+                    logger.fine(Thread.currentThread().getName()+ 
+                    		" return Policy from policyMap");
+                }    
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "getPolicy");
+                // return Policy from policyMap
+                String policy = (String) _policyMap.get(policyRuleName);
+                return policy;
+            }
+            else
+            {
+                logger.severe(Thread.currentThread().getName()+" "+"The Policy does not exist");
+                throw new PolicyDoesNotExistException(
+                        "The Policy does not exist");
+            }
+        }
+        else
+        {
+            logger.severe(Thread.currentThread().getName()+" " + 
+                    		"The Policy cannot be found due to Invalid Policy Parameters");
+            throw new InvalidPolicyParameterException(
+                    "The Policy cannot be found due to Invalid Policy Parameters");
+        }
+    }
+
+    public boolean insertPolicy(String policyRuleName, String policyString)
+            throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "insertPolicy");
+        _readSerializedPolicyStorage();
+        
+        if (policyRuleName != null && policyString != null)
+        {
+            
+            if (_policyMap.containsKey(policyRuleName))
+            {
+                logger.severe(Thread.currentThread().getName()+" "+"The Policy already Exists");
+                throw new PolicyAlreadyExistsInRepositoryException(
+                        "The Policy already Exists");
+            }
+            else
+            {
+                if (logger.isLoggable(Level.FINE))
+                    logger.fine(Thread.currentThread().getName()+" add policy to policyMap ");
+                // add policy to policyMap
+                _policyMap.put((String) policyRuleName, (String) policyString);
+                _serializePolicyStorage();
+
+                
+                
+                return true;
+            }
+        }
+        else
+        {
+            logger.severe(Thread.currentThread().getName()+" " + 
+            		"The Policy cannot be found due to Invalid Policy Parameters");
+            throw new InvalidPolicyParameterException(
+                    "The Policy cannot be found due to Invalid Policy Parameters");
+        }
+    }
+
+    /**
+     * removes a policy from the Hashtable
+     * 
+     * @param PolicyRuleName
+     * @throws CIMException
+     */
+    public void deletePolicy(String policyRuleName) throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "deletePolicy");
+        _readSerializedPolicyStorage();
+        
+        if (policyRuleName != null)
+        {
+            
+            if (!_policyMap.containsKey(policyRuleName))
+            {
+                logger.severe(Thread.currentThread().getName()+" "+"The Policy does not exist");
+                throw new PolicyDoesNotExistException(
+                        "The Policy does not exist");
+            }
+            else
+            {
+                if (logger.isLoggable(Level.FINE))
+                {	
+                    logger.fine(Thread.currentThread().getName() + 
+                    		" removing policy from policyMap");
+                }    
+                // removing policy from policyMap
+                _policyMap.remove(policyRuleName);
+                _serializePolicyStorage();
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "deletePolicy");
+            }
+        }
+        else
+        {
+            logger.severe(Thread.currentThread().getName()+" " + 
+                    		"The Policy cannot be found due to Invalid Policy Parameters");
+            throw new InvalidPolicyParameterException(
+                    "The Policy cannot be found due to Invalid Policy Parameters");
+        }
+    }
+
+    public boolean policyExists(String PolicyRuleName) throws SPLException
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "policyExists");
+        _readSerializedPolicyStorage();
+        
+        if (PolicyRuleName != null)
+        {
+            if (logger.isLoggable(Level.FINE))
+            {	
+                logger.fine(Thread.currentThread().getName()+ 
+                		" check to see if Policy exists in policyMap");
+            }    
+            // check to see if Policy exists in policyMap
+            
+            if (_policyMap.containsKey(PolicyRuleName))
+            {
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "policyExists");
+                return true;
+            }
+
+            else
+            {
+                logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "policyExists");
+                return false;
+            }
+
+        }
+        else
+        {
+            logger.severe(Thread.currentThread().getName()+" " + 
+                    		"The Policy cannot be found due to Invalid Policy Parameters");
+            throw new InvalidPolicyParameterException(
+                    "The Policy cannot be found due to Invalid Policy Parameters");
+        }
+    }
+
+  
+
+   
+
+    synchronized private static void _readSerializedPolicyStorage()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" " +
+        		"_readSerializedPolicyStorage");
+        FileInputStream fis = null;
+        ObjectInputStream in = null;
+        File file = new File(_fileName);
+        try
+        {
+            if (logger.isLoggable(Level.FINE))
+            {	
+                logger.fine(Thread.currentThread().getName() + 
+                		" read from the serialized file if it exists, else create" +
+                		"it and serialize an empty policyMap to it");
+            }    
+            // read from the serialized file if it exists, else create it and
+            // serialize an empty policyMap to it
+            if (!file.exists())
+            {
+                
+                FileOutputStream fos = new FileOutputStream(file);
+                ObjectOutputStream out = new ObjectOutputStream(fos);
+                out.writeObject(_policyMap);
+                out.close();
+                fos.close();
+            }
+
+            fis = new FileInputStream(file);
+            in = new ObjectInputStream(fis);
+            _policyMap = (HashMap) in.readObject();
+
+            in.close();
+            fis.close();
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" " + 
+            		"_readSerializedPolicyStorage");
+        }
+        catch (IOException ex)
+        {
+            logger.severe(Thread.currentThread().getName()+" " + 
+            		"Error reading serialized policyMap");
+            ex.printStackTrace();
+        }
+        catch (ClassNotFoundException ex)
+        {
+            logger.severe(Thread.currentThread().getName()+" " + 
+                    		"Error reading seralized policyMap Object: class not found");
+            ex.printStackTrace();
+        }
+
+    }
+
+    synchronized private static void _serializePolicyStorage()
+    {
+        logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "_serializePolicyStorage");
+        FileOutputStream fos = null;
+        ObjectOutputStream out = null;
+        
+        File file = new File(_fileName);
+        try
+        {
+            if (logger.isLoggable(Level.FINE))
+            {	
+                logger.fine(Thread.currentThread().getName() + 
+                		" serialize an policyMap to File System");
+            }    
+            // serialize an policyMap to File System
+
+            
+            fos = new FileOutputStream(file);
+            out = new ObjectOutputStream(fos);
+            out.writeObject(_policyMap);
+            out.close();
+            fos.close();
+            logger.exiting(sourceClass,Thread.currentThread().getName()+" " +
+            		"_serializePolicyStorage");
+        }
+        catch (IOException ex)
+        {
+            logger.severe(Thread.currentThread().getName()+" "+"Error serializing policyMap");
+            ex.printStackTrace();
+        }
+    }
+
+	
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/datastore/impl/PolicyRepositoryImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/PolicyEvaluator.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/PolicyEvaluator.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/PolicyEvaluator.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/PolicyEvaluator.java Fri Jan 11 10:56:30 2008
@@ -1,39 +1,39 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Prashant Baliga <prabalig@in.ibm.com>
- *
- */
-
-package org.apache.imperius.spl.evaluator;
-
-
-import java.util.Map;
-
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.statements.impl.SPLPolicy;
-
-
-public interface PolicyEvaluator
-{
-    
-    public Object evaluatePolicy(SPLPolicy cp, Map instances) throws SPLException;
-    
-    public void init() throws SPLException;
-    
-    public void shutdown() ;
-    
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Prashant Baliga <prabalig@in.ibm.com>
+ *
+ */
+
+package org.apache.imperius.spl.evaluator;
+
+
+import java.util.Map;
+
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.statements.impl.SPLPolicy;
+
+
+public interface PolicyEvaluator
+{
+    
+    public Object evaluatePolicy(SPLPolicy cp, Map instances) throws SPLException;
+    
+    public void init() throws SPLException;
+    
+    public void shutdown() ;
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/PolicyEvaluator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/impl/PolicyEvaluatorImpl.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/impl/PolicyEvaluatorImpl.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/impl/PolicyEvaluatorImpl.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/impl/PolicyEvaluatorImpl.java Fri Jan 11 10:56:30 2008
@@ -1,188 +1,188 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Prashant Baliga <prabalig@in.ibm.com>
- *
- */
-
-
-
-package org.apache.imperius.spl.evaluator.impl;
-
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.apache.imperius.spl.evaluator.PolicyEvaluator;
-import org.apache.imperius.spl.external.Actuator;
-import org.apache.imperius.spl.external.DataCollector;
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.statements.impl.SPLPolicy;
-import org.apache.imperius.spl.parser.util.ActuatorFactory;
-import org.apache.imperius.spl.parser.util.DataCollectorFactory;
-import org.apache.imperius.util.SPLLogger;
-
-
-
-public class PolicyEvaluatorImpl implements PolicyEvaluator 
-{
-
-	private static final String sourceClass="PolicyEvaluatorImpl";
-	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
-	private static Logger auditLogger = SPLLogger.getSPLLogger().getAuditLogger();
-	
-	private DataCollector _dataCollector;
-	private Actuator _actuator;
-
-	public static final int SUCCESS = 1;
-	public static final int FAILURE = -1;
-	public static final int NOT_EVALUATED = 0;
-
-	public PolicyEvaluatorImpl()
-	{
-		init();
-	}
-
-	public void init() 
-	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "init");
-		_dataCollector = DataCollectorFactory.getDataCollector();
-
-		_actuator = ActuatorFactory.getActuator();
-
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "init");
-
-	}
-
-	public void shutdown() 
-	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "shutdown");
-		//PolicyLogger.log("PolicyEvaluatorImpl::shutdown");
-		// TODO Auto-generated method stub
-		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "shutdown");
-
-	}
-
-	public Object evaluatePolicy(SPLPolicy cp, Map instances) throws SPLException 
-	{
-		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluatePolicy");
-		try
-		{	
-			//testing out actual datacollector
-
-			if(logger.isLoggable(Level.FINE))
-			{	
-				logger.fine(Thread.currentThread().getName()+
-				" Policy Evaluator calling evaluate method of SPLPolicy");
-			}	
-			int result= FAILURE;
-			if(instances != null)
-			{
-
-				if(logger.isLoggable(Level.FINE))
-				{	
-					logger.fine(Thread.currentThread().getName()+" copList!=null ");
-				}    
-				if(!instances.isEmpty() && instances.size()>0)
-				{
-					if(logger.isLoggable(Level.FINE))
-					{	
-						logger.fine(Thread.currentThread().getName() + 
-								" evaluating policy against instances");
-					}    
-					result = cp.evaluate(_dataCollector,_actuator,instances); 
-					if(auditLogger.isLoggable(Level.FINE))
-					{	
-						auditLogger.fine(Thread.currentThread().getName() + "\n"+ 
-								cp.getAuditLogString());
-					}
-					if(logger.isLoggable(Level.FINE))
-					{	
-						logger.fine(Thread.currentThread().getName() + 
-								" policy evaluation result = "+result);
-					} 
-				}
-				else
-				{
-					if(logger.isLoggable(Level.FINE))
-					{	
-						logger.fine(Thread.currentThread().getName() + 
-								" copList!=null but size="+instances.size()+" "+instances.toString());
-					}    
-				}
-			}
-			else
-			{
-
-				if(logger.isLoggable(Level.FINE))
-				{	
-					logger.fine(Thread.currentThread().getName()+" copList=null");
-				}    
-				throw new SPLException("Zero instances passed for evaluation");
-
-
-			}
-
-			if(logger.isLoggable(Level.FINE))
-			{	
-				logger.fine(Thread.currentThread().getName() + 
-						" PolicyEvaluator is done evaluating, result : "+result);
-			}	
-			logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluatePolicy");
-			if(logger.isLoggable(Level.FINE))
-			{	
-				logger.fine(Thread.currentThread().getName()+" returned 1 to client");
-			}	
-			if(result==SUCCESS)
-			{
-
-				if(!ReturnObjectStore.hasReturnValues())
-				{	
-					return new Integer(1);
-				}
-				else
-				{
-					Object returnObjectList = ReturnObjectStore.getReturnValues();
-
-					return returnObjectList;
-				}
-			}
-			else
-			{
-
-
-
-				return new Integer(FAILURE);
-			}
-
-		}
-		catch (SPLException e) 
-		{
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-			return null;
-		}
-		catch (Exception e) {
-			// TODO Auto-generated catch block
-			e.printStackTrace();
-			return null;
-		}
-
-	}
-
-	
-
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Prashant Baliga <prabalig@in.ibm.com>
+ *
+ */
+
+
+
+package org.apache.imperius.spl.evaluator.impl;
+
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import org.apache.imperius.spl.evaluator.PolicyEvaluator;
+import org.apache.imperius.spl.external.Actuator;
+import org.apache.imperius.spl.external.DataCollector;
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.statements.impl.SPLPolicy;
+import org.apache.imperius.spl.parser.util.ActuatorFactory;
+import org.apache.imperius.spl.parser.util.DataCollectorFactory;
+import org.apache.imperius.util.SPLLogger;
+
+
+
+public class PolicyEvaluatorImpl implements PolicyEvaluator 
+{
+
+	private static final String sourceClass="PolicyEvaluatorImpl";
+	private static Logger logger = SPLLogger.getSPLLogger().getLogger();
+	private static Logger auditLogger = SPLLogger.getSPLLogger().getAuditLogger();
+	
+	private DataCollector _dataCollector;
+	private Actuator _actuator;
+
+	public static final int SUCCESS = 1;
+	public static final int FAILURE = -1;
+	public static final int NOT_EVALUATED = 0;
+
+	public PolicyEvaluatorImpl()
+	{
+		init();
+	}
+
+	public void init() 
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "init");
+		_dataCollector = DataCollectorFactory.getDataCollector();
+
+		_actuator = ActuatorFactory.getActuator();
+
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "init");
+
+	}
+
+	public void shutdown() 
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "shutdown");
+		//PolicyLogger.log("PolicyEvaluatorImpl::shutdown");
+		// TODO Auto-generated method stub
+		logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "shutdown");
+
+	}
+
+	public Object evaluatePolicy(SPLPolicy cp, Map instances) throws SPLException 
+	{
+		logger.entering(sourceClass,Thread.currentThread().getName()+" "+ "evaluatePolicy");
+		try
+		{	
+			//testing out actual datacollector
+
+			if(logger.isLoggable(Level.FINE))
+			{	
+				logger.fine(Thread.currentThread().getName()+
+				" Policy Evaluator calling evaluate method of SPLPolicy");
+			}	
+			int result= FAILURE;
+			if(instances != null)
+			{
+
+				if(logger.isLoggable(Level.FINE))
+				{	
+					logger.fine(Thread.currentThread().getName()+" copList!=null ");
+				}    
+				if(!instances.isEmpty() && instances.size()>0)
+				{
+					if(logger.isLoggable(Level.FINE))
+					{	
+						logger.fine(Thread.currentThread().getName() + 
+								" evaluating policy against instances");
+					}    
+					result = cp.evaluate(_dataCollector,_actuator,instances); 
+					if(auditLogger.isLoggable(Level.FINE))
+					{	
+						auditLogger.fine(Thread.currentThread().getName() + "\n"+ 
+								cp.getAuditLogString());
+					}
+					if(logger.isLoggable(Level.FINE))
+					{	
+						logger.fine(Thread.currentThread().getName() + 
+								" policy evaluation result = "+result);
+					} 
+				}
+				else
+				{
+					if(logger.isLoggable(Level.FINE))
+					{	
+						logger.fine(Thread.currentThread().getName() + 
+								" copList!=null but size="+instances.size()+" "+instances.toString());
+					}    
+				}
+			}
+			else
+			{
+
+				if(logger.isLoggable(Level.FINE))
+				{	
+					logger.fine(Thread.currentThread().getName()+" copList=null");
+				}    
+				throw new SPLException("Zero instances passed for evaluation");
+
+
+			}
+
+			if(logger.isLoggable(Level.FINE))
+			{	
+				logger.fine(Thread.currentThread().getName() + 
+						" PolicyEvaluator is done evaluating, result : "+result);
+			}	
+			logger.exiting(sourceClass,Thread.currentThread().getName()+" "+ "evaluatePolicy");
+			if(logger.isLoggable(Level.FINE))
+			{	
+				logger.fine(Thread.currentThread().getName()+" returned 1 to client");
+			}	
+			if(result==SUCCESS)
+			{
+
+				if(!ReturnObjectStore.hasReturnValues())
+				{	
+					return new Integer(1);
+				}
+				else
+				{
+					Object returnObjectList = ReturnObjectStore.getReturnValues();
+
+					return returnObjectList;
+				}
+			}
+			else
+			{
+
+
+
+				return new Integer(FAILURE);
+			}
+
+		}
+		catch (SPLException e) 
+		{
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			return null;
+		}
+		catch (Exception e) {
+			// TODO Auto-generated catch block
+			e.printStackTrace();
+			return null;
+		}
+
+	}
+
+	
+
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/impl/PolicyEvaluatorImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/impl/ReturnObjectStore.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/impl/ReturnObjectStore.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/impl/ReturnObjectStore.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/impl/ReturnObjectStore.java Fri Jan 11 10:56:30 2008
@@ -1,60 +1,60 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Prashant Baliga <prabalig@in.ibm.com>
- *
- */
-
-
-package org.apache.imperius.spl.evaluator.impl;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class ReturnObjectStore 
-{
-	private static List _returnValues = new ArrayList();
-	public static void addReturnValues(List vals)
-	{
-		
-		_returnValues.addAll(vals);
-	}
-	public static List getReturnValues()
-	{
-		
-		List retValues = new ArrayList(_returnValues);
-		
-		clearList();
-		
-		return retValues;
-	}
-	
-	
-	public static void clearList()
-	{
-		_returnValues.clear();
-	}
-	
-	public static boolean hasReturnValues()
-	{
-		if(_returnValues.size() > 0)
-		{
-			return true;
-		}
-		return false;
-	}
-
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Prashant Baliga <prabalig@in.ibm.com>
+ *
+ */
+
+
+package org.apache.imperius.spl.evaluator.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class ReturnObjectStore 
+{
+	private static List _returnValues = new ArrayList();
+	public static void addReturnValues(List vals)
+	{
+		
+		_returnValues.addAll(vals);
+	}
+	public static List getReturnValues()
+	{
+		
+		List retValues = new ArrayList(_returnValues);
+		
+		clearList();
+		
+		return retValues;
+	}
+	
+	
+	public static void clearList()
+	{
+		_returnValues.clear();
+	}
+	
+	public static boolean hasReturnValues()
+	{
+		if(_returnValues.size() > 0)
+		{
+			return true;
+		}
+		return false;
+	}
+
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/evaluator/impl/ReturnObjectStore.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/Actuator.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/Actuator.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/Actuator.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/Actuator.java Fri Jan 11 10:56:30 2008
@@ -1,78 +1,78 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Prashant Baliga <prabalig@in.ibm.com>
- * This interface needs to be implemented by 
- * the binding provider.
- * The impl is used to perform actions or call
- * methods
- */
-
-
-
-package org.apache.imperius.spl.external;
-
-
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-
-
-
-
-public interface Actuator 
-{
-    /**
-     * Invokes the method on the given object with given argument list
-     * argumentList is a list of Argument objects and  
-     * @param className
-     * @param qualifier
-     * @param instance
-     * @param methodName
-     * @param argTypeList - list of 
-     * @param argumentList
-     * @return
-     * @throws SPLException
-     */
-	public Object invokeMethod(String className, 
-			String qualifier,
-			Object instance, 
-			String methodName, 
-			List argumentList) throws SPLException ;
-	/**
-	 * Modifies the given instance with Map of new property values
-	 * @param className
-	 * @param qualifier
-	 * @param instance
-	 * @param memberMap
-	 * @throws SPLException
-	 */
-	public void modifyInstance(String className,
-			String qualifier,
-			Object instance,
-			Map memberMap) throws SPLException ;
-	
-	/**
-	 * Invokes a policy with the given name and list of input objects
-	 * @param policyName
-	 * @param objects
-	 * @return
-	 * @throws SPLException
-	 */
-
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Prashant Baliga <prabalig@in.ibm.com>
+ * This interface needs to be implemented by 
+ * the binding provider.
+ * The impl is used to perform actions or call
+ * methods
+ */
+
+
+
+package org.apache.imperius.spl.external;
+
+
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+
+
+
+
+public interface Actuator 
+{
+    /**
+     * Invokes the method on the given object with given argument list
+     * argumentList is a list of Argument objects and  
+     * @param className
+     * @param qualifier
+     * @param instance
+     * @param methodName
+     * @param argTypeList - list of 
+     * @param argumentList
+     * @return
+     * @throws SPLException
+     */
+	public Object invokeMethod(String className, 
+			String qualifier,
+			Object instance, 
+			String methodName, 
+			List argumentList) throws SPLException ;
+	/**
+	 * Modifies the given instance with Map of new property values
+	 * @param className
+	 * @param qualifier
+	 * @param instance
+	 * @param memberMap
+	 * @throws SPLException
+	 */
+	public void modifyInstance(String className,
+			String qualifier,
+			Object instance,
+			Map memberMap) throws SPLException ;
+	
+	/**
+	 * Invokes a policy with the given name and list of input objects
+	 * @param policyName
+	 * @param objects
+	 * @return
+	 * @throws SPLException
+	 */
+
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/Actuator.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/Argument.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/Argument.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/Argument.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/Argument.java Fri Jan 11 10:56:30 2008
@@ -1,51 +1,51 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Neeraj Joshi <jneeraj@us.ibm.com>
- * This interface represents an argument passed to a method call
- * It used in the DataCollector (while creating a method symbol)
- * and Actuator (while invoking a method) implementations 
- * 
- */
-package org.apache.imperius.spl.external;
-
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-
-
-public interface Argument {
-
-	public abstract String getReferenceTypeName();
-
-	public abstract void setReferenceTypeName(String name);
-
-	public abstract String getName();
-
-	public abstract void setName(String name);
-
-	public abstract TypeInfo getType();
-
-	public abstract void setType(String type) throws SPLException;
-
-	public abstract boolean getIsArray();
-
-	public abstract void setIsArray(boolean a);
-
-	public abstract Object getValue();
-
-	public abstract void setValue(Object value);
-
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Neeraj Joshi <jneeraj@us.ibm.com>
+ * This interface represents an argument passed to a method call
+ * It used in the DataCollector (while creating a method symbol)
+ * and Actuator (while invoking a method) implementations 
+ * 
+ */
+package org.apache.imperius.spl.external;
+
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+
+
+public interface Argument {
+
+	public abstract String getReferenceTypeName();
+
+	public abstract void setReferenceTypeName(String name);
+
+	public abstract String getName();
+
+	public abstract void setName(String name);
+
+	public abstract TypeInfo getType();
+
+	public abstract void setType(String type) throws SPLException;
+
+	public abstract boolean getIsArray();
+
+	public abstract void setIsArray(boolean a);
+
+	public abstract Object getValue();
+
+	public abstract void setValue(Object value);
+
 }

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/Argument.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/DataCollector.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/DataCollector.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/DataCollector.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/DataCollector.java Fri Jan 11 10:56:30 2008
@@ -1,121 +1,121 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Prashant Baliga <prabalig@in.ibm.com>
- * This interface needs to be implemented by a binding provider.
- * 
- * It collects data from the operating environment and formats it
- * for use by the SPL engine
- */
-
-package org.apache.imperius.spl.external;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-
-
-
-
-public interface DataCollector
-{
-   /**
-    * This method is applicable to Domains that support the notion of
-    * associations. Associations are relations between 2 classes where
-    * each object has a role name and the association itself is a class.
-    * 
-    * This method retrieves instances that are associated via a given 
-    * association and roles to a source instance.
-    * 
-    * This method is used to get instances o
-    * @param className
-    * @param classPath
-    * @param resultInstancesClassFilter
-    * @param assocClass
-    * @param role
-    * @param resultRole
-    * @param srcReference
-    * @return
-    * @throws SPLException
-    */ 
-	public List getAssociatedInstanceReferences(Object srcReference,
-			String namespace, 
-			String resultInstancesClassFilter, 
-			String assocClass, 
-			String role, 
-			String resultRole) throws SPLException ;
-	
-	/**
-	 * Returns a Map of all the symbols (Properties and Methods) of the given class
-	 * The Map is of the form String -> Symbol where Symbol can be a PropertySymbol or a MethodSymbol
-	 * 
-	 * @param className
-	 * @param qualifier
-	 * @return Map of symbols 
-	 * @throws SPLException
-	 */
-    public Map getSymbolsForClass(String className, String qualifier)
-            throws SPLException;
-    
-    /**
-     * Returns a Map of instance values for the given instance
-     * The Map is of the form String (name of property or method)  -> Object (instance value)
-     *  
-     * @param className
-     * @param qualifier
-     * @param instance
-     * @return
-     * @throws SPLException
-     */
-    
-    public Map getSymbolsForInstance(String className, String qualifier, Object instance)
-            throws SPLException;
-    
-   
-    /**
-     * Determines whether an association between sourceClass and targetClass with
-     * the specified roles exist. This method is applicable only when associations 
-     * between classes are supported by the operating environment
-     * @param nameSpace
-     * @param className
-     * @param resultClass
-     * @param assocClass
-     * @param role
-     * @param resultRole
-     * @return
-     * @throws SPLException
-     */   
-    public boolean associationExists(String nameSpace, String sourceClassName,
-            String targetClassName, String assocClass, String role,
-            String resultRole) throws SPLException;
-    /**
-     * Get a list of Strings representing names of instances of the given class
-     * in the Operating Environment
-     * @param className
-     * @param qualifier
-     * @return
-     * @throws SPLException
-     */
-    
-    public List enumerateInstanceNames(String className, String qualifier)
-	throws SPLException;
-//    
-//    public String getReferenceTypeName(String reference);
-//    
-  
-    
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Prashant Baliga <prabalig@in.ibm.com>
+ * This interface needs to be implemented by a binding provider.
+ * 
+ * It collects data from the operating environment and formats it
+ * for use by the SPL engine
+ */
+
+package org.apache.imperius.spl.external;
+
+import java.util.List;
+import java.util.Map;
+
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+
+
+
+
+public interface DataCollector
+{
+   /**
+    * This method is applicable to Domains that support the notion of
+    * associations. Associations are relations between 2 classes where
+    * each object has a role name and the association itself is a class.
+    * 
+    * This method retrieves instances that are associated via a given 
+    * association and roles to a source instance.
+    * 
+    * This method is used to get instances o
+    * @param className
+    * @param classPath
+    * @param resultInstancesClassFilter
+    * @param assocClass
+    * @param role
+    * @param resultRole
+    * @param srcReference
+    * @return
+    * @throws SPLException
+    */ 
+	public List getAssociatedInstanceReferences(Object srcReference,
+			String namespace, 
+			String resultInstancesClassFilter, 
+			String assocClass, 
+			String role, 
+			String resultRole) throws SPLException ;
+	
+	/**
+	 * Returns a Map of all the symbols (Properties and Methods) of the given class
+	 * The Map is of the form String -> Symbol where Symbol can be a PropertySymbol or a MethodSymbol
+	 * 
+	 * @param className
+	 * @param qualifier
+	 * @return Map of symbols 
+	 * @throws SPLException
+	 */
+    public Map getSymbolsForClass(String className, String qualifier)
+            throws SPLException;
+    
+    /**
+     * Returns a Map of instance values for the given instance
+     * The Map is of the form String (name of property or method)  -> Object (instance value)
+     *  
+     * @param className
+     * @param qualifier
+     * @param instance
+     * @return
+     * @throws SPLException
+     */
+    
+    public Map getSymbolsForInstance(String className, String qualifier, Object instance)
+            throws SPLException;
+    
+   
+    /**
+     * Determines whether an association between sourceClass and targetClass with
+     * the specified roles exist. This method is applicable only when associations 
+     * between classes are supported by the operating environment
+     * @param nameSpace
+     * @param className
+     * @param resultClass
+     * @param assocClass
+     * @param role
+     * @param resultRole
+     * @return
+     * @throws SPLException
+     */   
+    public boolean associationExists(String nameSpace, String sourceClassName,
+            String targetClassName, String assocClass, String role,
+            String resultRole) throws SPLException;
+    /**
+     * Get a list of Strings representing names of instances of the given class
+     * in the Operating Environment
+     * @param className
+     * @param qualifier
+     * @return
+     * @throws SPLException
+     */
+    
+    public List enumerateInstanceNames(String className, String qualifier)
+	throws SPLException;
+//    
+//    public String getReferenceTypeName(String reference);
+//    
+  
+    
 }

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/DataCollector.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/Expression.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/Expression.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/Expression.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/Expression.java Fri Jan 11 10:56:30 2008
@@ -1,74 +1,74 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-
-/**
- * @author Neeraj Joshi <jneeraj@us.ibm.com>
- * All SPL Expressions need to implement this interface
- */
-
-package org.apache.imperius.spl.external;
-
-import org.apache.imperius.spl.parser.exceptions.SPLException;
-import org.apache.imperius.spl.parser.util.TypeInfo;
-
-
-
-
-public interface Expression
-{
-    /**
-     * Evaluates the expression and return a result
-     * @return
-     * @throws SPLException
-     */
-    Object evaluate() throws SPLException;
-    
-    /**
-     * Get the return type of the expression
-     * @return
-     * @throws SPLException
-     */
-    TypeInfo getType() throws SPLException;
-    
-    /**
-     * Validate the expression for semantic correctness
-     * @return
-     * @throws SPLException
-     */
-    boolean validate() throws SPLException;
-    
-    /**
-     * Provides a string representation of the expression
-     * @return
-     */
-    String toString();
-    
-    /**
-     * is true if the expression evaluates to an array
-     * @return
-     */
-    boolean isArray();
-    
-    /**
-     * Applicable only in the case of complex return types
-     * provides the class name of the complex type
-     * @return
-     * @throws SPLException
-     */
-    
-    String getReferenceTypeName() throws SPLException;
-    
-    
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+
+/**
+ * @author Neeraj Joshi <jneeraj@us.ibm.com>
+ * All SPL Expressions need to implement this interface
+ */
+
+package org.apache.imperius.spl.external;
+
+import org.apache.imperius.spl.parser.exceptions.SPLException;
+import org.apache.imperius.spl.parser.util.TypeInfo;
+
+
+
+
+public interface Expression
+{
+    /**
+     * Evaluates the expression and return a result
+     * @return
+     * @throws SPLException
+     */
+    Object evaluate() throws SPLException;
+    
+    /**
+     * Get the return type of the expression
+     * @return
+     * @throws SPLException
+     */
+    TypeInfo getType() throws SPLException;
+    
+    /**
+     * Validate the expression for semantic correctness
+     * @return
+     * @throws SPLException
+     */
+    boolean validate() throws SPLException;
+    
+    /**
+     * Provides a string representation of the expression
+     * @return
+     */
+    String toString();
+    
+    /**
+     * is true if the expression evaluates to an array
+     * @return
+     */
+    boolean isArray();
+    
+    /**
+     * Applicable only in the case of complex return types
+     * provides the class name of the complex type
+     * @return
+     * @throws SPLException
+     */
+    
+    String getReferenceTypeName() throws SPLException;
+    
+    
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/Expression.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/InstanceInfo.java
URL: http://svn.apache.org/viewvc/incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/InstanceInfo.java?rev=611261&r1=611260&r2=611261&view=diff
==============================================================================
--- incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/InstanceInfo.java (original)
+++ incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/InstanceInfo.java Fri Jan 11 10:56:30 2008
@@ -1,85 +1,85 @@
-/*
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- * 
- *      http://www.apache.org/licenses/LICENSE-2.0
- * 
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-//
-/**
- * @author Neeraj Joshi
- * This class holds information about the managed resource instances used by
- * a policy during evaluation
- */
-package org.apache.imperius.spl.external;
-
-import java.util.HashMap;
-import java.util.Map;
-
-public class InstanceInfo 
-{
-	// Name of the instance
-	private String _instanceName = null;
-	// An object referencing the instance
-	private Object _instance = null;
-	// A map of the form propertyName -> Value for the instance
-	private Map _instanceSymbolsMap = new HashMap();
-	
-	private boolean isCollectInstance=false;
-	
-	public InstanceInfo() {	}
-	
-	public InstanceInfo(String name, Object obj)
-	{
-		_instanceName = name;
-		_instance = obj;
-	}
-	public InstanceInfo(String name, Object obj, boolean collectInstance)
-	{
-		_instanceName = name;
-		_instance = obj;
-		isCollectInstance=collectInstance;
-	}
-	
-	public void setInstanceSymbolsMap(Map mp)
-	{
-		_instanceSymbolsMap = mp;
-	}
-	
-	public Map getInstanceSymbolsMap()
-	{
-		return _instanceSymbolsMap;
-	}
-
-	public Object getInstance() {
-		return _instance;
-	}
-
-	public void setInstance(Object _instance) {
-		this._instance = _instance;
-	}
-
-	public String getInstanceName() {
-		return _instanceName;
-	}
-
-	public void setInstanceName(String name) {
-		_instanceName = name;
-	}
-// Should be removed
-	/*public boolean isCollectInstance() {
-		return isCollectInstance;
-	}
-
-	public void setCollectInstance(boolean isCollectInstance) {
-		this.isCollectInstance = isCollectInstance;
-	}*/
-	
-
-}
+/*
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ * 
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ * 
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+//
+/**
+ * @author Neeraj Joshi
+ * This class holds information about the managed resource instances used by
+ * a policy during evaluation
+ */
+package org.apache.imperius.spl.external;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class InstanceInfo 
+{
+	// Name of the instance
+	private String _instanceName = null;
+	// An object referencing the instance
+	private Object _instance = null;
+	// A map of the form propertyName -> Value for the instance
+	private Map _instanceSymbolsMap = new HashMap();
+	
+	private boolean isCollectInstance=false;
+	
+	public InstanceInfo() {	}
+	
+	public InstanceInfo(String name, Object obj)
+	{
+		_instanceName = name;
+		_instance = obj;
+	}
+	public InstanceInfo(String name, Object obj, boolean collectInstance)
+	{
+		_instanceName = name;
+		_instance = obj;
+		isCollectInstance=collectInstance;
+	}
+	
+	public void setInstanceSymbolsMap(Map mp)
+	{
+		_instanceSymbolsMap = mp;
+	}
+	
+	public Map getInstanceSymbolsMap()
+	{
+		return _instanceSymbolsMap;
+	}
+
+	public Object getInstance() {
+		return _instance;
+	}
+
+	public void setInstance(Object _instance) {
+		this._instance = _instance;
+	}
+
+	public String getInstanceName() {
+		return _instanceName;
+	}
+
+	public void setInstanceName(String name) {
+		_instanceName = name;
+	}
+// Should be removed
+	/*public boolean isCollectInstance() {
+		return isCollectInstance;
+	}
+
+	public void setCollectInstance(boolean isCollectInstance) {
+		this.isCollectInstance = isCollectInstance;
+	}*/
+	
+
+}

Propchange: incubator/imperius/trunk/imperius-splcore/src/main/java/org/apache/imperius/spl/external/InstanceInfo.java
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message