// TODO: This looks like a chain-of-command to me
private void searchForComponent(IRequestCycle cycle)
{
INamespace namespace = getNamespace();
if (_log.isDebugEnabled())
_log.debug(ResolverMessages.resolvingComponent(_type, namespace));
String expectedName = _type + ".jwc";
Resource namespaceLocation = namespace.getSpecificationLocation();
// Look for appropriate file in same folder as the library (or application)
// specificaiton.
if (found(namespaceLocation.getRelativeResource(expectedName)))
return;
if (namespace.isApplicationNamespace())
{
// The application namespace gets some extra searching.
if (found(getWebInfAppLocation().getRelativeResource(expectedName)))
return;
if (found(getWebInfLocation().getRelativeResource(expectedName)))
return;
if (found(getContextRoot().getRelativeResource(expectedName)))
return;
}
// Not in the library or app spec; does it match a component
// provided by the Framework?
INamespace framework = getSpecificationSource().getFrameworkNamespace();
if (framework.containsComponentType(_type))
{
setSpecification(framework.getComponentSpecification(_type));
install();
return;
}