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

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

public class EclipseAdaptorHook
extends java.lang.Object
implements AdaptorHook, HookConfigurator


Field Summary
static java.lang.String DOMFACTORYNAME
          The DOM factory name
static java.lang.String SAXFACTORYNAME
          The SAX factory name
 
Constructor Summary
EclipseAdaptorHook()
           
 
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 adaptor)
          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[]).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SAXFACTORYNAME

public static final java.lang.String SAXFACTORYNAME
The SAX factory name

See Also:
Constant Field Values

DOMFACTORYNAME

public static final java.lang.String DOMFACTORYNAME
The DOM factory name

See Also:
Constant Field Values
Constructor Detail

EclipseAdaptorHook

public EclipseAdaptorHook()
Method Detail

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

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.

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

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.

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

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.

initialize

public void initialize(BaseAdaptor adaptor)
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:
adaptor - the adaptor object associated with this AdaptorHook.

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