Home » 2009 » 2009 » November

Neil Bartlett: OSGi: It’s Time to Ban Bundle Activators

Well… maybe not ban them exactly. Yes, the title of this post is deliberately provocative and overstates my argument, for which I apologise. Nevertheless it’s true that, in many cases, activators would be better written as Declarative Services (DS) components.

Compare the following two code blocks. First an activator:

  1. import org.osgi.framework.BundleActivator;
  2. import org.osgi.framework.BundleContext;
  3.  
  4. public class MyActivator implements BundleActivator {
  5.     public void start(BundleContext context) {
  6.         System.out.println(“Hello world!”);
  7.     }
  8.     public void stop(BundleContext context) {
  9.         System.out.println(“Goodbye world!”);
  10.     }
  11. }

Next a DS component:

  1. public class MyActiveComponent {
  2.     public void activate(Map<String,Object> config) {
  3.         System.out.println(“Hello world!”);
  4.     }    
  5.     public void deactivate() {
  6.         System.out.println(“Goodbye world!”);
  7.     }
  8. }

Notice the difference? The DS one doesn’t depend on OSGi APIs at all, so it’s easier to test and it’s reusable in non-OSGi containers. It can receive configuration data easily via a Map instance, although we can omit that parameter if we don’t need it. Also whereas a bundle can have only one activator, it can have as many active components as we like, which saves having to multiplex several loosely-related concerns into a single class.

Now, you may have heard that DS requires you to write an XML file that is pretty ugly. Never mind, let’s just get our build tool to generate it from our source code. Bnd can do that, here’s an example… let’s say we also want to change the names of the lifecycle methods because the default names (activate and deactivate) are too boring:

  1. public class MyActiveComponent {
  2.         @Activate
  3.         public void getBusyLiving(Map<String,Object> config) {
  4.                 System.out.println(“Hello world!”);
  5.         }
  6.         @Deactivate
  7.         public void getBusyDying() {
  8.                 System.out.println(“Goodbye world!”);
  9.         }
  10. }

Something else we often need to do from an activator is invoke a service. This is quite hard because we don’t know if the service will be available when our bundle starts. The solution to this when writing activators is to implement a ServiceListener or ServiceTracker so we can be called back later when the service we want becomes available. Unfortunately it all ends up in very complex programmatic listener code. With DS we can do this declaratively by saying we need at least one instance of the service, so please don’t activate us until such a service instance is available. Here’s the code for that:

  1. public class MyActiveComponent {
  2.         EventAdmin events;
  3.         @Activate
  4.         public void getBusyLiving(Map<String,Object> config) {
  5.                 events.postEvent(new Event(“MYTOPIC”, new HashMap()));
  6.         }
  7.         @Deactivate
  8.         public void getBusyDying() {
  9.                 System.out.println(“Goodbye world!”);
  10.         }
  11.         @Reference(service=EventAdmin.class)
  12.         public void setEventAdmin(EventAdmin ea) {
  13.                 this.events = ea;
  14.         }
  15. }

Couldn’t get much easier, could it? We can even add an optional attribute to that @Reference annotation to say that we would like to use the service if it is available, but we’ll go ahead and continue working without it if not.

Finally a common task that activators do is publish a service. Although that’s not particularly difficult to do programmatically, in DS it’s even simpler:

  1. @Component(provide=Executor.class)
  2. public class MyExecutorService implements Executor {
  3.         public void execute(Runnable command) {
  4.                 new Thread(command).start();
  5.         }
  6. }

Now this is where DS gets really cool. When the bundle containing the above component is activated, DS will register the service for us in the service registry but will not actually instantiate the class. Only when a consumer bundle comes along and really uses the service does DS create the implementation object. Thus we can create large numbers of components as services essentially for free, and only the ones that are actually used will be loaded. In contrast, when we use activators we generally must eagerly create an implementation backing a service before we know whether any consumers even want to use the service… so we may end up creating many service objects that are never used, and this wastes memory and CPU time.

