|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jvnet.hk2.deprecated.internal.ContractLocatorImpl<T>
T
- The type of object to be returned from the Provider
@Deprecated public class ContractLocatorImpl<T>
Constructor Summary | |
---|---|
ContractLocatorImpl(ServiceLocator locator,
String contractName)
Deprecated. Creates a contract locator from the information given |
Method Summary | ||
---|---|---|
Collection<Provider<T>> |
all()
Deprecated. Return all applicable Provider s. |
|
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. |
|
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 locator, String contractName)
locator
- The locator to use to fetch the implementations or providerscontractName
- The name of the contract to search forMethod Detail |
---|
public Collection<Provider<T>> all()
Providers
Provider
s. Will always
be a non-null return value.
all
in interface Providers<T>
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 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 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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |