public class ClassLoaderPostProcessor extends Object implements PopulatorPostProcessor
PopulatorPostProcessor
that adds an HK2Loader
based on a ClassLoader. This is useful for those writing ClassLoader
based plugins that need to ensure their descriptors are loaded with
the given ClassLoaderConstructor and Description |
---|
ClassLoaderPostProcessor(ClassLoader classloader)
Creates a
PopulatorPostProcessor that will set the HK2Loader
of descriptors added with
Populator.populate(org.glassfish.hk2.api.DescriptorFileFinder, PopulatorPostProcessor...) . |
ClassLoaderPostProcessor(ClassLoader classloader,
boolean force)
Creates a
PopulatorPostProcessor that will set the HK2Loader
of descriptors added with
Populator.populate(org.glassfish.hk2.api.DescriptorFileFinder, PopulatorPostProcessor...) |
Modifier and Type | Method and Description |
---|---|
DescriptorImpl |
process(ServiceLocator serviceLocator,
DescriptorImpl descriptorImpl)
This method can be used to alter the descriptor read in.
|
public ClassLoaderPostProcessor(ClassLoader classloader, boolean force)
PopulatorPostProcessor
that will set the HK2Loader
of descriptors added with
Populator.populate(org.glassfish.hk2.api.DescriptorFileFinder, PopulatorPostProcessor...)
classloader
- The classloader to use when classloading the added servicesforce
- If true then this will overwrite any value in the descriptor. If false then if
the descriptor will only be changed if the HK2Loader field of the descriptor is not
already setpublic ClassLoaderPostProcessor(ClassLoader classloader)
PopulatorPostProcessor
that will set the HK2Loader
of descriptors added with
Populator.populate(org.glassfish.hk2.api.DescriptorFileFinder, PopulatorPostProcessor...)
.
The HK2Loader field of services will only be changed if they have not already
been setclassloader
- The classloader to use when classloading the added servicespublic DescriptorImpl process(ServiceLocator serviceLocator, DescriptorImpl descriptorImpl)
PopulatorPostProcessor
process
in interface PopulatorPostProcessor
serviceLocator
- the ServiceLocator being populated. Will not be nulldescriptorImpl
- The descriptorImpl read from some external source. This
processor can modify this descriptor fullyCopyright © 2009-2017, Oracle and/or its affiliates. All Rights Reserved.