|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.glassfish.jersey.internal.inject.Providers
public class Providers
Utility class providing a set of utility methods for easier and more type-safe interaction with HK2 injection layer.
| Method Summary | ||
|---|---|---|
static
|
factoryOf(T instance)
Wrap an instance into a HK2 service factory. |
|
static
|
getAllProviders(ServiceLocator locator,
java.lang.Class<T> contract)
Get the set of all providers (custom and default) registered for the given service provider contract in the underlying HK2 service locator container. |
|
static
|
getAllProviders(ServiceLocator locator,
java.lang.Class<T> contract,
java.util.Comparator<T> comparator)
Get the set of all providers (custom and default) registered for the given service provider contract in the underlying HK2 service locator container ordered based on the given comparator. |
|
static
|
getCustomProviders(ServiceLocator locator,
java.lang.Class<T> contract)
Get the set of all custom providers registered for the given service provider contract in the underlying HK2 service locator container. |
|
static java.util.Set<java.lang.Class<?>> |
getProviderContracts(java.lang.Class<?> clazz)
Returns provider contracts recognized by Jersey that are implemented by the clazz. |
|
static
|
getProviders(ServiceLocator locator,
java.lang.Class<T> contract)
Get the set of default providers registered for the given service provider contract in the underlying HK2 service locator container. |
|
static
|
getProviders(ServiceLocator locator,
java.lang.Class<T> contract,
java.util.Comparator<T> comparator)
Get the set of all providers registered for the given service provider contract in the underlying HK2 locator container. |
|
static boolean |
isProvider(java.lang.Class<?> clazz)
Returns true if the given class is a provider (implements specific interfaces). |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static <T> Factory<T> factoryOf(T instance)
T - Java type if the contract produced by the provider and factory.instance - instance to be wrapped into (and provided by) the factory.
public static <T> java.util.Set<T> getProviders(ServiceLocator locator,
java.lang.Class<T> contract)
HK2 service locator container.
T - service provider contract Java type.locator - underlying HK2 service locator.contract - service provider contract.
public static <T> java.util.Set<T> getCustomProviders(ServiceLocator locator,
java.lang.Class<T> contract)
HK2 service locator container.
T - service provider contract Java type.locator - underlying HK2 service locator.contract - service provider contract.
public static <T> java.util.List<T> getAllProviders(ServiceLocator locator,
java.lang.Class<T> contract)
HK2 service locator container.
T - service provider contract Java type.locator - underlying HK2 service locator.contract - service provider contract.
public static <T> java.util.List<T> getAllProviders(ServiceLocator locator,
java.lang.Class<T> contract,
java.util.Comparator<T> comparator)
HK2 service locator container ordered based on the given comparator.
T - service provider contract Java type.locator - underlying HK2 service locator.contract - service provider contract.comparator - comparator to be used for sorting the returned providers.
comparator.
public static <T> java.util.SortedSet<T> getProviders(ServiceLocator locator,
java.lang.Class<T> contract,
java.util.Comparator<T> comparator)
HK2 locator container.
T - service provider contract Java type.locator - underlying HK2 service locator.contract - service provider contract.comparator - contract comparator used for ordering contracts in the
set.
public static java.util.Set<java.lang.Class<?>> getProviderContracts(java.lang.Class<?> clazz)
clazz.
Recognized provider contracts include all JAX-RS providers as well as all Jersey SPI
components annotated with @Contract annotation.
clazz - class to extract the provider interfaces from.
public static boolean isProvider(java.lang.Class<?> clazz)
true if the given class is a provider (implements specific interfaces).
See getProviderContracts(java.lang.Class>).
clazz - class to test.
true if the class is provider, false otherwise.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||