PluginManager pm = PluginManagerFactory.createPluginManager(props);
pm.addPluginsFrom(new URI("classpath://*"));
TestAnnotations plugin = pm.getPlugin(TestAnnotations.class);
RemoteAPI remote = pm.getPlugin(RemoteAPI.class, new OptionPluginSelector<RemoteAPI>(new PluginSelector<RemoteAPI>() {
public boolean selectPlugin(final RemoteAPI p) {
if (p.getPublishMethod().equals(PublishMethod.JSON)) return true;
return false;
}
}));
ExportResult exportPlugin = remote.exportPlugin(plugin);
Collection<URI> exportURIs = exportPlugin.getExportURIs();
for (URI uri : exportURIs) {
System.out.println(uri);
}