So most of the time we can get by without bundle activators. When do we still need to use them? Generally if we want to do something like writing an extender bundle — which manipulates the state and behaviour of other bundles — we need access to the OSGi APIs as provided by a bundle activator. We cannot write extenders as POJOs, but we can use them to enable POJO-based programming in other bundles. In other words, extenders are “glue” code, not business logic. For the majority of your application, stick to DS components and POJOs.

Kim Moir: Good Eclipse Swag

I found this mug in the kitchen at work today. It has Eclipse key bindings on front


and back.


Now, all I need is a sandwich to go with this and I’d be set. From xkcd

Swag is rarely both useful and aesthetically appealing. This is both! Thanks itemis!

Boris Bokowski: Step Up or Shut Up

So we’re at it again, sigh…

It seems that the same people are commiserating the tragedy of the commons at Eclipse, at regular intervals, over and over again. Complaining is not a very good way to get what you want – I know one thing or the other about this as a father of three ;-) . Complaining may work once or twice, but if you keep repeating the behaviour, people will stop listening to you.

Normally, I would just sit these things out but this time I feel compelled to add some oil to the fire:

  • Diversity on e4: It is very easy to become a committer on e4 – that’s one of the purposes of an incubator. Basically, all it takes is a believable email to e4-dev@eclipse.org that you would like to work on something in the context of e4, and you will be nominated as a committer. Still, IBM has most of the commits in the e4 project. Who do you think is to blame for that? IBM? Because it is investing in a project whose goal it is to bring innovation back into the Eclipse Platform?
  • Diversity on the Eclipse Platform: The last example I know of where people or companies wanted to contribute to the Platform but were not received with open arms is from about two years ago, when developers from WindRiver complained that their contributions did not make it into the Debug and Resources components. Where are we today? Both these components have committers from WindRiver, and Martin Oberhuber, a WindRiver employee, is a member of the Eclipse PMC. By the way, are those new committers contributing to those Eclipse Platform components full-time? No. (Just to be clear – I don’t want to pick on WindRiver at all: I think it’s great that they are in fact investing in the Eclipse Platform, even if it’s just a little, when many other companies that benefit from the Platform don’t invest anything at all.)
    So, if you’d like to contribute to the Eclipse Platform on an ongoing basis, and feel that you are not “let in”, please speak up so that we can fix the problem. I am pretty sure that this problem doesn’t exist, and that instead the problem is more on the side of those who decide not to contribute, than it is on the side of the existing committers.
  • Forking: As of lately, this is easier than ever. Eclipse projects are now mirrored as Git repositories, starting with those that are using CVS for the main development. Knock yourself out, and don’t forget to make the source available if you are creating derivative works. However, I don’t think this is going to be a solution to the “tragedy of the commons” problem. I do hope this will make it easier to create private branches when your development timeline does not align with the one at eclipse.org, and you need to just fix something now. I also hope it will make it easier for contributors in general to provide patches that don’t go stale.
    By the way, the mirroring as Git repositories happened thanks to Denis and the webmasters at Eclipse, thanks to Shawn Pearce and the EGit and JGit team, and to a small amount thanks to Mike Milinkovich, the Eclipse Board of Directors, and your committer representatives on the board. If you are interested in details, see the bug Chris Aniszczyk opened on June 17th just after Doug Gaff and I were able to convince Mike Milinkovich and the Board (minutes) that it was important to make this happen.
  • The Foundation is doing concrete work to help: Mike has mentioned some of the things that are planned for 2010 on his blog: “a branded Eclipse forge hosted elsewhere (e.g. IP Policy free), Git support for the whole community and major improvements in hosted build and test at eclipse.org.” I believe that the Eclipse Foundation staff, and Mike Milinkovich as the executive director, are doing a pretty good job, and they are also actively trying to get more involvement by other companies and individuals for core projects at Eclipse. The board of directors even made this a strategic goal for the Eclipse Foundation this past June1.

