public final class HookRegistry extends Object
HookConfigurator
Modifier and Type | Field and Description |
---|---|
static String |
HOOK_CONFIGURATORS
The hook configurators property key ("hookconfigurators.properties") used in
a hook configurators properties file to specify a comma separated list of fully
qualified hook configurator classes.
|
static String |
HOOK_CONFIGURATORS_FILE
The hook configurators properties file ("hookconfigurators.properties")
|
static String |
PROP_HOOK_CONFIGURATORS
A system property ("osgi.hook.configurators") used to specify the list
of hook configurators.
|
static String |
PROP_HOOK_CONFIGURATORS_EXCLUDE
A system property ("osgi.hook.configurators.exclude") used to exclude
any hook configurators.
|
static String |
PROP_HOOK_CONFIGURATORS_INCLUDE
A system property ("osgi.hook.configurators.include") used to add additional
hook configurators.
|
Constructor and Description |
---|
HookRegistry(BaseAdaptor adaptor) |
Modifier and Type | Method and Description |
---|---|
void |
addAdaptorHook(AdaptorHook adaptorHook)
Adds a adaptor hook to this hook registry.
|
void |
addBundleFileFactoryHook(BundleFileFactoryHook factory)
Adds a bundle file factory to this hook registry.
|
void |
addBundleFileWrapperFactoryHook(BundleFileWrapperFactoryHook factory)
Adds a bundle file wrapper factory for this hook registry
|
void |
addClassLoaderDelegateHook(ClassLoaderDelegateHook classLoaderDelegateHook)
Adds a class loader delegate hook to this hook registry.
|
void |
addClassLoadingHook(ClassLoadingHook classLoadingHook)
Adds a class loading hook to this hook registry.
|
void |
addClassLoadingStatsHook(ClassLoadingStatsHook classLoadingStatsHook)
Adds a class loading stats hook to this hook registry.
|
void |
addStorageHook(StorageHook storageHook)
Adds a storage hook to this hook registry.
|
void |
addWatcher(BundleWatcher watcher)
Adds a bundle watcher to this hook registry.
|
BaseAdaptor |
getAdaptor()
Returns the base adaptor associated with this hook registry.
|
AdaptorHook[] |
getAdaptorHooks()
Returns the list of configured adaptor hooks.
|
BundleFileFactoryHook[] |
getBundleFileFactoryHooks()
Returns the list of configured bundle file factories.
|
BundleFileWrapperFactoryHook[] |
getBundleFileWrapperFactoryHooks()
Returns the configured bundle file wrapper factories
|
ClassLoaderDelegateHook[] |
getClassLoaderDelegateHooks()
Returns the list of configured class loader delegate hooks.
|
ClassLoadingHook[] |
getClassLoadingHooks()
Returns the list of configured class loading hooks.
|
ClassLoadingStatsHook[] |
getClassLoadingStatsHooks()
Returns the list of configured class loading stats hooks.
|
StorageHook[] |
getStorageHooks()
Returns the list of configured storage hooks.
|
BundleWatcher[] |
getWatchers()
Returns the list of configured bundle watchers.
|
FrameworkLogEntry[] |
initialize()
Initializes the hook configurators.
|
public static final String HOOK_CONFIGURATORS_FILE
A framework extension may supply a hook configurators properties file to specify a list of hook configurators.
HOOK_CONFIGURATORS
,
Constant Field Valuespublic static final String HOOK_CONFIGURATORS
public static final String PROP_HOOK_CONFIGURATORS_INCLUDE
public static final String PROP_HOOK_CONFIGURATORS_EXCLUDE
public static final String PROP_HOOK_CONFIGURATORS
public HookRegistry(BaseAdaptor adaptor)
public FrameworkLogEntry[] initialize()
1. Get a list of hook configurators from all hook configurators properties files on the classpath, add this list to the overall list of hook configurators, remove duplicates.
2. Get a list of hook configurators from the ("osgi.hook.configurators.include") system property and add this list to the overall list of hook configurators, remove duplicates.
3. Get a list of hook configurators from the ("osgi.hook.configurators.exclude") system property and remove this list from the overall list of hook configurators.
4. Load each hook configurator class, create a new instance, then call the HookConfigurator.addHooks(HookRegistry)
method
5. Set this HookRegistry object to read only to prevent any other hooks from being added.
public AdaptorHook[] getAdaptorHooks()
public BundleWatcher[] getWatchers()
public ClassLoadingHook[] getClassLoadingHooks()
public ClassLoadingStatsHook[] getClassLoadingStatsHooks()
public ClassLoaderDelegateHook[] getClassLoaderDelegateHooks()
public StorageHook[] getStorageHooks()
public BundleFileFactoryHook[] getBundleFileFactoryHooks()
public BundleFileWrapperFactoryHook[] getBundleFileWrapperFactoryHooks()
public void addAdaptorHook(AdaptorHook adaptorHook)
adaptorHook
- an adaptor hook object.public void addWatcher(BundleWatcher watcher)
watcher
- a bundle watcher object.public void addClassLoadingHook(ClassLoadingHook classLoadingHook)
classLoadingHook
- a class loading hook object.public void addClassLoadingStatsHook(ClassLoadingStatsHook classLoadingStatsHook)
classLoadingStatsHook
- a class loading hook object.public void addClassLoaderDelegateHook(ClassLoaderDelegateHook classLoaderDelegateHook)
classLoaderDelegateHook
- a class loader delegate hook.public void addStorageHook(StorageHook storageHook)
storageHook
- a storage hook object.public void addBundleFileFactoryHook(BundleFileFactoryHook factory)
factory
- a bundle file factory object.public void addBundleFileWrapperFactoryHook(BundleFileWrapperFactoryHook factory)
factory
- a bundle file wrapper factory object.public BaseAdaptor getAdaptor()
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.