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
public static class PluginRegistry.ConfigurationValidator extends ConfigurationValidator
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 Constructor Description ConfigurationValidator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
checkAllPluginTypes(org.apache.commons.configuration2.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 void
checkPluginDeclaration(org.apache.commons.configuration2.Configuration configuration, String pluginType, String pluginInstance)
Checks whether there is an implementation configured for the designated plugin instance.protected void
checkPluginInstances(org.apache.commons.configuration2.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 void
checkRuntimePluginDeclaration(org.apache.commons.configuration2.Configuration configuration, String pluginType)
Checks whether the designated plugin type declaring runtime plugins ('*') has a classpath configured.protected void
validate(org.apache.commons.configuration2.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
-
-
-
-
Method Detail
-
checkPluginDeclaration
protected void checkPluginDeclaration(org.apache.commons.configuration2.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, aConfigurationException
will be thrown.
-
checkRuntimePluginDeclaration
protected void checkRuntimePluginDeclaration(org.apache.commons.configuration2.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, aConfigurationException
will be thrown.
-
checkPluginInstances
protected void checkPluginInstances(org.apache.commons.configuration2.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, aConfigurationException
will be thrown.
-
checkAllPluginTypes
protected void checkAllPluginTypes(org.apache.commons.configuration2.Configuration configuration) throws ConfigurationException
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, aConfigurationException
will be thrown.
-
validate
protected void validate(org.apache.commons.configuration2.Configuration configuration) throws ConfigurationException
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:
validate
in 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, aConfigurationException
will be thrown.- See Also:
checkAllPluginTypes(Configuration)
-
-