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.
|
DescriptorImpl |
ContextDuplicatePostProcessor.process(ServiceLocator serviceLocator,
DescriptorImpl descriptorImpl) |
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> |
ClassPathBasedModulesRegistry.parseInhabitants(Module module,
String name,
ServiceLocator serviceLocator,
List<PopulatorPostProcessor> postProcessors) |
protected List<ActiveDescriptor> |
SingleModulesRegistry.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.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 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
|
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. |
void |
ConfigPopulator.populateConfig(ServiceLocator serviceLocator) |
static void |
HK2Populator.populateConfig(ServiceLocator serviceLocator) |
DescriptorImpl |
PopulatorPostProcessor.process(ServiceLocator serviceLocator,
DescriptorImpl descriptorImpl)
This method can be used to alter the descriptor read in.
|
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 |
---|---|
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.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) |
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.
|
Modifier and Type | Method and Description |
---|---|
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.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,
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
|
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,
String contract,
String name)
Construct an AliasDescriptor.
|
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 | 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
|
Modifier and Type | Method and Description |
---|---|
static ServiceLocator |
HK2TestUtilities.create(String name,
ServiceLocator parent,
HK2TestModule... modules)
Will create a ServiceLocator after doing test-specific bindings from the TestModule
|
Copyright © 2014 Oracle Corporation. All rights reserved.