Eclipse Yoxos Services Downloads Blogs About
Home > Blogs >

Jeff McAffer

on Nov 13th, 2009Another Eclipse Mommitter

Its mid-Movember and things are getting hairy in Eclipse-land. A dedicated team of committers, the Eclipse Mommitters, have banded together to grow moustaches to raise awareness of men’s health issues. Since I’m basically lazy and work at home, it happens that I’ve not shaved for a couple weeks. So, though late to Movember, I am fully prepared to produce a moustache.

Chris ran a poll to determine the kind of ‘stache he should grow. Great community involvement in setting direction. Keying off that I’m going to try and illustrate the causal connection between contribution and results. This can be applied to any community effort whether its men’s health or Eclipse itself.

The plan is to grow as much facial hair as possible and allow the highest donor to choose what kind of moustache I should sport for the last week of Movember. As an added bonus, it turns out that that week I will be teaching a course at a customer and presenting at the Ottawa Eclipse DemoCamp so there is some risk here for me…

The person with the highest cumulative donations on Movember 22nd at 23:59ET (or thereabouts) will be identified in a comment on this blog entry. If it looks particularly dangerous for me, I reserve the right to override the donor with a 2x donation. I will wear the designated moustache for the following week.

So get out the credit cards and put in your donation now. You can check out Mo progress first hand next week at one of the EclipseRT days in Austin or Toronto.

44681 small Another Eclipse Mommitter

on Nov 9th, 2009EclipseRT Days and DemoCamps

Autumn is in the air (wouldn’t know it here.  17C!) so it must be time for the Fall line up of “Eclipse days” and demo camps. This year I’ll be at two Eclipse Days and three demo camps!

First we have the EclipseRT days in Austin and Toronto. Are you in the area? Come on by and tell people about your use of Eclipse in runtime scenarios or find out how others are getting the power of Eclipse modularity and all that good stuff in their clients, servers and embedded devices. There are talks from the projects, talks from the community. Fun for kids of all ages.

Due to a happy coincidence of travel and cosmic forces I’ll also be at the DemoCamps in Toronto, Vienna and Ottawa. Should be very cool.  I’m particularly excited to see one of these fabled European DemoCamps in action.

Its going to be a busy few weeks. Hope to see you at one or more of these events.

on Oct 27th, 2009The Mac@ESE makes me want to stop demo’ing

This morning at the ESE EclipseRT tutorial we are having a great set of talks on Equinox, RAP, EclipseLink and Riena. The room was full and the audience asking lots of great questions. It is great to see so many people interested in EclipseRT.

Unfortunately, there was another episode in the continuing saga of me, demos and the Mac. I was to present various things about Equinox and OSGi. The discussion went fine and short of not being able to switch Mac Spaces screens using the mouse, strange, that was great. When it came to demo however, things were not so good.

Much of the tutorial is based on Toast, an example application that comes from the new OSGi and Equinox book and is now an Example project at Eclipse. The Toast client has lots of great stuff including integration with Google Earth.  Unfortunately, for some reason that only works when running on Carbon on the Mac. OK. Since I updated to Snow Leopard I had to install some retro JREs to get Carbon. Hmm, OK.  To run the with this while running the IDE on Cocoa means I have to setup my PDE Target Platform to use Carbon explicitly.  Err, sure, why not…

Well, it seems there is a bug in PDE (well, apparently the bug is in SWT) that prevents one from editing a Target Platform to set Environment values.  Seemingly my changes were just ignored despite showing in the UI.  Not so great.  The net effect was that my demo failed.  Sigh.

To work around this I had to hand edit the .target file’s XML to add

<environment>
<ws>carbon</ws>
</environment>

Now the client works! Of course it was my fault for updating my target just before the demo and believing what the UI was telling me.  Live and learn…  I’m starting to feel a bit like Steve the Uber Geek.

It seems that there are a few other issues like this in the Target Platform editor around Software Sites.  Seems that these are issues related to Cocoa. Working on the Mac still feels like using the poor cousin of Eclipse. Oh well, there is always VMware.  But then Google Earth does not run so well there either…

on Oct 13th, 2009Toast@Eclipse

Ever wondered about Eclipse as a runtime technology?

Wanted to know what this OSGi stuff was all about?