So overall, my comment would be “step up, or shut up”. If you care about the future of Eclipse, pick a component or feature in one of the core projects that is critical for your use of Eclipse and help what you can. I would put at least the following in the “core projects bucket”: Equinox, Eclipse Platform (with SWT, JFace, Workbench, Resources, Debug, Text, etc.), EMF, and GEF. If you think another project belongs in there, pick it instead and help there.

Now for the definition of “help”, I would recommend that you focus on a narrow enough subpart so that you can follow along for the next little while (like, for example, a year). Spend some time on the newsgroup/forum, read and understand the code, watch incoming bugs, find out who is the current maintainer, contact them and let them know you are interested in helping, and so on. This does not have to take a lot of time, but there is probably a lower limit of perhaps one or two hours per week. Convince your manager that doing this is important for the company, since they have software products that rely on the component or feature in question. You can also argue that investing a little time will help improve your skills. In fact, the latter point is a motivation that works even if you don’t have an employer, if for example you are a student, or self-employed, or just not employed at the moment.

What’s in it for you? Potentially fame, when your name starts appearing in Eclipse source file headers, or in IP logs (which by the way are another good way to measure project diversity). You’ll learn about “the eclipse way“, the development process that allows us to ship on time and with quality, every year, for the last nine years. Finally, you’ll have the warm fuzzy feeling that comes with ensuring the future of a core piece of technology that is being used by millions of users. Of course, you could help an Apache project, or Linux, or Mozilla, or on SourceForge or GitHub, but chances are (if you are reading this on Planet Eclipse) that your job indirectly depends on the future of Eclipse – not Apache, Linux, or Mozilla.

(Image © Zen Sutherland, http://www.flickr.com/photos/zen/241745451/sizes/o/, licensed under Creative Commons by-nc-sa 2.0)

1 You have to read between the lines for this, not sure if newer board minutes have more detail. The June board minutes state: “In discussing the strategic goals of the Eclipse Foundation, the Board indicated that diversity on e4 was of strategic importance to the Eclipse Foundation. In addition, it was important to continue to grow a diversified revenue model. As a result of the discussion, these two concepts were introduced into the Strategic Goals of the Foundation.” Since a strategic goal that focuses solely on e4 seems a little odd, this has been generalized to apply not only to e4 but to other platform-y projects at Eclipse, I believe the wording is “Ensure adequate resources are invested in the core technology platform”.

Eclipse Pulsar Gains Momentum with Mobile Industry Leaders

New release of Pulsar adds support for Ericsson and Sony Ericsson

CTIA Wireless IT & Entertainment – SAN DIEGO, Calif. – October 7, 2009 -
The Eclipse Foundation today announced a new release of Eclipse Pulsar, an application
development tools platform for mobile developers. The new release extends support to the
Ericsson and Sony Ericsson developer communities.

Pulsar is the result of collaboration among leaders in the mobile industry to provide a
common set of Eclipse-based tools in a single packaged distribution that supports multiple
software development kits (SDKs). With Pulsar, developers can use a single, familiar
development environment to create mobile applications that target different devices. With
today’s release, Pulsar now supports SDKs from Motorola, Nokia, Ericsson and Sony Ericsson.

“Ericsson is a longtime Eclipse member, and participating in the Pulsar initiative aligns
with our business goals,” said Roland Svensson, Vice President, Portfolio Management and
Technology at Ericsson. “We believe Pulsar has the potential to make it easier for mobile
developers to gain access to the tools and SDKs they require.”

Stefan Qelthin, Head of SW Environment for Sony Ericsson, also noted: “Pulsar brings
together a common tools platform that allows participating handset makers to focus on
providing value added tools for their developer communities. Sony Ericsson is pleased to be
part of this industry initiative and hope it will help fuel a broader ecosystem of mobile
apps and opportunities for the developer.”

Members of the Pulsar initiative aim to work across four key areas:

  • The creation of the packaged distribution called Eclipse Pulsar Platform;
  • A technical roadmap to advance the capabilities of the platform;
  • A set of best practices which includes documentation and test suites; and
  • Education and outreach to drive adoption of Pulsar with mobile application developers.

“Pulsar is delivering on its promise to streamline the development of mobile applications,
arguably the hottest growth area in the mobile market today,” noted Mike Milinkovich, Executive
Director, Eclipse Foundation. “Pulsar is also a great example of how Eclipse continues to be a
platform for collaboration. We are pleased that Ericsson and Sony Ericsson have joined Motorola
and Nokia in Pulsar, and look forward to their contributions to making Pulsar a truly
definitive mobile application development tools platform.”

The new Pulsar release is available immediately for download at
http://www.eclipse.org/pulsar/.
Eclipse and Pulsar leaders will be at the WIPJAM on October 8 during CTIA. Register at
http://wipjam.com/wipjam-ctia/.

Early EclipseCon Submissions Qualify for Early Bird Selection

There are 2 weeks left to submit your
talk
for EclipseCon 2010! The call for participation deadline is December 18.

However, we want you to submit your session proposal early, rather than waiting until December 18.
Therefore, if you submit a session by December 10, you will be eligible for the early bird program
selection. The program committee will pick 5 great talks for the EclipseCon
schedule from those submitted by December 10. The submitters of the 5 chosen talks will also be
awarded an Eclipse shirt! The early bird selections will be announced December 14.

EclipseCon will feature talks on a wide variety of subjects, including e4, mobile & embedded,
modeling, runtime, tools and more! This year, the conference is being organized
around three themes:

  • Making with Eclipse – how people use Eclipse to create great software.
  • Making at Eclipse – state-of-the-nation talks about Eclipse projects and how people can use the technology.
  • Making Community – how Eclipse projects and the wider Eclipse community can continue to grow and prosper.

Contribute to the community by making a proposal
or reviewing submissions.
Don’t miss out on the early bird program selection!

EclipseCon 2010 is March 22-25, 2010 in Santa Clara, CA. Registration
is already open and sponsorship
packages
are available.

Eclipse DemoCamps, Dec. 6-12: Copenhagen, Florence, Nieuwegein

December 6-12 is the last week for Eclipse DemoCamps. There were 33 events
on the schedule this series – the most ever! It’s not too late to catch up on the latest and greatest
in Eclipse with these last 3 DemoCamps:

All locations are listed on the DemoCamp wiki.

Eclipse Announcements: Eclipse DemoCamps, Dec. 6-12: Copenhagen, Florence, Nieuwegein

December 6-12 is the last week for Eclipse DemoCamps. There were 33 events
on the schedule this series – the most ever! It’s not too late to catch up on the latest and greatest
in Eclipse with these last 3 DemoCamps:

All locations are listed on the DemoCamp wiki.

Java User Groups Roundup, Dezember 2009 (heise developer neueste Meldungen)

Mike Milinkovich: Dear Bjorn: Go away

Bjorn,

Your latest post deserves a clear response.

Your former colleagues at the Eclipse Foundation have tolerated your public abuse quietly because we are professionals, and we honestly thought that you would tire of it. Apparently we were wrong. But the time has come to say it: You are a jerk. Please go away. You quit the Foundation, you have zero commits since April, and we tire of your sniping from afar.

It is no secret that the Eclipse Foundation is a 501(c)6 and is supported financially by members. But to say that the Foundation does not care deeply about the open source community is a pure fabrication. It attacks the personal and professional reputations of all of us who work hard at the Foundation for the entire community.

Since you left, the team has made great strides in pulling together a number of wonderful, committer-oriented prgrams for 2010. Included amongst the items already committed to the Board is a branded Eclipse forge hosted elsewhere (e.g. IP Policy free), Git support for the whole community and major improvements in hosted build and test at eclipse.org. All initiatives that you failed to make much progress on in four years on the staff here.

If you want to go create your own forge somewhere, go ahead. Your steady acid drip of negativity will serve your new community well.

Reliable, Deterministic Communication in Hostile Environments

Chip Downing (Wind River), Joe Schlesselman (Real-Time Innovations)
 

<!–

–>

Abstract:

What you need to know to build reliable real-time command and control communication systems

Join RTI and Eclipse Foundation member Wind River for an informative free webinar on industry-leading technologies for developing and deploying real-time distributed systems using commercial off-the-shelf (COTS) solutions requiring security and safety qualifications. Companies responsible for developing safe and secure military and civilian infrastructure systems need to use the latest advances in technology for ensuring they comply with industry standards and current and future security and safety demands.

This webinar presents the powerful combination of Wind River VxWorks MILS and RTI Data Distribution Service. The Wind River VxWorks MILS Platform delivers the security foundation aerospace and defense (A&D) companies need to meet the real-time operating system (RTOS) requirements for high robustness (EAL6+) multilevel secure (MLS) systems. It includes the award-winning Wind River Workbench development suite, an Eclipse-based collection of tools for debugging, code analysis and testing designed to accelerate time-to-market for developers building devices. RTI Data Distribution Service is high-performance networking middleware for distributed, real-time applications. Its flexible publish-subscribe communications model allows distributed processes to share data without concern for the actual physical location or architecture of their peers. Together, they provide the infrastructure needed to create highly-secure distributed real-time systems.

Topics:

  • System architecture and design for building secure distributed systems
  • Reliable and reconfigurable publish-subscribe communications platforms
  • Deploying COTS solutions that rapidly enable security and safety certification

Who Should Attend:

  • Executive-level personnel who are interested in understanding the challenges of embedded platforms
  • Program managers, system security and safety architects
  • Network infrastructure design engineers
  • Anyone requiring an introduction to next-generation embedded technologies for critical aerospace and defense systems


delicious delicious | digg digg | dzone dzone

<!–

–>

EclipseLive: Upcoming Event: Reliable, Deterministic Communication in Hostile Environments

Event Date: December 9, 2009 3:00 pm GMT-8

Register Now

Chip Downing (Wind River), Joe Schlesselman (Real-Time Innovations)
 
Abstract:

What you need to know to build reliable real-time command and control communication systems

Join RTI and Eclipse Foundation member Wind River for an informative free webinar on industry-leading technologies for developing and deploying real-time distributed systems using commercial off-the-shelf (COTS) solutions requiring security and safety qualifications. Companies responsible for developing safe and secure military and civilian infrastructure systems need to use the latest advances in technology for ensuring they comply with industry standards and current and future security and safety demands.

This webinar presents the powerful combination of Wind River VxWorks MILS and RTI Data Distribution Service. The Wind River VxWorks MILS Platform delivers the security foundation aerospace and defense (A&D) companies need to meet the real-time operating system (RTOS) requirements for high robustness (EAL6+) multilevel secure (MLS) systems. It includes the award-winning Wind River Workbench development suite, an Eclipse-based collection of tools for debugging, code analysis and testing designed to accelerate time-to-market for developers building devices. RTI Data Distribution Service is high-performance networking middleware for distributed, real-time applications. Its flexible publish-subscribe communications model allows distributed processes to share data without concern for the actual physical location or architecture of their peers. Together, they provide the infrastructure needed to create highly-secure distributed real-time systems.

Topics:

  • System architecture and design for building secure distributed systems
  • Reliable and reconfigurable publish-subscribe communications platforms
  • Deploying COTS solutions that rapidly enable security and safety certification

Who Should Attend:

  • Executive-level personnel who are interested in understanding the challenges of embedded platforms
  • Program managers, system security and safety architects
  • Network infrastructure design engineers
  • Anyone requiring an introduction to next-generation embedded technologies for critical aerospace and defense systems


delicious delicious | digg digg | dzone dzone

World’s First Remote Internet Explorer Debugger For Desktop Developers: MyEclipse

Debug deployed applications in real time for Internet Explorer versions six,seven, and eight. Latest release also includes native support for WTP projects and enhancements to Struts 2 and UML 2

Updated Plugin: MobiOne :: Mobile Web Development – v1.0 M5

MobiOne :: Mobile Web Development Category: ToolsDescription:

Updated Plugin: MyEclipse Blue Edition – v8.0

MyEclipse Blue Edition Category: IDEDescription: MyEclipse Blue Edition: the powerful IDE for WebSphere developmentNow migrate from RAD or WSAD into MyEclipse with ease in 8.0 Blue Edition and take advantage of Internet Explorer Debugging, VisualVM Jav…

Updated Plugin: MyEclipse Enterprise Workbench – v8.0

MyEclipse Enterprise Workbench Category: J2EE Development PlatformDescription: Internet Explorer Remote Debugger, VisualVM Java Profiler, Visual SQL, WTP project support, UML 2, WebSphere 7 support, Eclipse 3.5.1/Galileo, RESTful Web Services, Maven, A…

Gnome-Entwickler treffen sich in Den Haag

Die GUADEC, die alljährliche Entwicklerkonferenz der Gnome-Macher, steht ganz unter dem Thema Gnome 3.0.

Updated Plugin: STAN – Structure Analysis for Java – v2.0.0 beta2

STAN – Structure Analysis for Java Category: Source Code AnalyzerDescription:
New in 2.0: Eclipse project and plug-in dependency graphs!

STAN encourages developers in visualizing their design, understanding code, measuring quality and reporting …

Updated Plugin: Convertigo Mashup Studio – v4.5

Convertigo Mashup Studio Category: Web ServicesDescription: Convertigo’s C-EMS solution makes it easy to cost-effectively track down the data that you need, from wherever it is, and process and display it in a way that works for you. Convertigo’s user-…

Updated Plugin: Emacs+ – v2.7.2

Emacs+ Category: EditorDescription: Emacs+ – Eclipse Extensions for Emacs Expatriates – Now with Rectangle Commands – provides an enhanced Emacs-like experience in the Eclipse text editors. Included are:
M-x command execution
C-u universal-argumen…

New Plugin: Public Eclipse Template Repository – v1.0.2

Public Eclipse Template Repository Category: IDEDescription: This plugin makes it easy to share code templates with other users via public template repository. It adds two actions to Templates View popup menu which make it easy to upload and download t…

Stephane Bouchet: Acceleo Tip #2

Remember my previous Tip ?

Again, this one is about differences between OCL and Java.

This one is about the fix that will permit to use the string.index(string). service.

According to https://bugs.eclipse.org/bugs/show_bug.cgi?id=296486, this service will use the OCL mechanism in the next version.

So if you used that service, don’t forget to migrate your templates !

Saltmarch Media and Think88 Form Strategic Partnership to Deliver soapUI Training

Saltmarch Media and Think88 today announced a strategic partnership to deliver soapUI training in India. According to the agreement, Think88 will license the ‘Introduction to soapUI’ and ‘Advanced soapUI Pro’ training courses to Saltmarch for i…

Java + Münster: Stammtisch am 2.12. » Java User Group Münster

Es ist wieder soweit: Für alle an der Java Technologie und Softwareentwicklung begeisterten ist der nächste Java Stammtisch genau das richtige. Am Mittwoch dem 2.12. treffen wir uns im Cuba Nova ab ca. 18:30 Uhr, Achtermannstraße in der …

VirtualBox beamt VMs im laufenden Betrieb

Sun hat Version 3.1 der kostenlosen Virtualisierungssoftware VirtualBox zum Download freigegeben.

Eclipse JPA Explorer 1.0.0

Das Eclipse Plug-in JPA Explorer 1.0.0 ist in der Lage, den Eclipse Workspace auf JPA-Entitäten hin zu durchsuchen und ermöglicht die Navigation zwischen den Entitäten und den Datenbanktabellen. Das Plug-in ist frei für die nicht-kommerzielle …