Skip to main content

Notice: this Wiki will be going read only early in 2024 and edits will no longer be possible. Please see: https://gitlab.eclipse.org/eclipsefdn/helpdesk/-/wikis/Wiki-shutdown-plan for the plan.

Jump to: navigation, search

EclipseLink/Development/DBWS/OSGi/NewPluginProject

< EclipseLink‎ | Development‎ | DBWS‎ | OSGi


Create a new Plug-in project

From the 'Plug-in Development' Perspective, create a new Plug-in project SimpleTable:
{Note the choice of 'standard' for OSGi framework}
EclipseLink DBWS with OSGi SimpleTable.png
Proceed to the next panel of the wizard where the (OSGi bundle) Activator for SimpleTable is defined:
EclipseLink DBWS with OSGi SimpleTableActivator.png
Click 'Finish' and open the generated Activator:

package simpletable;
 
import org.osgi.framework.BundleActivator;
import org.osgi.framework.BundleContext;
 
public class Activator implements BundleActivator {
 
	private static BundleContext context;
 
	static BundleContext getContext() {
		return context;
	}
 
	/*
	 * (non-Javadoc)
	 * @see org.osgi.framework.BundleActivator#start(org.osgi.framework.BundleContext)
	 */
	public void start(BundleContext bundleContext) throws Exception {
		Activator.context = bundleContext;
	}
 
	/*
	 * (non-Javadoc)
	 * @see org.osgi.framework.BundleActivator#stop(org.osgi.framework.BundleContext)
	 */
	public void stop(BundleContext bundleContext) throws Exception {
		Activator.context = null;
	}
}

Copyright © Eclipse Foundation, Inc. All Rights Reserved.