Thought that Equinox was just a really big cruise ship or that Toast was just for breakfast?  Well, now’s your chance to find out.

After a few hiccups and admirable efforts by Wayne Beaton and Sharon Corbett, the contribution of Toast to the Eclipse Examples project has been cleared and committed.

This is particularly exciting because it’s just in time for Eclipse Summit Europe‘s EclipseRT Tutorial and Symposium and the upcoming EclipseRT days (did I get enough plugs in there Ian?). Phew!

Why is this interesting. First, Toast is kinda cool in its own right. From client/server to fully dynamic to Google Earth integration embedded in a device and in a Rich Ajax Platform (RAP) application to provisioning using p2 and much more, there are tons of examples of what you can do with Eclipse technology. What’s better is that several projects in the EclipseRT community are stepping up to showcase their capabilities in the context of Toast. For you, the community, it means you can go and see how to use the various bits of EclipseRT function in real life.

The other milestone related to this is the Simon Archer, Paul Vanderlei and I just submitted the complete first draft of the OSGi and Equinox book to the publisher. You don’t need to wait however, you can get it now in electronic form.

on Oct 9th, 2009EclipseRT Tutorial and Symposium

EclipseRT Logo Medium EclipseRT Tutorial and SymposiumCool logo and cool sessions at ESE.

At ESE in a couple weeks we are running both an EclipseRT tutorial and symposium. A full day of runtime fun!  No idea what I’m talking about? EclipseRT is the community of people at Eclipse that are creating and using Eclipse technology in runtime (i.e., non-tooling) scenarios.

Turns out that there are a great number of projects involved and not just the ones in the RT top-level project.  BIRT, EMF, GEF, … all have runtime elements. The RT project itself hosts such leading runtime technology as Equinox (the OSGi and JSR232 reference implementation) EclipseLink (the JPA2 reference implementation), Jetty (very popular embeddable web server) and a host of other great projects like RAP, Riena, Swordfish, ECF, eRCP etc. No wonder we need a whole day to talk about all this.

The day starts with a 4 hour EclipseRT tutorial covering the Equinox, OSGi, server side use, tooling, RAP and single sourcing, Riena and EclipseLink. The tutorial will build on input from previous symposia where nearly everyone commented on the need for a good end to end example of Eclipse in the runtime world. We are using Toast, the example application from the upcoming OSGi and Equinox book and now part of the Eclipse Examples project.

After a full morning of learning, we’ll have a bit of an unconference style symposium to talk about issues and topics in the EclipseRT world. While the direction will depend significantly on who shows up, we hope to cover architecture and how promote integration and adoption, community issues such as release trains, repo organization etc and experience reports from the real world.

Presumably this will all be followed by a number of frosty beverages.

Check out the event wiki page for more information and evolving discussion topics.

on Sep 18th, 2009I Love Refactoring in Eclipse

The refactoring support in Eclipse has always amazed me.  Not only is there a refactoring for just about everything, many of the different Eclipse tools hook into the refactoring support. Frankly, I’ve come to take this all for granted.  That is, until earlier this week.

As part of our contribution of the Toast example code from the upcoming OSGi and Equinox book to the Eclipse Examples project, I had to rename the bundles and packages and extensions and DS components and… for 81 bundles and features.  Yikes! In the end it took me about 2 hours and both the client and the server just worked. What’s more, I did not change a single file in an editor by hand. Turning on all the replace options finds references in all files.

Picture 1 I Love Refactoring in EclipseOld hat for many. Hidden power for some. For me, just using a tiny fraction of the time saved by the refactoring support to say Thanks to all the teams that contribute refactoring participants.

on Sep 10th, 2009OSGi and Equinox Book Updated

In a previous post, I mentioned that an OSGi and Equinox book is in the works. Well, we are nearing completion of the entire thing. Since we started doing the book there have been many changes in direction, content and now the title.

The new title, “OSGi and Equinox: Creating Highly Modular Java Systems” is a much better reflection of the content and intended audience. Originally we were very Eclipse-focused.  How does Eclipse use OSGi, how does Equinox work, … As we wrote more and more of the code and the text it, of course, became clear that all of this stuff is generically relevant and applicable.

As a result, the book is now essentially a generic OSGi book that covers a wide range of standard OSGi concepts and details. Mixed throughout are specifics that relate to Equinox (yes, we talk about the extension registry). The net result, we think, is a technically sound, pragmatic treatment of OSGi with value add for people using Equinox.

