Eclipse Yoxos Services Downloads Blogs About
Home > Blogs >

Chris Aniszczyk

on Aug 14th, 2009Eclipse, OSGi and PAX Runner

If you’re using Eclipse for OSGi development, there’s a neat utility that you can use to help you run your OSGi application on a variety of frameworks. PAX Runner uses the PDE org.eclipse.pde.ui.osgiFrameworks extension point to supply frameworks.

paxrunner 300x170 Eclipse, OSGi and PAX Runner

To install PAX Runner, simply add their repository via software installation wizard.

There’s an important thing to note about PAX Runner. When you’re self-hosting with a PAX Runner based framework, your bundles will be deployed before executed. This may cause launching to take a bit longer than you’re used to depending on the size of your application. This is different from the traditional PDE workflow where we don’t have a deployment step when self hosting because Equinox provides us with some great hooks to skip that process. If you’re curious how this works under the covers, PDE instructs Equinox where to look for classes for the various bundles in your workspace (usually in the bin/ folder). This is known as the development time classpath and as far as I know, Equinox is the only framework to support this type of classpath (I filed a bug against Felix awhile ago).

On the whole, I recommend you give PAX Runner a try.

Also, if you have any ideas on how PDE can better support other frameworks, come talk to us.

on Aug 7th, 2009Eclipse 3.6 M1 is out

Good news, Eclipse 3.6 M1 is out and available for download (new and noteworthy)!

Why is this good news? Well, this marks the beginning of the regular heart beat of the Eclipse release cycle. The next release train is called Helios and is due out June 23rd, 2010. This week the Eclipse Planning Council finalized the dates for the Helios milestones:

  • Helios M1 8/7 – 8/21
  • Helios M2 9/18 – 10/2
  • Helios M3 10/30 – 11/13
  • Helios M4 12/11 – 12/18
  • Helios M5 1/29 – 2/5
  • Helios M6 3/12 – 3/19
  • Helios M7 4/30 – 5/7
  • Helios Release: 6/23/2010

Onwards to the Eclipse Helios release!

on Aug 4th, 2009CFP: Eclipse Summit Europe 2009

As a reminder, there’s two weeks left to submit talks to Eclipse Summit Europe 2009.

eclipsesummit09 header web 300x39 CFP: Eclipse Summit Europe 2009

I hope to see everyone in Ludwigsburg!

on Aug 3rd, 2009Eclipse e4 0.9 Alpha Release

Last week, the Eclipse e4 project had its alpha release.

0.9 splash Eclipse e4 0.9 Alpha Release

What’s e4?

It’s simply the next generation of the Eclipse platform. The Eclipse platform team has learned a lot of lessons since the Eclipse project started and it’s time to experiment and innovate. There’s also a desire to involve more people at the platform level.

To get a better idea of where e4 is going, here’s some resources:

If you’re interested in the project or the future of Eclipse, the e4 team would love to hear from you.

The first general release of e4 is expected in 2010.

on Jul 29th, 2009Nomenclature and the Evolution of Eclipse

One of the great things about Eclipse is that it evolves, it’s not static. We reinvent ourselves.

From IDE to RCP to Runtime. From Platform to e4 (e.g., the future).

evolution 300x223 Nomenclature and the Evolution of Eclipse

When we evolve, it gives us an opportunity to think about our lexicon.

I recently sent an email to the Eclipse PMC entertaining the idea of deprecating our usage of the word ‘plug-in’:

On last week’s Eclipse Architecture team call, I brought up the ‘plug-in versus bundle’ naming issue. This naming issue also came up at this week’s PDE team call where we had consensus that deprecating the word plug-in would be a good idea. Furthermore, the new components in PDE (e.g., API Tools) have gone out of their way to not call things plug-ins. I also know the Equinox p2 team struggles with naming problems (e.g., calling things software).

My proposal is that we adopt “bundle” and deprecate “plug-in” as the official module term.

If you’re interested in this, please comment on this bug. There’s also another bug open that wants to rename RCP if you’re interested in that too.

I would like to hear from the Eclipse and OSGi communities on what they think. Good or bad idea?

Would you welcome the change?

on Jul 27th, 2009Eclipse Galileo Podcasts

James Sugrue from DZone put together a nice set of podcasts around the Eclipse Galileo release.

If people have time, I highly recommend you check them out.

Enjoy!

on Jul 23rd, 2009OSGi, Dynamics and Eclipse

I often hear this question…

“Why does Eclipse prompt me to restart if it’s a dynamic OSGi-based application?”

restart 300x112 OSGi, Dynamics and Eclipse

As a user, you’re presented with a few choices: no, apply changes (I’m feeling lucky) or yes (please restart).

To answer this question, let me tell you a story. Back in the day, Eclipse had its own module system… things that you see these days in the MANIFEST.MF file were all in the plugin.xml file:

eclipseplugin 300x186 OSGi, Dynamics and Eclipse

These old plug-ins were lazy, but not dynamic in the OSGi sense. New plug-ins could come, but nothing would ever go away. In the the PDE team, we like to use the analogy of a play. So imagine a play where all the actors come out for their parts… but they never leave the stage. With the adoption of OSGi, Eclipse was able to go fully dynamic and actors can now leave the stage (and come back again!).

However, Eclipse still had to support these old plug-ins even though we moved our runtime to OSGi. How we did this is another story, but it involves translating the old plugin.xml files to OSGi manifest files on the fly.

Since we supported the old plug-in model, we had to prompt for restart. I consider this the historical reason of why the restart dialog exists. Now let me tell you the more serious reason.

The practical reason is that most people don’t code for dynamics still. Even though the Eclipse RCP stack is fully dynamic aware there may be pieces out there that aren’t. Whether it’s Eclipse code or someone else’s code, it doesn’t matter. It just takes one bundle that isn’t dynamic aware to potentially mess things up. To illustrate what it means to be dynamic aware or not, let’s look at some real code from Eclipse.

/**
 * Manages argument selectors (choosers) for string variables.
 *
 * @since 3.0
 */
public class StringVariablePresentationManager {
 
	/**
	 * String variable presentation extension point identifier
	 * (value <code>"stringVariablePresentations"</code>).
	 *
	 * @since 3.0
	 */
	public static final String EXTENSION_POINT_STRING_VARIABLE_PRESENTATIONS =
            "stringVariablePresentations"; //$NON-NLS-1$
 
	// default manager
	private static StringVariablePresentationManager fgManager;
 
	// extension point attributes
	public static final String ATTR_NAME = "variableName"; //$NON-NLS-1$
	public static final String ATTR_ARGUMENT_SELECTOR = "argumentSelector"; //$NON-NLS-1$
 
	/**
	 * Table of configuration elements for variable presentations,
	 * keyed by variable name.
	 */
	private Map fConfigurations;
 
	/**
	 * Returns the singleton string variable presentation manager.
	 *
	 * @return the singleton string variable presentation manager
	 */
	public static StringVariablePresentationManager getDefault() {
		if (fgManager == null) {
			fgManager = new StringVariablePresentationManager();
		}
		return fgManager;
	}
 
	/**
	 * Returns an argument selector contributed for the given
	 * variable, or <code>null</code> if none.
	 *
	 * @param variable string substitution variable
	 * @return argument selector or <code>null</code>
	 */
	public IArgumentSelector getArgumentSelector(IStringVariable variable) {
		IConfigurationElement element =
                   (IConfigurationElement) fConfigurations.get(variable.getName());
		if (element != null) {
			try {
				return (IArgumentSelector)element.createExecutableExtension(
                                   ATTR_ARGUMENT_SELECTOR);
			} catch (CoreException e) {
				DebugUIPlugin.log(e);
			}
		}
		return null;
	}
 
	/**
	 * Constructs the manager, loading extensions.
	 */
	private StringVariablePresentationManager() {
		initialize();
	}
 
	/**
	 * Load extensions
	 */
	private void initialize() {
		fConfigurations = new HashMap();
		IExtensionPoint point= Platform.getExtensionRegistry().getExtensionPoint(
                   DebugUIPlugin.getUniqueIdentifier(),
                   EXTENSION_POINT_STRING_VARIABLE_PRESENTATIONS);
		IConfigurationElement elements[]= point.getConfigurationElements();
		for (int i = 0; i &lt; elements.length; i++) {
			IConfigurationElement element = elements[i];
			String name= element.getAttribute(ATTR_NAME);
			if (name == null) {
				continue;
			}
			fConfigurations.put(name, element);
		}
	}
}

Can you tell what’s potentially wrong with the above code?

