use of aQute.bnd.service.RegistryDonePlugin in project bnd by bndtools.
the class Processor method getPlugins.
/**
* Return a list of plugins. Plugins are defined with the -plugin command.
* They are class names, optionally associated with attributes. Plugins can
* implement the Plugin interface to see these attributes. Any object can be
* a plugin.
*/
public Set<Object> getPlugins() {
Set<Object> p;
synchronized (this) {
p = plugins;
if (p != null)
return p;
plugins = p = new CopyOnWriteArraySet<>();
missingCommand = new HashSet<String>();
}
// We only use plugins now when they are defined on our level
// and not if it is in our parent. We inherit from our parent
// through the previous block.
String spe = getProperty(PLUGIN);
if (NONE.equals(spe))
return p;
// The owner of the plugin is always in there.
p.add(this);
setTypeSpecificPlugins(p);
if (parent != null)
p.addAll(parent.getPlugins());
//
// Look only local
//
spe = mergeLocalProperties(PLUGIN);
String pluginPath = mergeProperties(PLUGINPATH);
loadPlugins(p, spe, pluginPath);
addExtensions(p);
for (RegistryDonePlugin rdp : getPlugins(RegistryDonePlugin.class)) {
try {
rdp.done();
} catch (Exception e) {
error("Calling done on %s, gives an exception %s", rdp, e);
}
}
return p;
}
Aggregations