Modifier and Type | Method and Description |
---|---|
ServiceLocator |
ModulesRegistry.createServiceLocator()
Creates the default
ServiceLocator from all the modules in this registry
Calling this method has the same effect of calling #createServiceLocator("default") |
ServiceLocator |
ModulesRegistry.createServiceLocator(ServiceLocator serviceLocator,
String name,
List<PopulatorPostProcessor> postProcessors)
Creates a
ServiceLocator with the provided parent. |
ServiceLocator |
ModulesRegistry.createServiceLocator(String name)
Creates a
ServiceLocator from all the modules in this registry
Cal;ling this method has the same effect of calling ModulesRegistry.newServiceLocator() followed by
#populateServiceLocator(String, org.glassfish.hk2.api.ServiceLocator, java.util.List . |
ServiceLocator |
ModulesRegistry.newServiceLocator()
Creates an uninitialized
ServiceLocator |
ServiceLocator |
ModulesRegistry.newServiceLocator(ServiceLocator parent) |
Modifier and Type | Method and Description |
---|---|
ServiceLocator |
ModulesRegistry.createServiceLocator(ServiceLocator serviceLocator,
String name,
List<PopulatorPostProcessor> postProcessors)
Creates a
ServiceLocator with the provided parent. |
ServiceLocator |
ModulesRegistry.newServiceLocator(ServiceLocator parent) |
void |
ModulesRegistry.populateConfig(ServiceLocator serviceLocator) |
void |
ModulesRegistry.populateServiceLocator(String name,
ServiceLocator h,
List<PopulatorPostProcessor> postProcessors)
Populates a
ServiceLocator from all the modules in this registry. |
Modifier and Type | Method and Description |
---|---|
ServiceLocator |
Main.createServiceLocator(ModulesRegistry mr,
StartupContext context,
List<PopulatorPostProcessor> postProcessors,
DescriptorFileFinder descriptorFileFinder) |
ServiceLocator |
Main.getServiceLocator() |
Modifier and Type | Method and Description |
---|---|
ModuleStartup |
Main.findStartupService(ModulesRegistry registry,
ServiceLocator serviceLocator,
String mainModuleName,
StartupContext context)
Return the ModuleStartup service configured to be used to start the
system.
|
Modifier and Type | Method and Description |
---|---|
ServiceLocator |
AbstractModulesRegistryImpl.createServiceLocator() |
ServiceLocator |
AbstractModulesRegistryImpl.createServiceLocator(ServiceLocator parent,
String name,
List<PopulatorPostProcessor> postProcessors) |
ServiceLocator |
AbstractModulesRegistryImpl.createServiceLocator(String name) |
ServiceLocator |
AbstractModulesRegistryImpl.newServiceLocator()
Creates an uninitialized
ServiceLocator |
ServiceLocator |
AbstractModulesRegistryImpl.newServiceLocator(ServiceLocator parent)
Create a new ServiceLocator optionally providing a parent Services
|
Modifier and Type | Method and Description |
---|---|
protected Set<ServiceLocator> |
AbstractModulesRegistryImpl.getAllServiceLocators() |
Modifier and Type | Method and Description |
---|---|
ServiceLocator |
AbstractModulesRegistryImpl.createServiceLocator(ServiceLocator parent,
String name,
List<PopulatorPostProcessor> postProcessors) |
protected void |
AbstractModulesRegistryImpl.initializeServiceLocator(ServiceLocator serviceLocator) |
ServiceLocator |
AbstractModulesRegistryImpl.newServiceLocator(ServiceLocator parent)
Create a new ServiceLocator optionally providing a parent Services
|
protected abstract List<ActiveDescriptor> |
AbstractModulesRegistryImpl.parseInhabitants(Module module,
String name,
ServiceLocator serviceLocator,
List<PopulatorPostProcessor> postProcessors) |
void |
AbstractModulesRegistryImpl.populateConfig(ServiceLocator serviceLocator) |
void |
AbstractModulesRegistryImpl.populateServiceLocator(String name,
ServiceLocator serviceLocator,
List<PopulatorPostProcessor> postProcessors)
Creates a
ServiceLocator from all the modules in this registry |
Modifier and Type | Method and Description |
---|---|
protected List<ActiveDescriptor> |
ModulesRegistryImpl.parseInhabitants(Module module,
String name,
ServiceLocator serviceLocator,
List<PopulatorPostProcessor> postProcessors) |
Modifier and Type | Method and Description |
---|---|
ServiceLocator |
StaticModulesRegistry.createServiceLocator(String name) |
Modifier and Type | Method and Description |
---|---|
protected List<ActiveDescriptor> |
SingleModulesRegistry.parseInhabitants(Module module,
String name,
ServiceLocator serviceLocator,
List<PopulatorPostProcessor> postProcessors) |
protected List<ActiveDescriptor> |
ClassPathBasedModulesRegistry.parseInhabitants(Module module,
String name,
ServiceLocator serviceLocator,
List<PopulatorPostProcessor> postProcessors) |
void |
StaticModulesRegistry.populateConfig(ServiceLocator serviceLocator) |
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 |
---|---|
static void |
HK2Populator.populate(ServiceLocator serviceLocator)
This method can be used to populate the service locator with files that
have been written out using the
DescriptorImpl writeObject method,
looking in the classpath to locate these files |
static List<ActiveDescriptor> |
HK2Populator.populate(ServiceLocator serviceLocator,
DescriptorFileFinder fileFinder,
List<? extends PopulatorPostProcessor> postProcessors)
This method can be used to populate the service locator with files that
have been written out using the
DescriptorImpl writeObject method. |
static void |
HK2Populator.populateConfig(ServiceLocator serviceLocator) |
void |
ConfigPopulator.populateConfig(ServiceLocator serviceLocator)
Called during the creation sequence of a service locator, and can be used
to populate configuration data
|
Modifier and Type | Method and Description |
---|---|
DescriptorImpl |
Hk2LoaderPopulatorPostProcessor.process(ServiceLocator serviceLocator,
DescriptorImpl descriptorImpl)
Uses the given classloader to load the class from the descriptor
|
Modifier and Type | Method and Description |
---|---|
static void |
ConfigurationUtilities.enableConfigurationSystem(ServiceLocator locator)
Enables the Configuration subsystem of HK2.
|
Modifier and Type | Method and Description |
---|---|
static void |
ManagerUtilities.enableConfigurationHub(ServiceLocator locator)
This method will add the Hub service to the given service locator.
|
Modifier and Type | Method and Description |
---|---|
static void |
PropertyFileUtilities.enablePropertyFileService(ServiceLocator locator)
This class adds the system implementation of
PropertyFileService
to the given service locator. |
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 |
---|---|
static void |
ExtrasUtilities.bridgeServiceLocator(ServiceLocator into,
ServiceLocator from)
This method will bridge all non-local services from the
from ServiceLocator into the into ServiceLocator.
|
static void |
ExtrasUtilities.enableDefaultInterceptorServiceImplementation(ServiceLocator locator)
This method adds in a default implementation of the
InterceptionService
which uses annotations to denote which services should intercept other services. |
static void |
ExtrasUtilities.enableOperations(ServiceLocator locator)
This method adds in the infrastructure necessary to enable HK2 Operations support.
|
static void |
ExtrasUtilities.enableTopicDistribution(ServiceLocator locator)
This method will enable the default topic distribution service.
|
static void |
ExtrasUtilities.unbridgeServiceLocator(ServiceLocator into,
ServiceLocator from)
This method will remove all non-local services from the
from ServiceLocator into the into ServiceLocator.
|
Modifier and Type | Method and Description |
---|---|
void |
Hk2BridgeImpl.setRemote(ServiceLocator remote) |
Constructor and Description |
---|
CrossOverDescriptor(ServiceLocator local,
ActiveDescriptor<T> localService) |
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 void |
JsonUtilities.enableJsonService(ServiceLocator locator)
This method will make available a
XmlService named
JsonUtilities.JSON_SERVICE_NAME to be used to parse JSON
formatted data. |
Modifier and Type | Method and Description |
---|---|
static void |
PBufUtilities.enablePBufService(ServiceLocator locator)
Idempotently enables the PBuf parser in the given ServiceLocator.
|
Modifier and Type | Method and Description |
---|---|
static void |
RunLevelServiceUtilities.enableRunLevelService(ServiceLocator locator)
Enables the RunLevelService in the given
ServiceLocator . |
Modifier and Type | Method and Description |
---|---|
static int |
Utilities.getRunLevelMode(ServiceLocator locator,
Descriptor descriptor,
Integer modeOverride)
Get the run level mode from the metadata of the given descriptor.
|
static int |
Utilities.getRunLevelValue(ServiceLocator locator,
Descriptor descriptor)
Get the run level value from the metadata of the given descriptor.
|
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 |
DuplicatePostProcessor.process(ServiceLocator serviceLocator,
DescriptorImpl descriptorImpl) |
DescriptorImpl |
ClassLoaderPostProcessor.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.
|
Modifier and Type | Method and Description |
---|---|
static void |
XmlServiceUtilities.enableDomXmlService(ServiceLocator locator)
This will enable all of the same xml parsers as
XmlServiceUtilities.enableXmlService(ServiceLocator) but will
set the rank of the stream-based xml parser to be
higher than that of the JAXB based one |
static void |
XmlServiceUtilities.enableXmlService(ServiceLocator locator)
Enables Hk2 XmlServices in the given locator.
|
Modifier and Type | Method and Description |
---|---|
ServiceLocator |
DynamicChangeInfo.getServiceLocator() |
ServiceLocator |
XmlServiceImpl.getServiceLocator() |
Modifier and Type | Method and Description |
---|---|
ServiceLocator |
ServiceLocatorGeneratorImpl.create(String name,
ServiceLocator parent) |
Modifier and Type | Method and Description |
---|---|
ServiceLocator |
ServiceLocatorGeneratorImpl.create(String name,
ServiceLocator parent) |
Modifier and Type | Method and Description |
---|---|
abstract void |
GuiceBridge.initializeGuiceBridge(ServiceLocator locator)
This method will initialize the given service locator for use with the Guice/HK2
bridge.
|
Constructor and Description |
---|
HK2IntoGuiceBridge(ServiceLocator locator)
Creates the
HK2IntoGuiceBridge TypeLocator that must
be bound into the Module with a call to bindListener. |
Modifier and Type | Method and Description |
---|---|
void |
GuiceBridgeImpl.initializeGuiceBridge(ServiceLocator locator) |
Constructor and Description |
---|
HK2ToGuiceTypeListenerImpl(ServiceLocator locator)
Creates the
HK2IntoGuiceBridge TypeLocator that must
be bound into the Module with a call to bindListener. |
Modifier and Type | Class and Description |
---|---|
class |
ServiceLocatorImpl |
Modifier and Type | Method and Description |
---|---|
ServiceLocator |
ServiceLocatorImpl.getParent() |
Modifier and Type | Method and Description |
---|---|
static ActiveDescriptor<ServiceLocator> |
Utilities.getLocatorDescriptor(ServiceLocator locator)
Returns a constant ActiveDescriptor for the basic ServiceLocator
|
Modifier and Type | Method and Description |
---|---|
static ActiveDescriptor<ServiceLocator> |
Utilities.getLocatorDescriptor(ServiceLocator locator)
Returns a constant ActiveDescriptor for the basic ServiceLocator
|
Modifier and Type | Method and Description |
---|---|
ServiceLocator |
HK2Main.createServiceLocator(ModulesRegistry mr,
StartupContext context,
List<PopulatorPostProcessor> postProcessors,
DescriptorFileFinder descriptorFileFinder) |
Modifier and Type | Method and Description |
---|---|
List<ActiveDescriptor> |
AbstractOSGiModulesRegistryImpl.parseInhabitants(Module module,
String name,
ServiceLocator serviceLocator,
List<PopulatorPostProcessor> postProcessors) |
DescriptorImpl |
OsgiPopulatorPostProcessor.process(ServiceLocator serviceLocator,
DescriptorImpl descriptorImpl) |
Modifier and Type | Method and Description |
---|---|
ServiceLocator |
SpringScopeImpl.getServiceLocator()
Returns the
ServiceLocator associated with this
scope |
Modifier and Type | Method and Description |
---|---|
abstract void |
SpringBridge.initializeSpringBridge(ServiceLocator locator)
This method will initialize the given service locator for use with the Spring/HK2
bridge.
|
void |
SpringScopeImpl.setServiceLocator(ServiceLocator locator)
Sets the service locator to use with this scope
|
Modifier and Type | Method and Description |
---|---|
void |
SpringBridgeImpl.initializeSpringBridge(ServiceLocator locator) |
Modifier and Type | Field and Description |
---|---|
protected ServiceLocator |
HK2Runner.testLocator
Test classes can use this service locator as their private test locator
|
Modifier and Type | Method and Description |
---|---|
static ServiceLocator |
HK2TestUtilities.create(String name,
HK2TestModule... modules) |
static ServiceLocator |
HK2TestUtilities.create(String name,
ServiceLocator parent,
HK2TestModule... modules)
Will create a ServiceLocator after doing test-specific bindings from the TestModule
|
protected ServiceLocator |
ServiceLocatorTestRule.createServiceLocator(org.junit.runner.Description testDescription)
Creates and returns a
ServiceLocator suitable for the
JUnit test described by the supplied Description . |
Modifier and Type | Method and Description |
---|---|
protected void |
ServiceLocatorTestRule.configureServiceLocator(ServiceLocator serviceLocator,
org.junit.runner.Description testDescription)
Configures the supplied
ServiceLocator for use by the
test described by the supplied Description . |
static ServiceLocator |
HK2TestUtilities.create(String name,
ServiceLocator parent,
HK2TestModule... modules)
Will create a ServiceLocator after doing test-specific bindings from the TestModule
|
protected void |
ServiceLocatorTestRule.performDependencyInjection(ServiceLocator serviceLocator,
T test)
Performs HK2 dependency injection on this
ServiceLocatorTestRule and the supplied test instance, using the
supplied ServiceLocator as needed. |
Constructor and Description |
---|
ClassVisitorImpl(ServiceLocator locator,
boolean verbose,
Set<String> excludes)
Creates this with the config to add to if this is a service
|
Copyright © 2009–2023 Oracle Corporation. All rights reserved.