Class PluginRegistry.ConfigurationValidator
java.lang.Object
de.aristaflow.adept2.base.configuration.ConfigurationValidator
de.aristaflow.adept2.base.registry.PluginRegistry.ConfigurationValidator
- Direct Known Subclasses:
LocalServiceRegistry.ConfigurationValidator
- Enclosing class:
- PluginRegistry
Checks that all declared plugin instances are configured properly, that is
they have an implementation class and runtime plugins have a plugin
classpath.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcheckAllPluginTypes(Configuration configuration) Checks whether the designated configuration declares plugin types and if so, whether they are configured properly, that is all declared plugin instances have an implementation class or in case of runtime plugins, the plugin type provides a plugin classpath and a valid anonymous instance.protected voidcheckPluginDeclaration(Configuration configuration, String pluginType, String pluginInstance) Checks whether there is an implementation configured for the designated plugin instance.protected voidcheckPluginInstances(Configuration configuration, String pluginType) Checks whether the instances of the designated plugin type are configured properly, that is they have an implementation class or in case of runtime plugins, the plugin type provides a plugin classpath and a valid anonymous instance.protected voidcheckRuntimePluginDeclaration(Configuration configuration, String pluginType) Checks whether the designated plugin type declaring runtime plugins ('*') has a classpath configured.protected voidvalidate(Configuration configuration) Checks whether the designated configuration declares plugin types and if so, whether they are configured properly, that is all declared plugin instances have an implementation class or in case of runtime plugins, the plugin type provides a plugin classpath and a valid anonymous instance.Methods inherited from class de.aristaflow.adept2.base.configuration.ConfigurationValidator
rebuke, rebukeIllegalValue, rebukeMissingValue
-
Constructor Details
-
ConfigurationValidator
public ConfigurationValidator()
-
-
Method Details
-
checkPluginDeclaration
protected void checkPluginDeclaration(Configuration configuration, String pluginType, String pluginInstance) throws ConfigurationException Checks whether there is an implementation configured for the designated plugin instance.- Parameters:
configuration- The configuration to check for implementation propertiy for the designated plugin instance.pluginType- The type name of the plugin to check its instance for a present implementation.pluginInstance- The name of the plugin instance to check for a present implementation.- Throws:
ConfigurationException- If the designated plugin instance does not declare a corresponding implementation, aConfigurationExceptionwill be thrown.
-
checkRuntimePluginDeclaration
protected void checkRuntimePluginDeclaration(Configuration configuration, String pluginType) throws ConfigurationException Checks whether the designated plugin type declaring runtime plugins ('*') has a classpath configured.- Parameters:
configuration- The configuration to check for a plugin classpath property for the designated plugin type.pluginType- The type name of the plugin to check its instance for a present implementation.- Throws:
ConfigurationException- If the designated plugin type does not declare a plugin classpath, aConfigurationExceptionwill be thrown.
-
checkPluginInstances
protected void checkPluginInstances(Configuration configuration, String pluginType) throws ConfigurationException Checks whether the instances of the designated plugin type are configured properly, that is they have an implementation class or in case of runtime plugins, the plugin type provides a plugin classpath and a valid anonymous instance.- Parameters:
configuration- The configuration to check for properly configured instances.pluginType- The type name of the plugin to check for properly configured instances.- Throws:
ConfigurationException- If the instances of the designated plugin type are not configured properly, aConfigurationExceptionwill be thrown.
-
checkAllPluginTypes
Checks whether the designated configuration declares plugin types and if so, whether they are configured properly, that is all declared plugin instances have an implementation class or in case of runtime plugins, the plugin type provides a plugin classpath and a valid anonymous instance.- Parameters:
configuration- The configuration to check for properly configured plugin types.- Throws:
ConfigurationException- If there are incorrectly configured plugin types in the designated configuration, aConfigurationExceptionwill be thrown.
-
validate
Checks whether the designated configuration declares plugin types and if so, whether they are configured properly, that is all declared plugin instances have an implementation class or in case of runtime plugins, the plugin type provides a plugin classpath and a valid anonymous instance.- Specified by:
validatein classConfigurationValidator- Parameters:
configuration- The configuration to check for properly configured plugin types.- Throws:
ConfigurationException- If there are incorrectly configured plugin types in the designated configuration, aConfigurationExceptionwill be thrown.- See Also:
-