*/
public boolean isValid( final ComponentProfile component,
final ClassLoader classLoader )
throws ConfigurationException
{
final SchemaDescriptor schema = component.getInfo()
.getConfigurationSchema();
if( null == schema )
{
return true;
}
final String classname =
component.getInfo().getType().getName();
if( getLogger().isDebugEnabled() )
{
final String message =
"Validating component " +
component.getTemplate().getName() +
" of type " +
classname +
" with schema " +
schema.getLocation() +
" of type " +
schema.getType();
getLogger().debug( message );
}
//Get the uri of configuration schema type
try
{
final ConfigValidator validator = ComponentConfigUtil
.getComponentConfigValidator( classname,
classLoader,
schema.getLocation(),
schema.getType() );
if( null == validator )
{
final String message =
"Missing schema for component " +
component.getTemplate().getName() +
" of type " +
classname +
" with schema " +
schema.getLocation() +
" of type " +
schema.getType();
getLogger().warn( message );
return false;
}
final Configuration configuration = component.getTemplate()
.getConfiguration();