org.picocontainer.defaults
Class AmbiguousComponentResolutionException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.picocontainer.PicoException
                  extended by org.picocontainer.PicoIntrospectionException
                      extended by org.picocontainer.defaults.AmbiguousComponentResolutionException
All Implemented Interfaces:
java.io.Serializable

public class AmbiguousComponentResolutionException
extends PicoIntrospectionException

Exception that is thrown as part of the introspection. Raised if a PicoContainer cannot resolve a type dependency because the registered ComponentAdapters are not distinct.

Since:
1.0
Author:
Paul Hammant, Aslak Hellesøy, Jon Tirsén
See Also:
Serialized Form

Field Summary
private  java.lang.Object[] ambiguousComponentKeys
           
private  java.lang.Class ambiguousDependency
           
private  java.lang.Class component
           
 
Constructor Summary
AmbiguousComponentResolutionException(java.lang.Class ambiguousDependency, java.lang.Object[] componentKeys)
          Construct a new exception with the ambigous class type and the ambiguous component keys.
 
Method Summary
 java.lang.Object[] getAmbiguousComponentKeys()
           
 java.lang.String getMessage()
           
 void setComponent(java.lang.Class component)
           
 
Methods inherited from class org.picocontainer.PicoException
getCause, printStackTrace, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

component

private java.lang.Class component

ambiguousDependency

private java.lang.Class ambiguousDependency

ambiguousComponentKeys

private final java.lang.Object[] ambiguousComponentKeys
Constructor Detail

AmbiguousComponentResolutionException

public AmbiguousComponentResolutionException(java.lang.Class ambiguousDependency,
                                             java.lang.Object[] componentKeys)
Construct a new exception with the ambigous class type and the ambiguous component keys.

Parameters:
ambiguousDependency - the unresolved dependency type
componentKeys - the ambiguous keys.
Method Detail

getMessage

public java.lang.String getMessage()
Overrides:
getMessage in class java.lang.Throwable
Returns:
Returns a string containing the unresolved class type and the ambiguous keys.

getAmbiguousComponentKeys

public java.lang.Object[] getAmbiguousComponentKeys()
Returns:
Returns the ambiguous component keys as array.

setComponent

public void setComponent(java.lang.Class component)