Package org.eso.ias.plugin.config
Class PluginConfigFileReader
java.lang.Object
org.eso.ias.plugin.config.PluginConfigFileReader
- All Implemented Interfaces:
PluginConfigGetter
Read the plugin configuration from a JSON file.
The configuration is read asynchronously by a dedicated thread.
- Author:
- acaproni
-
Constructor Summary
ConstructorsConstructorDescriptionPluginConfigFileReader(BufferedReader reader, String srcName) Constructor.PluginConfigFileReader(File file) Constructor.PluginConfigFileReader(String resourceName) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionSubmit the callable to read the JSON file asynchronously.
-
Constructor Details
-
PluginConfigFileReader
Constructor.- Parameters:
reader- The reader to read the JSON file with the configurationsrcName- The name of the resource
-
PluginConfigFileReader
Constructor.- Parameters:
resourceName- The name of the resource containing the JSON of the configuration- Throws:
PluginConfigException- in case of error accessing the resource
-
PluginConfigFileReader
Constructor.- Parameters:
file- The file with the JSON configuration- Throws:
PluginConfigException- in case of error opening the fileFileNotFoundException- If the passed file is not found
-
-
Method Details
-
getPluginConfig
Submit the callable to read the JSON file asynchronously.- Specified by:
getPluginConfigin interfacePluginConfigGetter- Returns:
- the Future to get the configuration produced by the thread
- Throws:
PluginConfigException- in case of error getting the configuration- See Also:
-