Extensions are only read when the object is initialized. The code above doesn’t handle extensions in a dynamic fashion so if new bundles come and provide more string variables, the code above won’t see them. Now imagine this pattern applied to some user interface code where you could contribute menu entries. If the manager was already initialized and your bundle providing entries came along at a later time, you wouldn’t see your menu entry contribution until the system restarted.

How do we make this code dynamic aware? Well, let’s look at another real example from Eclipse:

public final class KeywordRegistry implements IExtensionChangeHandler {
 
	private static final String ATT_ID = "id"; //$NON-NLS-1$
	private static final String ATT_LABEL = "label"; //$NON-NLS-1$
	private static KeywordRegistry instance;
	private static final String TAG_KEYWORD = "keyword"; //$NON-NLS-1$
 
	/**
	 * Return the singleton instance of the <code>KeywordRegistry</code>.
	 *
	 * @return the singleton registry
	 */
	public static KeywordRegistry getInstance() {
		if (instance == null) {
			instance = new KeywordRegistry();
		}
 
		return instance;
	}
 
	/**
	 * Map of id-&gt;labels.
	 */
	private Map internalKeywordMap = new HashMap();
 
	/**
	 * Private constructor.
	 */
	private KeywordRegistry() {
		IExtensionTracker tracker = PlatformUI.getWorkbench().getExtensionTracker();
                tracker.registerHandler(this,
                     ExtensionTracker.createExtensionPointFilter(getExtensionPointFilter()));
		IExtension[] extensions = getExtensionPointFilter().getExtensions();
		for (int i = 0; i &lt; extensions.length; i++) {
			addExtension(PlatformUI.getWorkbench().getExtensionTracker(),
					extensions[i]);
		}
	}
 
	public void addExtension(IExtensionTracker tracker, IExtension extension) {
		IConfigurationElement[] elements = extension.getConfigurationElements();
		for (int i = 0; i &lt; elements.length; i++) {
			if (elements[i].getName().equals(TAG_KEYWORD)) {
				String name = elements[i].getAttribute(ATT_LABEL);
				String id = elements[i].getAttribute(ATT_ID);
				internalKeywordMap.put(id, name);
				PlatformUI.getWorkbench().getExtensionTracker().registerObject(
						extension, id, IExtensionTracker.REF_WEAK);
			}
		}
	}
 
	private IExtensionPoint getExtensionPointFilter() {
		return Platform.getExtensionRegistry().getExtensionPoint(
				PlatformUI.PLUGIN_ID, IWorkbenchRegistryConstants.PL_KEYWORDS);
	}
 
	/**
	 * Return the label associated with the given keyword.
	 *
	 * @param id the keyword id
	 * @return the label or <code>null</code>
	 */
	public String getKeywordLabel(String id) {
		return (String) internalKeywordMap.get(id);
	}
 
	public void removeExtension(IExtension extension, Object[] objects) {
		for (int i = 0; i &lt; objects.length; i++) {
			if (objects[i] instanceof String) {
				internalKeywordMap.remove(objects[i]);
			}
		}
	}
}

The above code is dynamic aware via IExtensionChangeHandler, notice the addExtension(...) and removeExtension(...) methods. These methods handle extensions coming and going which we would expect in a fully dynamic system.

Note, this dynamics problem applies to any OSGi system… not just Eclipse. Any OSGi system where your bundles come and go that may or may not be dynamic aware can cause problems.

How do we solve this problem? Well, the first step would be to know whether a bundle that we’re going to install and activate is dynamic aware. At the moment we have no idea. I could imagine a solution where there could be a new header: Dynamic-Aware: true

This header would give OSGi provisioning systems some metadata to make a intelligent decision whether a restart would be required or not. For now, in my opinion, the safest decision is always to prompt to restart and leave the decision in the hands of the user. In the future, I hope that we can shed this with improved education and provisioning metadata.

In summary, the problem of why Eclipse prompts you to restart is two-fold: there’s a historical reason due to the old plug-in model but there’s also the other problem of educating people how to write dynamic aware bundles. In the end, it only takes one bad bundle to ruin the dynamics of your OSGi system.

on Jul 20th, 2009Equinox OSGi Webinar Online

As Jeff McAffer noted, the webinar on OSGi we did a couple weeks ago is finally online.

We decided to break it up in a series of six parts for your viewing pleasure.

Part 1 – History and Vision

