public class EclipseLazyStarter extends Object implements ClassLoadingStatsHook, AdaptorHook, HookConfigurator
Constructor and Description |
---|
EclipseLazyStarter() |
Modifier and Type | Method and Description |
---|---|
void |
addHooks(HookRegistry hookRegistry)
Adds hooks to the specified hook registry.
|
void |
addProperties(Properties properties)
Gets called by the adaptor during
FrameworkAdaptor.getProperties() . |
FrameworkLog |
createFrameworkLog()
Gets called by the adaptor during
FrameworkAdaptor.getFrameworkLog() . |
void |
frameworkStart(BundleContext context)
Gets called by the adaptor during
FrameworkAdaptor.frameworkStart(BundleContext) . |
void |
frameworkStop(BundleContext context)
Gets called by the adaptor during
FrameworkAdaptor.frameworkStop(BundleContext) . |
void |
frameworkStopping(BundleContext context)
Gets called by the adaptor during
FrameworkAdaptor.frameworkStopping(BundleContext) . |
void |
handleRuntimeError(Throwable error)
Gets called by the adaptor during
FrameworkAdaptor.handleRuntimeError(Throwable) . |
void |
initialize(BaseAdaptor baseAdaptor)
Gets called by the adaptor during
FrameworkAdaptor.initialize(EventPublisher) . |
URLConnection |
mapLocationToURLConnection(String location)
Gets called by the adaptor during
FrameworkAdaptor.mapLocationToURLConnection(String) . |
void |
postFindLocalClass(String name,
Class<?> clazz,
ClasspathManager manager)
Gets called by a classpath manager during
ClasspathManager.findLocalClass(String) after
searching the local classloader for a class. |
void |
postFindLocalResource(String name,
URL resource,
ClasspathManager manager)
Gets called by a classpath manager during
ClasspathManager.findLocalResource(String) after
searching the local classloader for a resource. |
void |
preFindLocalClass(String name,
ClasspathManager manager)
Gets called by a classpath manager during
ClasspathManager.findLocalClass(String) before
searching the local classloader for a class. |
void |
preFindLocalResource(String name,
ClasspathManager manager)
Gets called by a classpath manager during
ClasspathManager.findLocalResource(String) before
searching the local classloader for a resource. |
void |
recordClassDefine(String name,
Class<?> clazz,
byte[] classbytes,
ClasspathEntry classpathEntry,
BundleEntry entry,
ClasspathManager manager)
Gets called by a classpath manager after an attempt is made to define a class.
|
public void preFindLocalClass(String name, ClasspathManager manager) throws ClassNotFoundException
ClassLoadingStatsHook
ClasspathManager.findLocalClass(String)
before
searching the local classloader for a class. A classpath manager will call this method for
each configured class loading stat hook.preFindLocalClass
in interface ClassLoadingStatsHook
name
- the name of the requested classmanager
- the classpath manager used to find and load the requested classClassNotFoundException
- to prevent the requested class from loadingpublic void postFindLocalClass(String name, Class<?> clazz, ClasspathManager manager) throws ClassNotFoundException
ClassLoadingStatsHook
ClasspathManager.findLocalClass(String)
after
searching the local classloader for a class. A classpath manager will call this method for
each configured class loading stat hook.postFindLocalClass
in interface ClassLoadingStatsHook
name
- the name of the requested classclazz
- the loaded class or null if not foundmanager
- the classpath manager used to find and load the requested classClassNotFoundException
public void preFindLocalResource(String name, ClasspathManager manager)
ClassLoadingStatsHook
ClasspathManager.findLocalResource(String)
before
searching the local classloader for a resource. A classpath manager will call this method for
each configured class loading stat hook.preFindLocalResource
in interface ClassLoadingStatsHook
name
- the name of the requested resourcemanager
- the classpath manager used to find the requested resourcepublic void postFindLocalResource(String name, URL resource, ClasspathManager manager)
ClassLoadingStatsHook
ClasspathManager.findLocalResource(String)
after
searching the local classloader for a resource. A classpath manager will call this method for
each configured class loading stat hook.postFindLocalResource
in interface ClassLoadingStatsHook
name
- the name of the requested resourceresource
- the URL to the requested resource or null if not foundmanager
- the classpath manager used to find the requested resourcepublic void recordClassDefine(String name, Class<?> clazz, byte[] classbytes, ClasspathEntry classpathEntry, BundleEntry entry, ClasspathManager manager)
ClassLoadingStatsHook
recordClassDefine
in interface ClassLoadingStatsHook
name
- the name of the class that got definedclazz
- the class object that got defined or null if an error occurred while defining a classclassbytes
- the class bytes used to define the classclasspathEntry
- the ClasspathEntry where the class bytes got read fromentry
- the BundleEntyr source of the class bytesmanager
- the classpath manager used to define the classpublic void addHooks(HookRegistry hookRegistry)
HookConfigurator
addHooks
in interface HookConfigurator
hookRegistry
- the hook registry used to add hookspublic void addProperties(Properties properties)
AdaptorHook
FrameworkAdaptor.getProperties()
.
This method allows an adaptor hook to add property values to the adaptor
properties object.addProperties
in interface AdaptorHook
properties
- the adaptor properties object.public FrameworkLog createFrameworkLog()
AdaptorHook
FrameworkAdaptor.getFrameworkLog()
.
The adaptor will call this method for each configured adaptor hook until one
adaptor hook returns a non-null value. If no adaptor hook returns a non-null value
then the adaptor will return null.createFrameworkLog
in interface AdaptorHook
public void frameworkStart(BundleContext context) throws BundleException
AdaptorHook
FrameworkAdaptor.frameworkStart(BundleContext)
.
This method allows an adaptor hook to execute code when the framework is starting
(e.g. to register services).frameworkStart
in interface AdaptorHook
context
- the system bundle contextBundleException
public void frameworkStop(BundleContext context) throws BundleException
AdaptorHook
FrameworkAdaptor.frameworkStop(BundleContext)
.
This method allows an adaptor hook to execute code when the framework is stopped
(e.g. to unregister services).frameworkStop
in interface AdaptorHook
context
- the system bundle contextBundleException
public void frameworkStopping(BundleContext context)
AdaptorHook
FrameworkAdaptor.frameworkStopping(BundleContext)
.
This method allows an adaptor hook to execute code when the framework is about to start
the shutdown process.frameworkStopping
in interface AdaptorHook
context
- the system bundle contextpublic void handleRuntimeError(Throwable error)
AdaptorHook
FrameworkAdaptor.handleRuntimeError(Throwable)
.
The adaptor will call this method for each configured adaptor hook.handleRuntimeError
in interface AdaptorHook
error
- the unexpected error that occured.public void initialize(BaseAdaptor baseAdaptor)
AdaptorHook
FrameworkAdaptor.initialize(EventPublisher)
.
This method allows an adaptor hook to save the adaptor object for later.initialize
in interface AdaptorHook
baseAdaptor
- the adaptor object associated with this AdaptorHook.public URLConnection mapLocationToURLConnection(String location) throws IOException
AdaptorHook
FrameworkAdaptor.mapLocationToURLConnection(String)
.
The adaptor will call this method for each configured adaptor hook until one
adaptor hook returns a non-null value. If no adaptor hook returns a non-null value
then the adaptor will perform the default behavior.mapLocationToURLConnection
in interface AdaptorHook
location
- a bundle location string to be converted to a URLConnectionIOException
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.