1 18 19 package org.osgi.service.condpermadmin; 20 21 import org.eclipse.osgi.framework.internal.core.AbstractBundle; 22 import org.osgi.framework.Bundle; 23 24 49 public class BundleSignerCondition { 50 private static final String CONDITION_TYPE = "org.osgi.service.condpermadmin.BundleSignerCondition"; 51 62 static public Condition getCondition(Bundle bundle, ConditionInfo info) { 63 if (!CONDITION_TYPE.equals(info.getType())) 64 throw new IllegalArgumentException ("ConditionInfo must be of type \"" + CONDITION_TYPE + "\""); 65 String [] args = info.getArgs(); 66 if (args.length != 1) 67 throw new IllegalArgumentException ("Illegal number of args: " + args.length); 68 AbstractBundle ab = (AbstractBundle) bundle; 70 return ab.getBundleData().matchDNChain(args[0]) ? Condition.TRUE : Condition.FALSE; 71 } 72 73 private BundleSignerCondition() { 74 } 76 } 77 | Popular Tags |