@Override public void init(File jsonFile) throws PluginException { storagePlugin.init(jsonFile); }
@Override public void init(String jsonString) throws PluginException { storagePlugin.init(jsonString); }
@Override public void init(File jsonFile) throws PluginException { storage.init(jsonFile); }
@Override public void init(String jsonString) throws PluginException { storage.init(jsonString); }
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); } }
/** * Set the default setting */ public void setSetting() { // Get the storage type to be indexed... try { storage = PluginManager.getStorage(config.getString( DEFAULT_STORAGE_TYPE, "storage", "type")); storage.init(configFile); indexer = PluginManager.getIndexer(config.getString( DEFAULT_INDEXER_TYPE, "indexer", "type")); indexer.init(configFile); rulesList = new ArrayList<String>(); log.info("Loaded {} and {}", realStorage.getName(), indexer .getName()); } catch (Exception e) { log.error("Failed to initialise storage", e); return; } }
/** * Reset the transformer in preparation for a new object */ private void reset() throws TransformerException { // First time execution, prepare storage if (storage == null) { try { String storageType = config.getString(null, "storage", "type"); storage = PluginManager.getStorage(storageType); storage.init(JsonSimpleConfig.getSystemFile()); } catch (Exception ex) { throw new TransformerException(ex); } } }
try { storage = PluginManager.getStorage(storageType); storage.init(config.toString()); } catch (PluginException pe) { throw new IndexerException(pe);
storage = PluginManager.getStorage( globalConfig.getString("file-system", "storage", "type")); storage.init(sysFile);
storage.init(systemConfig.toString()); log.info("Storage Plugin '{}' instantiated", storage.getName()); } catch (PluginException ex) {
/** * Initialization method * * @param config Configuration to use * @throws IOException if the configuration file not found */ @Override public void init(JsonSimpleConfig config) throws Exception { name = config.getString(null, "config", "name"); QUEUE_ID = name; thread.setName(name); try { globalConfig = new JsonSimpleConfig(); indexer = PluginManager.getIndexer( globalConfig.getString("solr", "indexer", "type")); indexer.init(JsonSimpleConfig.getSystemFile()); storage = PluginManager.getStorage( globalConfig.getString("file-system", "storage", "type")); storage.init(JsonSimpleConfig.getSystemFile()); } catch (IOException ioe) { log.error("Failed to read configuration: {}", ioe.getMessage()); throw ioe; } catch (PluginException pe) { log.error("Failed to initialise plugin: {}", pe.getMessage()); throw pe; } }
throw new Exception("Unable to load Storage '"+storageId+"'"); storage.init(sysFile);
"storage", "type"); storage = PluginManager.getStorage(storageType); storage.init(JsonSimpleConfig.getSystemFile()); } catch (Exception ex) { throw new TransformerException(ex);
storage = PluginManager.getStorage( globalConfig.getString("file-system", "storage", "type")); storage.init(sysFile);
storage = PluginManager.getStorage( globalConfig.getString("file-system", "storage", "type")); storage.init(sysFile);
storage.init(config.toString()); log.info("Loaded {}", storage.getName()); } catch (PluginException pe) {
storage = PluginManager.getStorage( config.getString("file-system", "storage", "type")); storage.init(sysFile); } catch (PluginException pe) { log.error("Failed to initialise plugin: {}", pe.getMessage());
storage = PluginManager.getStorage( config.getString("file-system", "storage", "type")); storage.init(sysFile); } catch (PluginException pe) { log.error("Failed to initialise plugin: {}", pe.getMessage());
storage.init(config.toString()); } catch (PluginException ex) { log.error("Unable to initialise storage layer!", ex);
storage.init(systemConfig.toString()); } catch (PluginException ex) { log.error("Unable to initialise storage layer!", ex);