org.eclipse.core.runtime.internal.adaptor
Class EclipseLazyStarter

java.lang.Object
  extended by org.eclipse.core.runtime.internal.adaptor.EclipseLazyStarter
All Implemented Interfaces:
HookConfigurator, AdaptorHook, ClassLoadingStatsHook

public class EclipseLazyStarter
extends java.lang.Object
implements ClassLoadingStatsHook, AdaptorHook, HookConfigurator


Constructor Summary
EclipseLazyStarter()
           
 
Method Summary
 void addHooks(HookRegistry hookRegistry)
          Adds hooks to the specified hook registry.
 void addProperties(java.util.Properties properties)
          Gets called by the adaptor during FrameworkAdaptor.getProperties().
 org.eclipse.osgi.framework.log.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(java.lang.Throwable error)
          Gets called by the adaptor during FrameworkAdaptor.handleRuntimeError(Throwable).
 void initialize(BaseAdaptor baseAdaptor)
          Gets called by the adaptor during FrameworkAdaptor.initialize(EventPublisher).
 java.net.URLConnection mapLocationToURLConnection(java.lang.String location)
          Gets called by the adaptor during FrameworkAdaptor.mapLocationToURLConnection(String).
 boolean matchDNChain(java.lang.String pattern, java.lang.String[] dnChain)
          Gets called by the adaptor during FrameworkAdaptor.matchDNChain(String, String[]).
 void postFindLocalClass(java.lang.String name, java.lang.Class clazz, ClasspathManager manager)
          Gets called by a classpath manager during ClasspathManager.findLocalClass(String) after searching the local classloader for a class.
 void postFindLocalResource(java.lang.String name, java.net.URL resource, ClasspathManager manager)
          Gets called by a classpath manager during ClasspathManager.findLocalResource(String) after searching the local classloader for a resource.
 void preFindLocalClass(java.lang.String name, ClasspathManager manager)
          Gets called by a classpath manager during ClasspathManager.findLocalClass(String) before searching the local classloader for a class.
 void preFindLocalResource(java.lang.String name, ClasspathManager manager)
          Gets called by a classpath manager during ClasspathManager.findLocalResource(String) before searching the local classloader for a resource.
 void recordClassDefine(java.lang.String name, java.lang.Class clazz, byte[] classbytes, ClasspathEntry classpathEntry, BundleEntry entry, ClasspathManager manager)
          Gets called by a classpath manager after a successfully defining a class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EclipseLazyStarter

public EclipseLazyStarter()
Method Detail

preFindLocalClass

public void preFindLocalClass(java.lang.String name,
                              ClasspathManager manager)
                       throws java.lang.ClassNotFoundException
Description copied from interface: ClassLoadingStatsHook
Gets called by a classpath manager during 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.

Specified by:
preFindLocalClass in interface ClassLoadingStatsHook
Parameters:
name - the name of the requested class
manager - the classpath manager used to find and load the requested class
Throws:
java.lang.ClassNotFoundException - to prevent the requested class from loading

postFindLocalClass

public void postFindLocalClass(java.lang.String name,
                               java.lang.Class clazz,
                               ClasspathManager manager)
                        throws java.lang.ClassNotFoundException
Description copied from interface: ClassLoadingStatsHook
Gets called by a classpath manager during 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.

Specified by:
postFindLocalClass in interface ClassLoadingStatsHook
Parameters:
name - the name of the requested class
clazz - the loaded class or null if not found
manager - the classpath manager used to find and load the requested class
Throws:
java.lang.ClassNotFoundException

preFindLocalResource

public void preFindLocalResource(java.lang.String name,
                                 ClasspathManager manager)
Description copied from interface: ClassLoadingStatsHook
Gets called by a classpath manager during 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.

Specified by:
preFindLocalResource in interface ClassLoadingStatsHook
Parameters:
name - the name of the requested resource
manager - the classpath manager used to find the requested resource

postFindLocalResource

public void postFindLocalResource(java.lang.String name,
                                  java.net.URL resource,
                                  ClasspathManager manager)
Description copied from interface: ClassLoadingStatsHook
Gets called by a classpath manager during 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.

Specified by:
postFindLocalResource in interface ClassLoadingStatsHook
Parameters:
name - the name of the requested resource
resource - the URL to the requested resource or null if not found
manager - the classpath manager used to find the requested resource

recordClassDefine

public void recordClassDefine(java.lang.String name,
                              java.lang.Class clazz,
                              byte[] classbytes,
                              ClasspathEntry classpathEntry,
                              BundleEntry entry,
                              ClasspathManager manager)
Description copied from interface: ClassLoadingStatsHook
Gets called by a classpath manager after a successfully defining a class. This method allows a class loading stat hook to record data about a class definition.

Specified by:
recordClassDefine in interface ClassLoadingStatsHook
Parameters:
name - the name of the class that got defined
clazz - the class object that got defined
classbytes - the class bytes used to define the class
classpathEntry - the ClasspathEntry where the class bytes got read from
entry - the BundleEntyr source of the class bytes
manager - the classpath manager used to define the class

addHooks

public void addHooks(HookRegistry hookRegistry)
Description copied from interface: HookConfigurator
Adds hooks to the specified hook registry.

Specified by:
addHooks in interface HookConfigurator
Parameters:
hookRegistry - the hook registry used to add hooks

addProperties

public void addProperties(java.util.Properties properties)
Description copied from interface: AdaptorHook
Gets called by the adaptor during FrameworkAdaptor.getProperties(). This method allows an adaptor hook to add property values to the adaptor properties object.

Specified by:
addProperties in interface AdaptorHook
Parameters:
properties - the adaptor properties object.

createFrameworkLog

public org.eclipse.osgi.framework.log.FrameworkLog createFrameworkLog()
Description copied from interface: AdaptorHook
Gets called by the adaptor during 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.

Specified by:
createFrameworkLog in interface AdaptorHook
Returns:
a FrameworkLog object or null.

frameworkStart

public void frameworkStart(BundleContext context)
                    throws BundleException
Description copied from interface: AdaptorHook
Gets called by the adaptor during FrameworkAdaptor.frameworkStart(BundleContext). This method allows an adaptor hook to execute code when the framework is starting (e.g. to register services).

Specified by:
frameworkStart in interface AdaptorHook
Parameters:
context - the system bundle context
Throws:
BundleException - if an error occurs

frameworkStop

public void frameworkStop(BundleContext context)
                   throws BundleException
Description copied from interface: AdaptorHook
Gets called by the adaptor during FrameworkAdaptor.frameworkStop(BundleContext). This method allows an adaptor hook to execute code when the framework is stopped (e.g. to unregister services).

Specified by:
frameworkStop in interface AdaptorHook
Parameters:
context - the system bundle context
Throws:
BundleException - if an error occurs.

frameworkStopping

public void frameworkStopping(BundleContext context)
Description copied from interface: AdaptorHook
Gets called by the adaptor during FrameworkAdaptor.frameworkStopping(BundleContext). This method allows an adaptor hook to execute code when the framework is about to start the shutdown process.

Specified by:
frameworkStopping in interface AdaptorHook
Parameters:
context - the system bundle context

handleRuntimeError

public void handleRuntimeError(java.lang.Throwable error)
Description copied from interface: AdaptorHook
Gets called by the adaptor during FrameworkAdaptor.handleRuntimeError(Throwable). The adaptor will call this method for each configured adaptor hook.

Specified by:
handleRuntimeError in interface AdaptorHook
Parameters:
error - the unexpected error that occured.

initialize

public void initialize(BaseAdaptor baseAdaptor)
Description copied from interface: AdaptorHook
Gets called by the adaptor during FrameworkAdaptor.initialize(EventPublisher). This method allows an adaptor hook to save the adaptor object for later.

Specified by:
initialize in interface AdaptorHook
Parameters:
baseAdaptor - the adaptor object associated with this AdaptorHook.

mapLocationToURLConnection

public java.net.URLConnection mapLocationToURLConnection(java.lang.String location)
                                                  throws java.io.IOException
Description copied from interface: AdaptorHook
Gets called by the adaptor during 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.

Specified by:
mapLocationToURLConnection in interface AdaptorHook
Parameters:
location - a bundle location string to be converted to a URLConnection
Returns:
the URLConnection converted from the bundle location or null.
Throws:
java.io.IOException - if an error occured creating the URLConnection

matchDNChain

public boolean matchDNChain(java.lang.String pattern,
                            java.lang.String[] dnChain)
Description copied from interface: AdaptorHook
Gets called by the adaptor during FrameworkAdaptor.matchDNChain(String, String[]). The adaptor will call this method for each configured adaptor hook until one adaptor hook returns a true value. If no adaptor hook returns a true value then the adaptor will return false.

Specified by:
matchDNChain in interface AdaptorHook
Parameters:
pattern - A
Returns:
true if the pattern matches