| 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(java.lang.String name)
Creates (or finds) a ServiceLocator.
|
abstract ServiceLocator |
ServiceLocatorFactory.create(java.lang.String name,
ServiceLocator parent)
Creates or finds a ServiceLocator.
|
abstract ServiceLocator |
ServiceLocatorFactory.create(java.lang.String name,
ServiceLocator parent,
ServiceLocatorGenerator generator)
Creates or finds a ServiceLocator.
|
abstract ServiceLocator |
ServiceLocatorFactory.find(java.lang.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(java.lang.String name,
ServiceLocator parent)
Creates or finds a ServiceLocator.
|
abstract ServiceLocator |
ServiceLocatorFactory.create(java.lang.String name,
ServiceLocator parent,
ServiceLocatorGenerator generator)
Creates or finds a ServiceLocator.
|
abstract void |
ServiceLocatorFactory.destroy(ServiceLocator locator)
Removes the given ServiceLocator
|
void |
ServiceLocatorListener.listenerAdded(ServiceLocator added)
This method is called whenever a named ServiceLocator has been
added to the set of ServiceLocators
|
void |
ServiceLocatorListener.listenerDestroyed(ServiceLocator destroyed)
This method is called whenever a named 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(java.util.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(java.lang.String name,
ServiceLocator parent)
Creates the ServiceLocator that will be used to
generate the ServiceLocators
|
| Modifier and Type | Method and Description |
|---|---|
ServiceLocator |
ServiceLocatorGenerator.create(java.lang.String name,
ServiceLocator parent)
Creates the ServiceLocator that will be used to
generate the ServiceLocators
|
| Modifier and Type | Method and Description |
|---|---|
ServiceLocator |
ServiceLocatorFactoryImpl.create(java.lang.String name) |
ServiceLocator |
ServiceLocatorFactoryImpl.create(java.lang.String name,
ServiceLocator parent) |
ServiceLocator |
ServiceLocatorFactoryImpl.create(java.lang.String name,
ServiceLocator parent,
ServiceLocatorGenerator generator) |
ServiceLocator |
ServiceLocatorFactoryImpl.find(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
ServiceLocator |
ServiceLocatorFactoryImpl.create(java.lang.String name,
ServiceLocator parent) |
ServiceLocator |
ServiceLocatorFactoryImpl.create(java.lang.String name,
ServiceLocator parent,
ServiceLocatorGenerator generator) |
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(java.lang.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(java.lang.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 <T> ActiveDescriptor<T> |
ServiceLocatorUtilities.addOneConstant(ServiceLocator locator,
java.lang.Object constant)
This method adds one existing object to the given service locator.
|
static <T> ActiveDescriptor<T> |
ServiceLocatorUtilities.addOneConstant(ServiceLocator locator,
java.lang.Object constant,
java.lang.String name,
java.lang.reflect.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.enablePerThreadScope(ServiceLocator locator)
This method will add the ability to use the
PerThread scope to
the given locator. |
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,
java.lang.Class<T> type,
java.lang.annotation.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,
java.lang.String className)
Returns the best service matching the passed in fully qualified
class name of the service
|
static void |
ServiceLocatorUtilities.removeFilter(ServiceLocator locator,
Filter filter)
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.
|
| Constructor and Description |
|---|
AliasDescriptor(ServiceLocator locator,
ActiveDescriptor<T> descriptor,
java.lang.String contract,
java.lang.String name)
Construct an AliasDescriptor.
|
Copyright © 2013 Oracle Corporation. All Rights Reserved.