It seems "Rule" class doesn't store its parent "Package" information and Rule.getPackage() always returns null.
I would like to create an AgendaFilter based on package name but there is no way to get the parent package of each rule.
 
Thanks,
Hooman
 
 
public class PackageNameAgendaFilter implements AgendaFilter {
   private final String packageSuffix;
   private final boolean accept;
  
   public PackageNameAgendaFilter(String packageSuffix){
      this(packageSuffix, true);
   }
  
   public PackageNameAgendaFilter(String packageSuffix, boolean accept){
      this.packageSuffix = packageSuffix;
      this.accept = accept;
   }
   
   public boolean accept(Activation activation) {
      if(activation.getRule().getPackage().startsWith(packageSuffix))
         return accept;
      else
         return false;
   }
}


Discover the new Windows Vista Learn more!