Along with this rethink came a look at some new content that is not so generic but still hugely relevant. For example we added:

  • More detail on provisioning with p2,
  • Coverage of server side OSGi creating WARs that use the servlet bridge
  • Distributed OSGi (RFC119) and ECF
  • Great depth on Declarative services
  • Many best practice and experience tips
  • Even integrating Google Earth as a service!

Needless to say, we are pumped about this content and about finally getting the damn thing out.

Its not quite done yet but very close. The Rough Cuts content should be updated by early October and the final version in a book store near you by Christmas.

P.S. Yes, the 2nd Edition of the RCP book is still coming and hopefully is on a similar timeline. Type type type…

on Jul 17th, 2009OSGi and Equinox Webinar Posted

Last week Chris Aniszczyk and I did a free three hour OSGi and Equinox Jumpstart webinar.

Yesterday we posted the whole thing as a six part series of movies on the EclipseSource webcast site.

Check it out and let us know what you think!

osgiwebinar 300x225 OSGi and Equinox Webinar Posted

The webinar was aimed at people who’ve heard the buzz around OSGi but still don’t have a great feel for what it is, what you do with it and how it helps. We covered a pretty broad range of topics from the overall vision and context for OSGi to key concepts like bundles, classloading and componentization as well as PDE tools for writing bundles. Quite a bit of time was spent talking about services and best practices, in particular declarative services (though we did not have enough time to talk about OSGi distributed services). We also spent time talking about p2 provisioning of OSGi bundles and showed some of the scenarios where OSGi’s dynamic module system shine.

Overall the response was great.  We were experimenting a bit with the format and basically did thirty minute chunks covering a topic and then a few minutes to cover questions that people typed in. Several hundred people signed up from all over the world and turnout on the day was awesome. The format seemed to be compelling as even though the webinar was pretty long (we were completely wiped by the end) the vast majority of the attendees stayed to the end.

The EclipseSource team has been doing a number of webinars over the past months including some on RAP single sourcing, p2 and our Yoxos products. We have a plan for more webinars including ones on ECF, Zest and other projects in which we are involved. 

Stay tuned for details!

on May 14th, 2009Pimp your p2 profile

Once is an oddity.  Twice is a trend…  Well, at least it starts looking like maybe there is a trend.  In the last while the need to setup custom p2 profiles has come up a couple times for me. What do I mean by that? Well, Profiles are the data structure that p2 uses to track the set of software installed to make an executable application. Your Eclipse IDE is a profile for example. Profiles contain Installable Units (IUs).  Each IU describes some thing that can be installed (bundle, feature, executable, command line argument, …) into a profile. The relationship between IUs is captured using provided and required capabilities and IUs themselves refer to artifacts (the actual bundles) and have touchpoint data used to configure the artifacts into a runtime.

OK, enough of the metadata lesson, what’s this all about? I had two problems.

  1. The need to ensure that certain IUs (e.g. bundles) were only installed in particular types of profiles
  2. The need to set dynamically determined properties and command line args for a profile

Both of these (and more) can be addressed by pimping your profile using the pimpProfile() method below.

private void pimpProfile(IProfile profile) throws CoreException {
    IInstallableUnit iu = createIU();
    Operand[] operands = new Operand[] {new InstallableUnitOperand(null, iu)};
    IEngine engine = getEngine();
    engine.perform(profile, new DefaultPhaseSet(), operands, null, null);
}

The code dynamically creates an IU and the proceeds to install that IU using the engine.  The engine is the p2 infrastructure that actually performs install/uninstall/update operations. The default engine is available as an OSGi service of type org.eclipse.equinox.internal.provisional.p2.engine.IEngine.  You should implement getEngine() using your favorite services coding pattern (hint:  the cool kids are using Declarative Services).

Normally you would use the p2 planner to make sure all the dependencies are satisfied and then modify the profile but here we know what we want to do — spoof up an IU and install it.

There are a few different kinds of operands but here we want to install an IU so the IU operand makes sense.  IU operands are old/new pairs.  That is, the first arg in the constructor is the IU currently in the profile, the second is what you want to be in the profile when the operation is finished.  So install is {null, iu}, uninstall is {iu, null} and update is {iu.1, iu.2} — the pair expresses the desired transition.

