props.setProperty(PluginManager.class, "cache.enabled", "true");
props.setProperty(PluginManager.class, "cache.mode", "weak");
props.setProperty(PluginManager.class, "cache.file", "jspf.cache");
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);
}
Thread.sleep(6000000);
pm.shutdown();
}