private void init() throws IndexerException {
		if (!loaded) {
			loaded = true;

			String storageType = config.getString(null, "storage", "type");
			try {
				storage = PluginManager.getStorage(storageType);
				storage.init(config.toString());
			} catch (PluginException pe) {
				throw new IndexerException(pe);
			}

			// Credentials
			usernameMap = new HashMap<String, String>();
			passwordMap = new HashMap<String, String>();

			solr = initCore("solr");
			anotar = initCore("anotar");

			// initialise non-hardcoded indexers
			solrServerMap = new HashMap<String, SolrServer>();
			JsonObject indexerConfig = config.getObject("indexer");

			List<String> hardcodedValues = Arrays.asList("type", "properties", "useCache", "buffer", "solr", "anotar");
			for (Object key : indexerConfig.keySet()) {
				if (key instanceof String) {
					String keyString = (String) key;
					if (!hardcodedValues.contains(keyString)) {
						solrServerMap.put(keyString, initCore(keyString));
					}
				}
			}

			anotarAutoCommit = config.getBoolean(true, "indexer", "anotar", "autocommit");
			propertiesId = config.getString(DEFAULT_METADATA_PAYLOAD, "indexer", "propertiesId");

			customParams = new HashMap<String, String>();

			// Caching
			scriptCache = new HashMap<String, PyObject>();
			groovyScriptCache = new HashMap<String, String>();
			configCache = new HashMap<String, JsonSimpleConfig>();
			useCache = config.getBoolean(true, "indexer", "useCache");

		}
		loaded = true;
	}
private void init ( ) throws IndexerException { if ( ! loaded ) { loaded = true ; String storageType = config . getString ( null , "storage" , "type" ) ; try { storage = PluginManager . getStorage ( storageType ) ; storage . init ( config . toString ( ) ) ; } catch ( PluginException pe ) { throw new IndexerException ( pe ) ; } usernameMap = new HashMap < String , String > ( ) ; passwordMap = new HashMap < String , String > ( ) ; solr = initCore ( "solr" ) ; anotar = initCore ( "anotar" ) ; solrServerMap = new HashMap < String , SolrServer > ( ) ; JsonObject indexerConfig = config . getObject ( "indexer" ) ; List < String > hardcodedValues = Arrays . asList ( "type" , "properties" , "useCache" , "buffer" , "solr" , "anotar" ) ; for ( Object key : indexerConfig . keySet ( ) ) { if ( key instanceof String ) { String keyString = ( String ) key ; if ( ! hardcodedValues . contains ( keyString ) ) { solrServerMap . put ( keyString , initCore ( keyString ) ) ; } } } anotarAutoCommit = config . getBoolean ( true , "indexer" , "anotar" , "autocommit" ) ; propertiesId = config . getString ( DEFAULT_METADATA_PAYLOAD , "indexer" , "propertiesId" ) ; customParams = new HashMap < String , String > ( ) ; scriptCache = new HashMap < String , PyObject > ( ) ; groovyScriptCache = new HashMap < String , String > ( ) ; configCache = new HashMap < String , JsonSimpleConfig > ( ) ; useCache = config . getBoolean ( true , "indexer" , "useCache" ) ; } loaded = true ; }
Private method wrapped by the above two methods to perform the actual
initialization after the JSON config is accessed.

@throws IndexerException
if errors occur during initialization