Package | Description |
---|---|
org.glassfish.hk2.api | |
org.glassfish.hk2.extension | |
org.glassfish.hk2.internal | |
org.glassfish.hk2.utilities |
Modifier and Type | Method and Description |
---|---|
abstract ServiceLocator |
ServiceLocatorFactory.create(String name)
Creates (or finds) a ServiceLocator.
|
abstract ServiceLocator |
ServiceLocatorFactory.create(String name,
ServiceLocator parent)
Creates or finds a ServiceLocator.
|
abstract ServiceLocator |
ServiceLocatorFactory.create(String name,
ServiceLocator parent,
ServiceLocatorGenerator generator)
Creates or finds a ServiceLocator.
|
abstract ServiceLocator |
ServiceLocatorFactory.create(String name,
ServiceLocator parent,
ServiceLocatorGenerator generator,
ServiceLocatorFactory.CreatePolicy policy)
Creates a ServiceLocator.
|
abstract ServiceLocator |
ServiceLocatorFactory.find(String name)
Finds the ServiceLocator with this name
|
ServiceLocator |
ServiceLocator.getParent()
Gets the parent service locator for this locator
|
Modifier and Type | Method and Description |
---|---|
abstract ServiceLocator |
ServiceLocatorFactory.create(String name,
ServiceLocator parent)
Creates or finds a ServiceLocator.
|
abstract ServiceLocator |
ServiceLocatorFactory.create(String name,
ServiceLocator parent,
ServiceLocatorGenerator generator)
Creates or finds a ServiceLocator.
|
abstract ServiceLocator |
ServiceLocatorFactory.create(String name,
ServiceLocator parent,
ServiceLocatorGenerator generator,
ServiceLocatorFactory.CreatePolicy policy)
Creates a ServiceLocator.
|
abstract void |
ServiceLocatorFactory.destroy(ServiceLocator locator)
Removes the given ServiceLocator
|
void |
ServiceLocatorListener.locatorAdded(ServiceLocator added)
This method is called whenever a ServiceLocator has been
added to the set of ServiceLocators.
|
void |
ServiceLocatorListener.locatorDestroyed(ServiceLocator destroyed)
This method is called whenever a ServiceLocator will be
removed from the set of ServiceLocators.
|
DescriptorImpl |
PopulatorPostProcessor.process(ServiceLocator serviceLocator,
DescriptorImpl descriptorImpl)
This method can be used to alter the descriptor read in.
|
Modifier and Type | Method and Description |
---|---|
void |
ServiceLocatorListener.initialize(Set<ServiceLocator> initialLocators)
This method returns the complete list of named service
locators at the time that this listener is registered.
|
Modifier and Type | Method and Description |
---|---|
ServiceLocator |
ServiceLocatorGenerator.create(String name,
ServiceLocator parent)
Creates the ServiceLocator that will be used to
generate the ServiceLocators
|
Modifier and Type | Method and Description |
---|---|
ServiceLocator |
ServiceLocatorGenerator.create(String name,
ServiceLocator parent)
Creates the ServiceLocator that will be used to
generate the ServiceLocators
|
Modifier and Type | Method and Description |
---|---|
ServiceLocator |
ServiceLocatorFactoryImpl.create(String name) |
ServiceLocator |
ServiceLocatorFactoryImpl.create(String name,
ServiceLocator parent) |
ServiceLocator |
ServiceLocatorFactoryImpl.create(String name,
ServiceLocator parent,
ServiceLocatorGenerator generator) |
ServiceLocator |
ServiceLocatorFactoryImpl.create(String name,
ServiceLocator parent,
ServiceLocatorGenerator generator,
ServiceLocatorFactory.CreatePolicy policy) |
ServiceLocator |
ServiceLocatorFactoryImpl.find(String name) |
Modifier and Type | Method and Description |
---|---|
ServiceLocator |
ServiceLocatorFactoryImpl.create(String name,
ServiceLocator parent) |
ServiceLocator |
ServiceLocatorFactoryImpl.create(String name,
ServiceLocator parent,
ServiceLocatorGenerator generator) |
ServiceLocator |
ServiceLocatorFactoryImpl.create(String name,
ServiceLocator parent,
ServiceLocatorGenerator generator,
ServiceLocatorFactory.CreatePolicy policy) |
void |
ServiceLocatorFactoryImpl.destroy(ServiceLocator locator) |
Modifier and Type | Method and Description |
---|---|
static ServiceLocator |
ServiceLocatorUtilities.bind(Binder... binders)
This method will create or find a ServiceLocator with the name "default" and
bind all of the binders given together in a single config transaction.
|
static ServiceLocator |
ServiceLocatorUtilities.bind(String name,
Binder... binders)
This method will create or find a ServiceLocator with the given name and
bind all of the binders given together in a single config transaction.
|
static ServiceLocator |
ServiceLocatorUtilities.createAndPopulateServiceLocator()
This method is often the first line of a stand-alone client that wishes to use HK2.
|
static ServiceLocator |
ServiceLocatorUtilities.createAndPopulateServiceLocator(String name)
This method is often the first line of a stand-alone client that wishes to use HK2.
|
Modifier and Type | Method and Description |
---|---|
static List<ActiveDescriptor<?>> |
ServiceLocatorUtilities.addClasses(ServiceLocator locator,
boolean idempotent,
Class<?>... toAdd)
It is very often the case that one wishes to add classes that hk2
will automatically analyze for contracts and qualifiers to
a service locator.
|
static List<ActiveDescriptor<?>> |
ServiceLocatorUtilities.addClasses(ServiceLocator locator,
Class<?>... toAdd)
It is very often the case that one wishes to add classes that hk2
will automatically analyze for contracts and qualifiers to
a service locator.
|
static List<FactoryDescriptors> |
ServiceLocatorUtilities.addFactoryConstants(ServiceLocator locator,
Factory<?>... constants)
This method adds factory constants to the given locator.
|
static List<FactoryDescriptors> |
ServiceLocatorUtilities.addFactoryDescriptors(ServiceLocator locator,
boolean requiresDeepCopy,
FactoryDescriptors... factories)
Adds the given factory descriptors to the service locator
|
static List<FactoryDescriptors> |
ServiceLocatorUtilities.addFactoryDescriptors(ServiceLocator locator,
FactoryDescriptors... factories)
Adds the given factory descriptors to the service locator
|
static <T> ActiveDescriptor<T> |
ServiceLocatorUtilities.addOneConstant(ServiceLocator locator,
Object constant)
This method adds one existing object to the given service locator.
|
static <T> ActiveDescriptor<T> |
ServiceLocatorUtilities.addOneConstant(ServiceLocator locator,
Object constant,
String name,
Type... contracts)
This method adds one existing object to the given service locator.
|
static <T> ActiveDescriptor<T> |
ServiceLocatorUtilities.addOneDescriptor(ServiceLocator locator,
Descriptor descriptor)
It is very often the case that one wishes to add a single descriptor to
a service locator.
|
static <T> ActiveDescriptor<T> |
ServiceLocatorUtilities.addOneDescriptor(ServiceLocator locator,
Descriptor descriptor,
boolean requiresDeepCopy)
It is very often the case that one wishes to add a single descriptor to
a service locator.
|
static void |
ServiceLocatorUtilities.bind(ServiceLocator locator,
Binder... binders)
This method will bind all of the binders given together in a
single config transaction.
|
static DynamicConfiguration |
ServiceLocatorUtilities.createDynamicConfiguration(ServiceLocator locator)
This method returns a
DynamicConfiguration for use with adding
and removing services to the given ServiceLocator . |
static void |
ServiceLocatorUtilities.dumpAllDescriptors(ServiceLocator locator)
Dumps all descriptors in this ServiceLocator to stderr
|
static void |
ServiceLocatorUtilities.dumpAllDescriptors(ServiceLocator locator,
PrintStream output)
Dumps all descriptors in this ServiceLocator to the given PrintStream
|
static void |
ServiceLocatorUtilities.enableGreedyResolution(ServiceLocator locator)
Enables greedy service resolution in this service locator by
adding the
GreedyResolver into the service locator. |
static void |
ServiceLocatorUtilities.enableImmediateScope(ServiceLocator locator)
This method will add the ability to use the
Immediate scope to
the given locator. |
static ImmediateController |
ServiceLocatorUtilities.enableImmediateScopeSuspended(ServiceLocator locator)
This method will add the ability to use the
Immediate scope to
the given locator. |
static void |
ServiceLocatorUtilities.enableInheritableThreadScope(ServiceLocator locator)
This method will add the ability to use the
InheritableThread
scope to the given locator. |
static void |
ServiceLocatorUtilities.enableLookupExceptions(ServiceLocator locator)
This method will cause lookup operations to throw exceptions when
exceptions are encountered in underlying operations such as
classloading.
|
static void |
ServiceLocatorUtilities.enablePerThreadScope(ServiceLocator locator)
This method will add the ability to use the
PerThread scope to
the given locator. |
static void |
ServiceLocatorUtilities.enableTopicDistribution(ServiceLocator locator)
Deprecated.
Use ExtrasUtilities.enableTopicDistribution. This method WILL BE REMOVED
in the next version of hk2
|
static <T> ActiveDescriptor<T> |
ServiceLocatorUtilities.findOneDescriptor(ServiceLocator locator,
Descriptor descriptor)
Finds a descriptor in the given service locator.
|
static <T> T |
ServiceLocatorUtilities.findOrCreateService(ServiceLocator locator,
Class<T> type,
Annotation... qualifiers)
This method will first attempt to find a service corresponding to the type and qualifiers
passed in to the method, and if one is found simply returns it.
|
static <T> T |
ServiceLocatorUtilities.getService(ServiceLocator locator,
Descriptor descriptor)
Returns the service in this service locator given the current descriptor.
|
static <T> T |
ServiceLocatorUtilities.getService(ServiceLocator locator,
String className)
Returns the best service matching the passed in fully qualified
class name of the service
|
DescriptorImpl |
ClassLoaderPostProcessor.process(ServiceLocator serviceLocator,
DescriptorImpl descriptorImpl) |
DescriptorImpl |
DuplicatePostProcessor.process(ServiceLocator serviceLocator,
DescriptorImpl descriptorImpl) |
static void |
ServiceLocatorUtilities.removeFilter(ServiceLocator locator,
Filter filter)
Removes all the descriptors from the given locator that match the
given filter
|
static void |
ServiceLocatorUtilities.removeFilter(ServiceLocator locator,
Filter filter,
boolean includeAliasDescriptors)
Removes all the descriptors from the given locator that match the
given filter
|
static void |
ServiceLocatorUtilities.removeOneDescriptor(ServiceLocator locator,
Descriptor descriptor)
This method will attempt to remove descriptors matching the passed in descriptor from
the given locator.
|
static void |
ServiceLocatorUtilities.removeOneDescriptor(ServiceLocator locator,
Descriptor descriptor,
boolean includeAliasDescriptors)
This method will attempt to remove descriptors matching the passed in descriptor from
the given locator.
|
Constructor and Description |
---|
AliasDescriptor(ServiceLocator locator,
ActiveDescriptor<T> descriptor,
String contract,
String name)
Construct an AliasDescriptor.
|
Copyright © 2009–2019 Oracle Corporation. All rights reserved.