|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jvnet.hk2.component.ContractLocatorImpl<T>
@Deprecated public class ContractLocatorImpl<T>
Implementation of the ContractLocator
interface.
Constructor Summary | |
---|---|
ContractLocatorImpl(ServiceLocator serviceLocator,
Type clazz,
boolean byContract)
Deprecated. |
Method Summary | ||
---|---|---|
Collection<Provider<T>> |
all()
Deprecated. Return all applicable Provider s. |
|
Collection<Provider<T>> |
all(boolean stopAtFirstMatch)
Deprecated. |
|
ContractLocator<T> |
annotatedWith(Class<? extends Annotation> annotation)
Deprecated. Qualify this ContractLocator to identify services have the given annotation. |
|
T |
get()
Deprecated. A shortcut for |
|
|
getByType(Class<U> type)
Deprecated. Obtain a reference to the component/service from the associated provider. |
|
Provider<T> |
getProvider()
Deprecated. Return the "best" Provider from the collection that matches
current criteria. |
|
String |
getTypeName()
Deprecated. |
|
ContractLocator<T> |
in(Scope scope)
Deprecated. Qualify this ContractLocator to identify services that are scoped scope. |
|
ContractLocator<T> |
named(String name)
Deprecated. Qualify this ContractLocator to identify services that are named name. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ContractLocatorImpl(ServiceLocator serviceLocator, Type clazz, boolean byContract)
Method Detail |
---|
public String getTypeName()
public ContractLocator<T> named(String name)
ContractLocator
named
in interface ContractLocator<T>
name
- the name of the service
public ContractLocator<T> in(Scope scope)
ContractLocator
in
in interface ContractLocator<T>
scope
- the scope of the service
public ContractLocator<T> annotatedWith(Class<? extends Annotation> annotation)
ContractLocator
annotatedWith
in interface ContractLocator<T>
annotation
- the annotation that the service must have
public T get()
Providers
if (getProvider() != null) return getProvider().get(); return null;
get
in interface Providers<T>
public <U> U getByType(Class<U> type)
Providers
getByType
in interface Providers<T>
type
- the required type of the returned object
public Provider<T> getProvider()
Providers
Provider
from the collection that matches
current criteria. If the collection Providers.all()
is not empty,
this will return a non null value. Otherwise the return value is
null.
Currently "best" is reserved for future use.
getProvider
in interface Providers<T>
public Collection<Provider<T>> all()
Providers
Provider
s. Will always
be a non-null return value.
all
in interface Providers<T>
public Collection<Provider<T>> all(boolean stopAtFirstMatch)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |