}
//useKey used in auto-wiring expects no property and argument, so optimize.
private static Component useType(final Class type){
return new DelegatingComponent(Components.useType(type)){
public Object create(Dependency dep){
final ComponentMap cmap = dep.getComponentMap();
if(cmap instanceof Container){
return ((Container)cmap).getInstanceOfType(type);
}
else return super.create(dep);
}