osgipt1 300x224 Equinox OSGi Webinar Online

Part 2 – Fundamental Concepts

osgipt2 300x224 Equinox OSGi Webinar Online

Part 3 – OSGi Tooling

osgipt3 300x224 Equinox OSGi Webinar Online

Part 4 – OSGi Services

osgipt4 300x224 Equinox OSGi Webinar Online

Part 5 – ServiceTracker and Declarative Services

osgipt5 300x225 Equinox OSGi Webinar Online

Part 6 – Deploying OSGi Systems and Q&A

osgipt6 300x224 Equinox OSGi Webinar Online

Enjoy.

on Jul 13th, 2009Crowdsourcing Documentation at Eclipse

I’ve been pensive as of late since we shipped the Eclipse Galileo release. One of the things I personally have been thinking about is how we can improve our documentation process. Currently, the Eclipse platform team has its documentation in Eclipse Help format (mostly HTML)… all this is kept in source control. In its current shape, the documentation isn’t conducive for people to contribute. There’s a lot of hoops a potential contributor needs to jump through in order to contribute documentation. Even more hoops if our documentation contributor isn’t really a developer. I also know a few committers who dread doing documentation because they have to hack away at HTML documents.

Can we do better? I think we can.

I’m interested in crowdsourcing the documentation at Eclipse.

crowdsourcing 300x205 Crowdsourcing Documentation at Eclipse

What do I mean here? Well, I luckily have one example in the Eclipse ecosystem that is crowdsourcing its documentation already. The Mylyn project has its User Guide on the wiki.

mylynwiki 300x253 Crowdsourcing Documentation at Eclipse

The Mylyn project then uses WikiText to parse this wiki markup via a script and generate relevant Eclipse help artifacts.

mylynidehelp 300x285 Crowdsourcing Documentation at Eclipse

In the end, there’s one source for the documentation (the wiki) where a multitude of people can easily contribute to. If we look at the Mylyn User Guide, we can see there was a decent amount of edits involving people who weren’t committers.

mylynedits 300x200 Crowdsourcing Documentation at Eclipse

I’ve been experimenting with this documentation process for PDE and am pretty happy with it. There were only a couple of roadblocks I hit, but that was mostly around making it easier to use some of the WikiText ant tasks within Eclipse. I also experimented with some html2wiki transformers to help convert some of the existing PDE documentation.

One of the reasons I was inspired to look at crowdsourcing documentation for PDE was an excellent series of articles by Ekkehard Gentz on PDE’s new target platform provisioning story. I thought to myself, how could get Ekke to easily contribute that documentation (or even future docs) to PDE where it could be beneficial to everyone?

One point to bring up is that a lot of the Eclipse documentation is on the Eclipse wiki (Eclipsepedia) already. The Eclipse user community has most likely come across Eclipsepedia already. We can also assume that most people are comfortable with wiki syntax or at least the editor that comes with MediaWiki by default. If this isn’t the case, we can try to install something like the FCKEditor extension for MediaWiki to make it easier.

Another point to bring up is that having the documentation sourced from the wiki may have an interesting benefit due to early adopters. For a real world example, I’ll talk about the Equinox p2 project. There have been some complaints that the p2 documentation wasn’t robust enough for early adopters. Well, what happens if those early adopters would be willing to be part of the documentation process? As users adopt the technology, they can document their experiences along with the p2 committer team. If this was set as an expectation, I don’t think people mind sharing their experiences and being part of a team trying to build a cool technology.

What do people think? Is this good for other Eclipse projects?

Would you be enticed more to contribute to official project documentation if it was easier?

on Jul 8th, 2009OSGi, Eclipse and API Management

Recently, a few people have come to me ask how Eclipse maintains its API and versions. The intent of this question was to see what lessons there are to be learned for other OSGi-based applications. If we step back a bit, in essence, Eclipse is a large OSG application. On top of that, Eclipse is a platform where people build their own OSGi applications on… it’s an OSGi party. As a result, there are many people dependent on the API Eclipse produces so the management of this API is important. If breaking API changes were common, people would have less desire to build on the platform. To help with this problem, Eclipse developed PDE API Tools.

I’ll discuss four main areas around API management that API Tools can help you with.

API Comparisons

