public class SignedBundleHook extends Object implements AdaptorHook, BundleFileWrapperFactoryHook, HookConfigurator, SignedContentFactory
Constructor and Description |
---|
SignedBundleHook() |
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) . |
SignedContent |
getSignedContent(Bundle bundle)
Returns a
SignedContent object for the specified bundle. |
SignedContent |
getSignedContent(File content)
Returns a
SignedContent object for the specified content of a repository. |
void |
handleRuntimeError(Throwable error)
Gets called by the adaptor during
FrameworkAdaptor.handleRuntimeError(Throwable) . |
void |
initialize(BaseAdaptor adaptor)
Gets called by the adaptor during
FrameworkAdaptor.initialize(EventPublisher) . |
static void |
log(String msg,
int severity,
Throwable t) |
URLConnection |
mapLocationToURLConnection(String location)
Gets called by the adaptor during
FrameworkAdaptor.mapLocationToURLConnection(String) . |
BundleFile |
wrapBundleFile(BundleFile bundleFile,
Object content,
BaseData data,
boolean base)
Wraps a bundle file for the given content and base data.
|
public void initialize(BaseAdaptor adaptor)
AdaptorHook
FrameworkAdaptor.initialize(EventPublisher)
.
This method allows an adaptor hook to save the adaptor object for later.initialize
in interface AdaptorHook
adaptor
- the adaptor object associated with this 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 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 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
public 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 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 BundleFile wrapBundleFile(BundleFile bundleFile, Object content, BaseData data, boolean base)
BundleFileWrapperFactoryHook
wrapBundleFile
in interface BundleFileWrapperFactoryHook
bundleFile
- the bundle file to be wrappedcontent
- The object which contains the content of a bundle file.data
- The base data associated with the contentbase
- true if the content is for the base bundle (not an inner jar, directory etc.)public void addHooks(HookRegistry hookRegistry)
HookConfigurator
addHooks
in interface HookConfigurator
hookRegistry
- the hook registry used to add hookspublic SignedContent getSignedContent(File content) throws IOException, InvalidKeyException, SignatureException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException
SignedContentFactory
SignedContent
object for the specified content of a repository.getSignedContent
in interface SignedContentFactory
content
- the content of the repositoryIOException
- if an IO exception occurs while reading the repositoryInvalidKeyException
- if there is a problem with one of the certificate keys of the signed contentSignatureException
- if there is a problem with one of the signatures of the signed contentCertificateException
- if there is a problem with one of the certificates of the signed contentNoSuchAlgorithmException
- if the cryptographic algorithm is not available for the signed contentNoSuchProviderException
- if there's no security provider for the signed contentpublic SignedContent getSignedContent(Bundle bundle) throws IOException, InvalidKeyException, SignatureException, CertificateException, NoSuchAlgorithmException, NoSuchProviderException, IllegalArgumentException
SignedContentFactory
SignedContent
object for the specified bundle.getSignedContent
in interface SignedContentFactory
bundle
- the bundle to get a signed content for.IOException
- if an IO exception occurs while reading the bundle contentInvalidKeyException
- if there is a problem with one of the certificate keys of the signed contentSignatureException
- if there is a problem with one of the signatures of the signed contentCertificateException
- if there is a problem with one of the certificates of the signed contentNoSuchAlgorithmException
- if the cryptographic algorithm is not available for the signed contentNoSuchProviderException
- if there's no security provider for the signed contentIllegalArgumentException
Copyright © 2007–2018 The Apache Software Foundation. All rights reserved.