{
resources = classRealm.findResources( getComponentDescriptorLocation() );
}
catch ( IOException e )
{
throw new PlexusConfigurationException( "Unable to retrieve resources for: " +
getComponentDescriptorLocation() + " in class realm: " + classRealm.getId() );
}
for ( Enumeration e = resources; e.hasMoreElements(); )
{
URL url = (URL) e.nextElement();
InputStreamReader reader = null;
try
{
URLConnection conn = url.openConnection();
conn.setUseCaches( false );
conn.connect();
reader = new InputStreamReader( conn.getInputStream() );
InterpolationFilterReader input = new InterpolationFilterReader( reader,
new ContextMapAdapter( context ) );
ComponentSetDescriptor componentSetDescriptor = createComponentDescriptors( input, url.toString() );
componentSetDescriptors.add( componentSetDescriptor );
// Fire the event
ComponentDiscoveryEvent event = new ComponentDiscoveryEvent( componentSetDescriptor );
manager.fireComponentDiscoveryEvent( event );
}
catch ( IOException ex )
{
throw new PlexusConfigurationException( "Error reading configuration " + url, ex );
}
finally
{
IOUtil.close( reader );
}