public abstract class DMXAbstractActivator extends Object implements org.osgi.framework.BundleActivator
Basic activator class which provides support for extensions through fragment bundles. Bundle which are intended for extension by callbacks should use implementation of this class as activator, because it provides consistent process for registering view, controllers, extension callbacks and also provides a way to customize bundle startup sequence. This class provides the following startup process:
DMXExtensionConfig
. This is usually provided by a fragment bundle
which contains extension callbacks for this bundle (it's host). It will look for a class BundleExtensionConfig
in ext
subpackage of current package. For example, if bundle activator is in package com.mypkg
, it will look for class
com.mypkg.ext.BundleExtensionConfig
.
DMXAdapter
service. This tracker will use extension configuration (if found) to register any
extension callbacks specified.
Modifier and Type | Field and Description |
---|---|
protected DMXExtensionConfig |
extensionConfig
Extension configuration.
|
Constructor and Description |
---|
DMXAbstractActivator() |
Modifier and Type | Method and Description |
---|---|
abstract DMXAdapterTrackerHandler |
getHandler()
Subclasses should implement this method to provide custom
DMXAdapterTrackerHandler instance. |
protected abstract void |
onBundleStart(org.osgi.framework.BundleContext ctx)
This method is invoked at the end of
start(org.osgi.framework.BundleContext) method. |
protected abstract void |
onBundleStop(org.osgi.framework.BundleContext ctx)
This method is invoked at the end of
stop(org.osgi.framework.BundleContext) method. |
void |
start(org.osgi.framework.BundleContext bc) |
void |
stop(org.osgi.framework.BundleContext bc) |
protected DMXExtensionConfig extensionConfig
protected abstract void onBundleStart(org.osgi.framework.BundleContext ctx)
start(org.osgi.framework.BundleContext)
method. It is used
as a hook for adding custom functionality to bundle activator. Subclasses should implement this method if they want
to add custom behavior to activator start method.ctx
- bundle contextprotected abstract void onBundleStop(org.osgi.framework.BundleContext ctx)
stop(org.osgi.framework.BundleContext)
method. It is used
as a hook for adding custom functionality to bundle activator stopping. Subclasses should implement this method if they want
to add custom behavior to activator stop method.ctx
- bundle contextpublic abstract DMXAdapterTrackerHandler getHandler()
DMXAdapterTrackerHandler
instance. This
instance is used to customize tracker method for adding, modifying and removing the service.public final void start(org.osgi.framework.BundleContext bc) throws Exception
start
in interface org.osgi.framework.BundleActivator
Exception
Copyright © 2012-2014 Vektor Software. All Rights Reserved.