// Hm. This could maybe go elsewhere, say onto ISpecificationSource
private IComponentSpecification searchForComponent(IRequestCycle cycle)
{
IComponentSpecification result = null;
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.
result = check(namespaceLocation.getRelativeResource(expectedName));
if (result != null)
return result;
if (namespace.isApplicationNamespace())
{
// The application namespace gets some extra searching.
result = check(getWebInfAppLocation().getRelativeResource(expectedName));
if (result == null)
result = check(getWebInfLocation().getRelativeResource(expectedName));
if (result == null)
result = check((getContextRoot().getRelativeResource(expectedName)));
if (result != null)
return result;
}
result = searchForComponentClass(namespace, _type);
if (result != null)
return result;
// Not in the library or app spec; does it match a component
// provided by the Framework?
INamespace framework = getSpecificationSource().getFrameworkNamespace();
if (framework.containsComponentType(_type))
return framework.getComponentSpecification(_type);
return getDelegate().findComponentSpecification(cycle, namespace, _type);
}