Connecting To Db4o

This topic applies to Java version only.  

The only thing left - is a connection to the db4o_osgi plug-in. It can be established upon the plug-in start and terminated upon the plug-in stop:

Activator.java: start
01/* 02 * (non-Javadoc) 03 * @see org.eclipse.ui.plugin.AbstractUIPlugin#start(org.osgi.framework.BundleContext) 04 * Obtains a db4o_osgi service reference and registers it with Db4oProvider 05 */ 06 public void start(BundleContext context) throws Exception { 07 super.start(context); 08 ServiceReference serviceRef = context.getServiceReference(Db4oService.class.getName()); 09 Db4oService db4oService = (Db4oService)context.getService(serviceRef); 10 Db4oProvider.Initialize(db4oService); 11 }
Activator.java: stop
01/* 02 * (non-Javadoc) 03 * @see org.eclipse.ui.plugin.AbstractUIPlugin#stop(org.osgi.framework.BundleContext) 04 * Unregisters the db4o_osgi service from Db4oProvider 05 */ 06 public void stop(BundleContext context) throws Exception { 07 Db4oProvider.UnInitialize(); 08 plugin = null; 09 super.stop(context); 10 }