org.eclipse.osgi.baseadaptor.hooks
Interface AdaptorHook


public interface AdaptorHook

An AdaptorHook hooks into the BaseAdaptor class.

Since:
3.2
See Also:
BaseAdaptor, HookRegistry.getAdaptorHooks(), HookRegistry.addAdaptorHook(AdaptorHook)

Method Summary
 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[]).
 

Method Detail

initialize

void initialize(BaseAdaptor adaptor)
Gets called by the adaptor during FrameworkAdaptor.initialize(EventPublisher). This method allows an adaptor hook to save the adaptor object for later.

Parameters:
adaptor - the adaptor object associated with this AdaptorHook.

frameworkStart

void frameworkStart(BundleContext context)
                    throws BundleException
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).

Parameters:
context - the system bundle context
Throws:
BundleException - if an error occurs

frameworkStop

void frameworkStop(BundleContext context)
                   throws BundleException
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).

Parameters:
context - the system bundle context
Throws:
BundleException - if an error occurs.

frameworkStopping

void frameworkStopping(BundleContext context)
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.

Parameters:
context - the system bundle context

addProperties

void addProperties(java.util.Properties properties)
Gets called by the adaptor during FrameworkAdaptor.getProperties(). This method allows an adaptor hook to add property values to the adaptor properties object.

Parameters:
properties - the adaptor properties object.

mapLocationToURLConnection

java.net.URLConnection mapLocationToURLConnection(java.lang.String location)
                                                  throws java.io.IOException
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.

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

void handleRuntimeError(java.lang.Throwable error)
Gets called by the adaptor during FrameworkAdaptor.handleRuntimeError(Throwable). The adaptor will call this method for each configured adaptor hook.

Parameters:
error - the unexpected error that occured.

matchDNChain

boolean matchDNChain(java.lang.String pattern,
                     java.lang.String[] dnChain)
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.

Parameters:
pattern - A
dnChain -
Returns:
true if the pattern matches

createFrameworkLog

org.eclipse.osgi.framework.log.FrameworkLog createFrameworkLog()
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.

Returns:
a FrameworkLog object or null.