Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Archived » B3 » Heads up on Filters in p2 api
Heads up on Filters in p2 api [message #603385] Fri, 12 March 2010 13:10
Thomas Hallgren is currently offline Thomas HallgrenFriend
Messages: 3240
Registered: July 2009
Senior Member
The p2 API for IInstallableUnit.getFilter() and IRequirement.getFilter() has changed in the last milestone. I think this
has some impact on the aggregator code.

The new API returns an IMatchExpression that will be evaluated against a context IU. This IU holds the properties that
prior to this change was passed in a Dictionary when evaluating the OSGi filter. Here's some sample code that tests a
filter:

HashMap<String, String> env = new HashMap<String, String>();
env.put("osgi.os", "linux");
env.put("osgi.ws", "gtk");
env.put("osgi.arch", "x86");
IInstallableUnit envIU = InstallableUnit.contextIU(env);

if(requirement.getFilter().isMatch(envIU)) {
// The filter matches the environment
}

HTH,
- thomas
Previous Topic:select-switch in repo config
Next Topic:Heads up on Filters in p2 api
Goto Forum:
  


Current Time: Tue Mar 19 11:23:32 GMT 2024

Powered by FUDForum. Page generated in 0.01822 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top