/** * Queue the render job * * @param message The message received by the queue * @throws JMSException if there was an error posting to the queue * @throws StorageException if the object's metadata was inaccessible */ private void queueRenderJob(JsonSimpleConfig message) throws JMSException, StorageException { // What transformations are required at the render step List<String> plugins = ConveyerBelt.getTransformList(object, message, ConveyerBelt.RENDER, true); TextMessage msg = session.createTextMessage(message.toString()); // 'renderers' is a LinkedHashMap because the key order is significant for (String selector : renderers.keySet()) { if (plugins.contains(selector)) { producer.send(renderers.get(selector), msg); return; } } // Default is the fallback producer.send(renderers.get("default"), msg); }
public SpringAccessControlWrapper() { JsonSimpleConfig systemConfiguration; try { systemConfiguration = new JsonSimpleConfig(); } catch (IOException e) { throw new RuntimeException(e); } String accessControlType = "accessmanager"; accessmanagerPlugin = PluginManager.getAccessManager(accessControlType); if (accessmanagerPlugin == null) { throw new RuntimeException("Storage plugin '" + accessControlType + "'. Ensure it is in the classpath."); } try { accessmanagerPlugin.init(systemConfiguration.toString()); log.debug( "AccessControlManager plugin with Spring has been initialiased: {}", accessmanagerPlugin.getName()); } catch (PluginException pe) { throw new RuntimeException( "Failed to initialise AccessControlManager plugin with Spring", pe); } }
/** * Read the config file and retrieve the plugin list * * @param config JSON Configuration * @throws AccessControlException */ public void setConfig(JsonSimpleConfig config) throws AccessControlException { plugins = new LinkedHashMap<String, AccessControl>(); // Get and parse the config String plugin_string = config.getString(DEFAULT_ACCESS_PLUGIN, "accesscontrol", "type"); String[] plugin_list = plugin_string.split(","); // Now start each required plugin for (String element : plugin_list) { // Get the plugin from the service loader AccessControl access = PluginManager.getAccessControl(element); // Pass it our config file try { access.init(config.toString()); } catch (Exception e) { log.error("Failed to initialise access plugin '" + element + "'", e); throw new AccessControlException(e); } plugins.put(element, access); } }
public SpringIndexerWrapper() { // initialise storage system JsonSimpleConfig systemConfiguration; try { systemConfiguration = new JsonSimpleConfig(); } catch (IOException e) { throw new RuntimeException(e); } String indexerType = systemConfiguration.getString( DEFAULT_STORAGE_TYPE, "indexer", "type"); indexerPlugin = PluginManager.getIndexer(indexerType); if (indexerPlugin == null) { throw new RuntimeException("Indexer plugin '" + indexerType + "' not found. Ensure it is in the classpath."); } try { indexerPlugin.init(systemConfiguration.toString()); log.debug("Indexer service has been initialiased: {}", indexerPlugin.getName()); } catch (PluginException pe) { throw new RuntimeException("Failed to initialise index", pe); } }
r.init(config.toString()); plugins.put(element, r); } catch (NullPointerException e) {
public SpringStorageWrapper() { // initialise storage system JsonSimpleConfig systemConfiguration; try { systemConfiguration = new JsonSimpleConfig(); } catch (IOException e) { throw new RuntimeException(e); } String storageType = systemConfiguration.getString( DEFAULT_STORAGE_TYPE, "storage", "type"); storagePlugin = PluginManager.getStorage(storageType); if (storagePlugin == null) { throw new RuntimeException("Storage plugin '" + storageType + "'. Ensure it is in the classpath."); } try { storagePlugin.init(systemConfiguration.toString()); log.debug("Storage service has been initialiased: {}", storagePlugin.getName()); } catch (PluginException pe) { throw new RuntimeException("Failed to initialise storage", pe); } }
auth.init(config.toString()); } catch (PluginException e) { throw new AuthenticationException(e);
access.init(config.toString());
try { storage = PluginManager.getStorage(storageType); storage.init(config.toString()); } catch (PluginException pe) { throw new IndexerException(pe);
storage.init(systemConfig.toString()); log.info("Storage Plugin '{}' instantiated", storage.getName()); } catch (PluginException ex) {
storage.init(config.toString()); log.info("Loaded {}", storage.getName()); } catch (PluginException pe) {
JsonSimple json; try { json = new JsonSimple(config.toString()); } catch (IOException ex) { throw new TransformerException("Error parsing attachment JSON", ex);
JsonSimple json; try { json = new JsonSimple(config.toString()); } catch (IOException ex) { throw new SubscriberException("VITAL Subscriber:" +