You are viewing a plain text version of this content. The canonical link for it is here.
Posted to imperius-dev@incubator.apache.org by Erik Bengtson <er...@jpox.org> on 2008/01/02 16:23:20 UTC
misc questions
Hi,
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?
e.g.
Import Class org.eclipse.hyades.logging.events.cbe.CommonBaseEvent[]:events;
I've tried the above, but does not work. Is there any alternative?
2) I've created a JIRA issue regarding OSGi bundles. Is this on the roadmap? I
plan to provide a 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
Java_SPLPolicyRuleProvider.
e.g.
interface ImperiusFactory {
SPLPolicyRuleProvider newInstance(Map props);
}
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 as
argument to any policy, and some policies will not use all arguments.
5) Do you plan to commit the Eclipse SPL Editor Plugin?
Thanks
Erik Bengtson
Re: misc questions
Posted by Neeraj Joshi <jn...@us.ibm.com>.
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 <er...@jpox.org>
01/02/2008 11:23 AM
Please respond to
imperius-dev@incubator.apache.org
To
imperius-dev@incubator.apache.org
cc
Subject
misc questions
Hi,
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?
e.g.
Import Class
org.eclipse.hyades.logging.events.cbe.CommonBaseEvent[]: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
future.
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
Java_SPLPolicyRuleProvider.
e.g.
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
as
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
policy.
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
where
Map inputMap = ["a" --> instanceInfoListForA]
["b" --> instanceInfoListForB ]
where
instanceInfoListForA = [instanceInfoA1 , instanceInfoA2]
instanceInfoLIstForB = [instanceInfoB1 , instanceInfoB2 ]
where
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
Thanks
Erik Bengtson