I have seen some discussion of people wanting to know what new APIs were part of the Eclipse Galileo release. While it’s pretty easy to see the new and noteworthy items for the latest Eclipse release, it’s difficult to dive into and see what actual classes and methods were modified. To help alleviate this problem, PDE API Tools has the ability to produce API comparison reports to show exactly what has changed. I have mentioned the API Tooling view in a past blog entry for those who are interested.

api1 300x148 OSGi, Eclipse and API Management

API Compatibility

One thing that’s important is being able to see binary compatibility issues between a build and a baseline. This is currently possible within the Eclipse IDE if you use PDE API Tools in the workspace, however, if you wanted to generate a report via an Ant task you can do that. As a sample, I generated a report against Eclipse 3.4.2 and Eclipse 3.5:

<?xml version="1.0" encoding="UTF-8"?>
<project name="api_analysis_reporting" default="run" basedir=".">
    <property name="baseline" value="/Users/chrisaniszczyk/eclipses/eclipse-SDK-3.4.2/eclipse" />
	<property name="profile" value="/Users/chrisaniszczyk/eclipses/eclipse-SDK-3.5/eclipse" />
	<property name="report_location" value="${baseline}/api" />
	<property name="html_report_location" value="${baseline}/api-html"/>
 
	<target name="run">
	    <apitooling.analysis
	      	baseline="${baseline}"
	    	profile="${profile}"
	      	report="${report_location}"
	      	debug="true"
	     />
	    <apitooling.analysis_reportconversion
	      	htmlfiles="${html_report_location}"
	      	xmlfiles="${report_location}"
	      	debug="true"
	    />
	  </target>
</project>

API Freeze

Another aspect that’s important to Eclipse is the concept of an API Freeze.

galileoschedule 300x214 OSGi, Eclipse and API Management

Towards the end of the Eclipse release, we implement an API Freeze which means that no new API can be added or modified after this point. Why have an API Freeze? Well, it helps ensure stable APIs for consumers looking to adopt a new version of Eclipse. From a producer point of view, how do you ensure that the API Freeze is actually enforced? Developers are human and make mistakes. Developers can be also be sneaky by modifying API.

To help enforce an API Freeze, PDE API Tools has the ability to produce freeze reports:

<?xml version="1.0" encoding="UTF-8"?>
<project name="api_freeze_reporting" default="run" basedir=".">
    <property name="baseline" value="/Users/chrisaniszczyk/eclipses/eclipse-SDK-3.4.2/eclipse" />
	<property name="profile" value="/Users/chrisaniszczyk/eclipses/eclipse-SDK-3.5/eclipse" />
	<property name="report_location" value="${baseline}/api" />
	<property name="html_report_location" value="${baseline}/api-html"/>
 
	<target name="run">
	    <apitooling.apifreeze
	      	baseline="${baseline}"
	    	profile="${profile}"
	      	report="${report_location}"
	      	debug="true"
	     />
	    <apitooling.apifreeze_reportconversion
	      	htmlfile="${html_report_location}"
	      	xmlfile="${report_location}"
	      	debug="true"
	    />
	  </target>
</project>

As part of the Galileo release, we used freeze reports as a way to ensure API stability as we converged.

API Usage

From the consumer point of view, it’s interesting to see how people are consuming your APIs. To help with this, API Tools has the ability to run usage reports against a set of bundles. Awhile ago, I blogged about this topic and produced a report against most of the bundles included in the Galileo release:

<?xml version="1.0" encoding="UTF-8"?>
<project name="api_use_reporting" default="run" basedir=".">
    <property name="baseline" value="/Users/chrisaniszczyk/eclipses/eclipse-galileo" />
    <property name="report_location" value="${baseline}/api" />
	<property name="html_report_location" value="${baseline}/api-html"/>
 
	<target name="run">
	    <apitooling.apiuse
	      	baseline="${baseline}"
	    	proceedonerror="true"
	      	report="${report_location}"
	      	considerinternal="true"
	      	considerapi="true"
	      	debug="true"
	     />
	    <apitooling.apiuse_reportconversion
	      	htmlfiles="${html_report_location}"
	      	xmlfiles="${report_location}"
	      	debug="true"
	    />
	  </target>
</project>

I hope this helps and allows you to understand and adopt PDE API Tools.

Also, the PDE team is currently in the planning stages for the next release.

Please file any bugs if you have issues or suggestions so the PDE team can act on them.

© EclipseSource 2008 - 2011