Now for the IU…  Depending on which problem above we are looking to solve we need a different IU.  Of course you can install any number of IUs but here let’s keep it simple and do these separately. In scenario 1 we are going to add a special capability to our pimped profile and arrange to have all our special IUs require this capability. The net effect being that the special IUs will only ever install into pimped profiles. Here we are going to pimp a server profile to prevent server function from accidentally being installed on clients. See bug 27600 for another example usecase.

In createIU() below we first create an IU descriptor and then spoof up a serverside capability. The name and namespace of the capability don’t actually matter as long as they are unique. Having created the capability we add it to the IU descriptor and instantiate and return the IU. That’s it — the profile now says it is capable of supporting serverside function.

private IInstallableUnit createIU() {
    InstallableUnitDescription iu = new MetadataFactory.InstallableUnitDescription();
    String id = "server-side";
    Version version = Version.createOSGi(0, 0, 0);
    iu.setId(id);
    iu.setVersion(version);
    ArrayList capabilities = new ArrayList();
    capabilities.add(MetadataFactory.createProvidedCapability(id, id, version));
    iu.addProvidedCapabilities(capabilities);
    return MetadataFactory.createInstallableUnit(iu);
}

Now to mark our server-side function. The key here is to make the server-side function require the server-side function. That is, make it require the server-side capability that we just added to the profile.

To do this, just create a p2.inf file as shown below and put it in the relevant server-side elements (root of features or META-INF dir of bundles). When the feature or bundle is published to a p2 repo, the indicated requirement is added to the corresponding IU. In practice you only need to annotate the top level IU that is being installed so that it fails to resolve on non-pimped profiles.

requires.1.namespace=server-side
requires.1.name=server-side
requires.1.range=[0.0.0,0.0.0]>

There is doc coming on p2.inf for the Galileo release but in the mean time see one of the original bugs.

Scenario 2 requires the setting of a dynamically determined property.  This came up in a system admin tool that created profiles and allowed the users to set some values that had to be presented as command line args. Here we use VM args just for fun. You can tweak program args, configuration properties, …

The createIU() method below is largely the same as the previous one but now rather than creating a capability we create some touchpoint data — specifically some action calls to add VM args. You can find out more about action on the p2 wiki.

private IInstallableUnit createIU() {
    InstallableUnitDescription iu = new MetadataFactory.InstallableUnitDescription();
    String time = Long.toString(System.currentTimeMillis());
    iu.setId("property.setter");
    iu.setVersion(Version.createOSGi(0, 0, 0, time));
    Map touchpointData = new HashMap();
    String id = getID();  // put your code here
    String data = "addJvmArg(jvmArg:-DmyProperty" + "=" + id + ");";
    touchpointData.put("configure", data);
    data = "removeJvmArg(jvmArg:-DmyProperty" + "=" + id + ");";
    touchpointData.put("unconfigure", data);
    iu.addTouchpointData(MetadataFactory.createTouchpointData(touchpointData));
    ITouchpointType touchpoint = MetadataFactory.createTouchpointType(
        "org.eclipse.equinox.p2.osgi", 
        new Version(1, 0, 0));
    iu.setTouchpointType(touchpoint);
    return MetadataFactory.createInstallableUnit(iu);
}

With this IU installed, the launched profile will have the given JVM arg set.

You can get similar effects by manually creating the relevant IUs, publishing them to a repo and then installing them like any other IU — but that’s boring and error prone. Using this approach you can create a custom installer that sets up all manner of things in the profiles it manages.

on May 7th, 2009Poll: What OSGi services do you care about?

The other day I announced that new content for the upcoming OSGi and Equinox book is available on Safari Rough Cuts. Cool.

A few people commented on the post and to me privately that they would really like to see certain OSGi Compendium services covered.  Some of the ones mentioned surprised me a little as frankly, I’ve never had cause to use them.  But that’s just me.  What about YOU?

Well, to find out I set up a Doodle poll listing the various services.  Please select the ones you care about or think are interesting/important to have covered in a book.

We are not guaranteeing that all the top picks will be covered as space and time are limited, but your input will definitely help guide us decide what to include and in how much detail.

© EclipseSource 2008 - 2011