com.caucho.config.inject
Class InstanceImpl<T>

java.lang.Object
  extended by com.caucho.config.inject.InstanceImpl<T>
All Implemented Interfaces:
java.io.Serializable, java.lang.Iterable<T>, Instance<T>, Provider<T>

@Module
public final class InstanceImpl<T>
extends java.lang.Object
implements Instance<T>, java.io.Serializable

Factory to create instances of a bean.

See Also:
Serialized Form

Method Summary
 T get()
          Returns an instance of the selected bean
 boolean isAmbiguous()
          Test if there are multiple beans that match the instance.
 boolean isUnsatisfied()
          Test if there are any beans that match the instance.
 java.util.Iterator<T> iterator()
           
 Instance<T> select(java.lang.annotation.Annotation... bindings)
          Restricts the instance given a set of bindings
<U extends T>
Instance<U>
select(java.lang.Class<U> subtype, java.lang.annotation.Annotation... bindings)
          Restricts the instance to a subtype and bindings.
<U extends T>
Instance<U>
select(TypeLiteral<U> subtype, java.lang.annotation.Annotation... bindings)
          Restricts the instance to a subtype and bindings.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

get

public T get()
Returns an instance of the selected bean

Specified by:
get in interface Provider<T>

select

public Instance<T> select(java.lang.annotation.Annotation... bindings)
Restricts the instance given a set of bindings

Specified by:
select in interface Instance<T>

select

public <U extends T> Instance<U> select(java.lang.Class<U> subtype,
                                        java.lang.annotation.Annotation... bindings)
Restricts the instance to a subtype and bindings.

Specified by:
select in interface Instance<T>

select

public <U extends T> Instance<U> select(TypeLiteral<U> subtype,
                                        java.lang.annotation.Annotation... bindings)
Restricts the instance to a subtype and bindings.

Specified by:
select in interface Instance<T>

iterator

public java.util.Iterator<T> iterator()
Specified by:
iterator in interface java.lang.Iterable<T>

isAmbiguous

public boolean isAmbiguous()
Description copied from interface: Instance
Test if there are multiple beans that match the instance.

Specified by:
isAmbiguous in interface Instance<T>

isUnsatisfied

public boolean isUnsatisfied()
Description copied from interface: Instance
Test if there are any beans that match the instance.

Specified by:
isUnsatisfied in interface Instance<T>

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object