incubator-imperius-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Neeraj Joshi <>
Subject Re: misc questions
Date Wed, 02 Jan 2008 18:12:19 GMT
Hi Erik,
Thanks for taking the time!
See my comments in blue below

"'In the end, everything is fine. If it is not, it is not the end" 
Neeraj Joshi
Autonomic Policy Development
Autonomic Computing Division, Tivoli, IBM


Erik Bengtson <> 
01/02/2008 11:23 AM
Please respond to


misc questions


I've trying Imperius and so far very good. I have a couple of questions:

1) Is it possible to import an array type in the SPL file?


Import Class[]:events;

I've tried the above, but does not work. Is there any alternative?

NRJ-Currently there is no way to import an array type, What you could do 
is create a seperate class which has a property of a array type and import 
that class within your policy. There is a history behind why this is not 
currently supported but we can definitely consider adding support in the 

2) I've created a JIRA issue regarding OSGi bundles. Is this on the 
roadmap? I
plan to provide a patch

NRJ- We had thought about trying out SPL on OSGi but never got around to 
it. Looking forward to your patch!

3) A detail on the Java SPL implementation: IMO an end user interface 
should be
defined together with a factory class that will be implemented by


interface ImperiusFactory {
SPLPolicyRuleProvider newInstance(Map props);
NRJ: The factory is a good idea. What do you have in mind in terms of a 
user interface?

4) If a symbol does not exist in the SPL namespace, but is passed as 
argument to
the evaluatePolicy it leads to an error... Couldn't this be relaxed? I 
want to
have a simple piece of java code that will create generic arguments passed 
argument to any policy, and some policies will not use all arguments.

NRJ- There is a direct correlation between the arguments passed to the 
evaluatePolicy method and the imported classes/instances within the 
For e.g. 

If the import statement in the policy is as follows:

Import Class a : a1,a2;
Import Class b: b1,b2;

Then the evaluatePolicy method call  would have inputMap as the parameter

Map inputMap =  ["a" --> instanceInfoListForA]
                 ["b" --> instanceInfoListForB ]

instanceInfoListForA = [instanceInfoA1  , instanceInfoA2]
instanceInfoLIstForB = [instanceInfoB1 , instanceInfoB2 ]

instanceInfoA1 = new InstanceInfo("a1", new a());
instanceInfoA2 = new InstanceInfo("a2",new a());

instanceInfoB1 = new InstanceInfo("b1",new b());
instanceInfoB2 = new InstanceInfo("b2", new b());

hence the restriction.
One way could be to have identical imports in all the policies (but use 
only a few of the imported instances) however you will still need to 
provide an instance
corresponding to every instance declared in the import....

5) Do you plan to commit the Eclipse SPL Editor Plugin?

Yes the plugin itself is ready I just need to integrate it with the maven 
based build (earlier we had pure ANT). Should be 
in soon


Erik Bengtson

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message