{
className = br.readLine();
}
catch (IOException e)
{
throw new FacesException("Unable to read class name from file " + url.toExternalForm(), e);
} finally {
if (br != null)
{
br.close();
}
if (isr != null) {
isr.close();
}
if (stream != null) {
stream.close();
}
}
if (log.isInfoEnabled())
{
log.info("Found " + factoryName + " factory implementation: " + className);
}
if (factoryName.equals(FactoryFinder.APPLICATION_FACTORY))
{
getDispenser().feedApplicationFactory(className);
}
else if (factoryName.equals(FactoryFinder.FACES_CONTEXT_FACTORY))
{
getDispenser().feedFacesContextFactory(className);
}
else if (factoryName.equals(FactoryFinder.LIFECYCLE_FACTORY))
{
getDispenser().feedLifecycleFactory(className);
}
else if (factoryName.equals(FactoryFinder.RENDER_KIT_FACTORY))
{
getDispenser().feedRenderKitFactory(className);
}
else
{
throw new IllegalStateException("Unexpected factory name " + factoryName);
}
}
}
}
catch (Throwable e)
{
throw new FacesException(e);
}
}