{
if(args.length == 1)
{
policyToExecute = args[0];
}
Java_SPLPolicyRuleProvider jspl = Java_SPLPolicyRuleProvider.getInstance();
String aFile = "policies/" + policyToExecute + ".spl";
//System.out.println("starting test");
StringBuffer contents = new StringBuffer();
BufferedReader input = null;
try
{
input = new BufferedReader( new FileReader(aFile) );
String line = null;
while (( line = input.readLine()) != null)
{
contents.append(line);
contents.append(System.getProperty("line.separator"));
}
input.close();
}
catch (FileNotFoundException ex)
{
ex.printStackTrace();
}
catch (IOException ex){
ex.printStackTrace();
}
try
{
jspl.deletePolicy(policyToExecute);
}
catch(Exception e)
{
}
boolean createReturn=jspl.createPolicy(policyToExecute, contents.toString());
System.out.println("Policy Created : " + policyToExecute +createReturn);
System.out.println("");
Map objMap = new Hashtable();
/* List instanceInfoList = new ArrayList();
InstanceInfo ii1 = new InstanceInfo("system1",system1);
instanceInfoList.add(ii1);
objMap.put("org.apache.imperius.javaspl.samples.windowscomputersystem.WindowsComputerSystem", instanceInfoList);*/
objMap.put("system1", system1);
Object result = jspl.executePolicy(policyToExecute, objMap);
System.out.println("Result is " + result);
}
catch (SPLException e)
{