Fixed extension query by extension id.

This commit is contained in:
Heng Sin Low 2010-11-03 15:36:33 +08:00
parent 0313df9b70
commit ac91965779
3 changed files with 7 additions and 6 deletions

View File

@ -48,7 +48,7 @@ public class Core {
className = className.substring(Core.OSGI_PREFIX.length());
ServiceQuery query = new ServiceQuery();
query.put("id", className);
query.put(ServiceQuery.EXTENSION_ID, className);
return Service.locate(ProcessCall.class, "org.adempiere.base.Process", query);
}
@ -57,7 +57,7 @@ public class Core {
className = className.substring(Core.OSGI_PREFIX.length());
ServiceQuery query = new ServiceQuery();
query.put("id", className);
query.put(ServiceQuery.EXTENSION_ID, className);
return Service.locate(ModelValidator.class, "org.adempiere.base.ModelValidator", query);
}

View File

@ -6,4 +6,5 @@ public class ServiceQuery extends HashMap<String, String> {
private static final long serialVersionUID = -3624488575106821781L;
public static final String EXTENSION_ID = "Extension.ID";
}

View File

@ -59,7 +59,7 @@ public class ExtensionList<T> implements Iterable<T>{
private boolean accept(IConfigurationElement element) {
for (String name : filters.keySet()) {
String expected = filters.get(name);
if (name.equals("Extension.ID")) {
if (name.equals(ServiceQuery.EXTENSION_ID)) {
String id = element.getDeclaringExtension().getUniqueIdentifier();
if (!expected.equals(id))
return false;