public ResolutionResult doResolve( Dependency dep, Object target )
   {
      Class<?> type = dep.getType();
      Map<?, ?> map = BeanFactoryUtils.beansOfTypeIncludingAncestors( applicationContext, type );
      if ( map.size() < 1 )
      {
    	 if ( log.isLoggable(Level.FINE) )
            log.fine( "No beans of required type found for dependency " + dep + ". Skipping." );
      }
      else if ( map.size() > 1 )
      {         
         throw new RuntimeException( "Multiple beans of required type " + type + " found. Aborting." );
      }
      else
      {
         Object bean = map.values().iterator().next();
         if ( log.isLoggable(Level.FINE) )
            log.fine( "Found bean [" + bean + "] to inject for dependency " + dep + "." );
         return ResolutionResult.resolved(bean);
      }
      return ResolutionResult.couldNotResolve();
   }