public ComponentAdapter getComponentAdapterOfType(Class componentType) { // See http://jira.codehaus.org/secure/ViewIssue.jspa?key=PICO-115 ComponentAdapter adapterByKey = getComponentAdapter(componentType); if (adapterByKey != null) { return adapterByKey; } List found = getComponentAdaptersOfType(componentType); if (found.size() == 1) { return ((ComponentAdapter) found.get(0)); } else if (found.size() == 0) { if (parent != null) { return parent.getComponentAdapterOfType(componentType); } else { return null; } } else { Class[] foundClasses = new Class[found.size()]; for (int i = 0; i < foundClasses.length; i++) { ComponentAdapter componentAdapter = (ComponentAdapter) found.get(i); foundClasses[i] = componentAdapter.getComponentImplementation(); } throw new AmbiguousComponentResolutionException(componentType, foundClasses); } }
public ComponentAdapter getComponentAdapterOfType(Class componentType) { return delegate.getComponentAdapterOfType(componentType); }
public ComponentAdapter getComponentAdapterOfType(Class componentType) { // See http://jira.codehaus.org/secure/ViewIssue.jspa?key=PICO-115 ComponentAdapter adapterByKey = getComponentAdapter(componentType); if (adapterByKey != null) { return adapterByKey; } List found = getComponentAdaptersOfType(componentType); if (found.size() == 1) { return ((ComponentAdapter) found.get(0)); } else if (found.size() == 0) { if (parent != null) { return parent.getComponentAdapterOfType(componentType); } else { return null; } } else { Class[] foundClasses = new Class[found.size()]; for (int i = 0; i < foundClasses.length; i++) { foundClasses[i] = ((ComponentAdapter) found.get(i)).getComponentImplementation(); } throw new AmbiguousComponentResolutionException(componentType, foundClasses); } }
return container.getComponentAdapterOfType(expectedType); } else { Object excludeKey = excludeAdapter.getComponentKey(); if(found.size() == 0) { if( container.getParent() != null) { return container.getParent().getComponentAdapterOfType(expectedType); } else { return null;