Top Description Methods
org.glassfish.hk2.api

public Interface Populator

Imports
java.io.IOException, java.util.List, org.glassfish.hk2.utilities.DescriptorImpl

Implementations of this interface are used to populate HK2 service locators from inhabitants files
Author
jwells
See Also
DynamicConfigurationService#getPopulator

Method Summary

Modifier and TypeMethod and Description
public List<ActiveDescriptor<?>>

Returns:

The list of descriptors added to the system. Will not return null, but may return an empty list
populate
(DescriptorFileFinder
An object that finds files in the environment. If this is null then the system will look in the service locator for an implementation of DescriptorFileFinder. If one is still not find this service will return an empty list
fileFinder
,
PopulatorPostProcessor...
post-processors that allows the environment to modify the set of descriptors that are added to the system.
postProcessors
)

This method can be used to populate the service locator with files that have been written out using the DescriptorImpl writeObject method.

public List<ActiveDescriptor<?>>

Returns:

The list of descriptors added to the system. Will not return null, but may return an empty list
populate
()

This method will populate the service locator using the system classloader to find the hk2-locator files from the default location of META-INF/hk2-locator/default.

Method Detail

populateback to summary
public List<ActiveDescriptor<?>> populate(DescriptorFileFinder fileFinder, PopulatorPostProcessor... postProcessors) throws IOException, MultiException

This method can be used to populate the service locator with files that have been written out using the DescriptorImpl writeObject method.

Parameters
fileFinder:DescriptorFileFinder

An object that finds files in the environment. If this is null then the system will look in the service locator for an implementation of DescriptorFileFinder. If one is still not find this service will return an empty list

postProcessors:PopulatorPostProcessor[]

post-processors that allows the environment to modify the set of descriptors that are added to the system.

Returns:List<ActiveDescriptor<?>>

The list of descriptors added to the system. Will not return null, but may return an empty list

Exceptions
IOException:
In case of an error reading the input streams
MultiException:
if the user code throws an error, in which case none of the descriptors will be added to the system
populateback to summary
public List<ActiveDescriptor<?>> populate() throws IOException, MultiException

This method will populate the service locator using the system classloader to find the hk2-locator files from the default location of META-INF/hk2-locator/default. No post processing will be done on the descriptors added to the system

Returns:List<ActiveDescriptor<?>>

The list of descriptors added to the system. Will not return null, but may return an empty list

Exceptions
IOException:
if there was an error reading any of the descriptors
MultiException:
if the user code throws an error, in which case none of the descriptors will be added to the system