Project Zero server running in Expeditor

For this think Friday I attempted to get a Project Zero application running inside of the Expeditor runtime. Because the XPD toolkit does not really support Eclipse 3.3 and our launch does not work well with that and Java 5 I took a quick shortcut and just launched the Eclipse workbench with Expeditor runtime as the project space runtime.

What I really just wanted to get going was the Project Zero server loaded into the OSGI runtime of Eclipse and have its applications be able to seamlessly access classes and services from other OSGI bundles.

Here is what I did:

  • Created a plugin called (org.zero.core) which contains all of the Project Zero runtime jars. They are all exported and I also had the plugin use a Dynamic-Import statement so it could dynamically access other plugins classes and service. ie. (DynamicImport-Package: *)
  • I then created another plugin called “com.ibm.rcp.zero.app.runner”. This plugin houses an extension point called ZeroApp. The extension will basically “learn” what ZeroApp bundles are installed on the system and run them on some command. For this purpose, I added an auto-start boolean on the extension and if it was true the ZeroApp started when the platform launches. I started the Zero App by calling zero.core.Main.main() with the information I got from the hosting Bundle for the Zero App extension (ie. the root directory).
  • Lastly I took the sample application from Zero (simpleTodo), used the PDE tools to convert it to a bundle and modified it to access the Property Broker service from Expeditor. It was nothing huge, just to print out the names for all of the active actions in the broker.

So what happened?

Well, for the most part it worked. I have some logger dependency problems that can easily be fixed. Otherwise it worked quite well.

Here is the code I added to the sample:

At the top of todo.groovy:

import com.ibm.rcp.propertybroker.service.*;
import com.ibm.rcp.propertybroker.property.Action;

PropertyBroker broker = PropertyBrokerFactory.getBroker();
Action[] actions = broker.getActions();

In the output:

writer.write "PB Actions defined:
    "

    actions.each { writer.write "
  • Action: "+it.getName() + "
  • " }

    writer.write "
"

And here is a screen shot of the sample running in an Eclipse browser:

Tags: : : :

Advertisements

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.