Tuesday, June 30, 2015

New RFPs under discussion at OSGi

While the Enterprise R6 release is currently in the process of being released, new topics are being worked on in the OSGi Alliance. These topics are currently discussed in RFP documents, which hold the requirements. The plan is to finalize these RFPs by the end of the summer, then we can start on the RFCs, the technical design that will ultimately be the basis for future spec texts.

Below you can find a brief 'elevator pitch' of the currently active RFPs, as discussed in the Expert Groups. For details click on the links that will bring you to the actual text. All documents are available publicly in GitHub here: https://github.com/osgi/design/tree/master/rfps.

The following RFPs are discussed in the context of the Core Platform and Enterprise Expert Groups:
  • RFP 163 Log Service Update - This RFP is about modernizing the OSGi Log Service and making is easier to use. 
  • RFP 164 Authentication and RFP 165 Authorization - Are about providing APIs to integrate various security providers and mechanisms into OSGi for authentication and authorization.
  • RFP 166 Scheduling - Provide a cron-like persistent scheduling API.
  • RFP 167 Manifest Annotations - Adds annotations to generate OSGi Manifest Headers. In particular this will make generating Provide-Capability and Require-Capability headers easier.
  • RFP 168 Configurer - This RFP is about providing a standard way to store OSGi Configuration Admin configuration inside a bundle.
  • RFP 169 Object Conversion - The converter that converts anything into everything. This can be especially useful when working with configuration data or service properties.
  • RFP 170 Managed JPA - Adds Managed JPA to the OSGi JPA integration.
  • RFP 171 Web Resources - This RFP talks about a standard way to provide resource for the web. In particular it's about providing JavaScript libraries and CSS files such as Angular, Bootstrap, D3 etc from an OSGi bundle.
  • RFP 172 Protocols - Create a REST service using OSGi annotations and conventions.
  • RFP 173 JAX-RS - Integration with JAX-RS.

The following RFP relates to the Internet of Things:

Have any thoughts or feedback on these requirements documents? Anyone can post feedback as described at https://github.com/osgi/design#feedback.

Want more direct involvement? If you are interested in participating in shaping these specifications, or writing an entirely new RFP, then become a member. Details on joining can be found here: http://www.osgi.org/Join

Wednesday, June 3, 2015

OSGi Enterprise R6 specifications proposed final draft

The OSGi Enterprise R6 specs are now available as proposed final drafts: http://www.osgi.org/Specifications/Drafts
OSGi members are currently voting on these and once that is done the same text will be released as 'final' specification. Let's dive in to see what's new!

New specifications

  • Promises - Promises are a popular asynchronous programming paradigm regularly used in the JavaScript world. The Promises specification brings a similar asynchronous programming model to Java. It allows you to define a chain of operations that are executed asynchronously, every next step being started once the previous one has completed. For example, let's say you have some code that needs to prepare a download, then find the appropriate mirror and then start downloading, all time consuming operations. This can nicely be modeled asynchronously using promises:
      Promise<InputStream> masterURL =
        prepareDownload().then(p -> getMirror(p.getValue()).

        then(p -> p.getValue().openStream());
    Promises integrate very well with Java 8 lambdas and support monadic programming. They can be used both inside as well as outside of an OSGi Framework.
  • Asynchronous Services - This specification can turn any regular OSGi service into an asynchronous service. It leverages the Promises API as described above and supports turning ordinary services into async ones. It also provides support for developing new services that are specifically implemented to be asynchronous. 
  • REST Management Service - This specification adds remote framework management via REST over HTTP, either using XML or JSON. This is particularly useful in cloud settings where traditional Java remote management via JMX does not work very well. The REST management service can either be invoked directly, or via the Java and JavaScript clients that are defined in the specification. The JavaScript client allows you to use the REST Management service directly from your JavaScript code in the browser. 
  • HTTP Whiteboard Service - OSGi has provided a simple mechanism to register servlets for a long time via the HTTP Service specification. This specification, although widely used, has aged a little. The new HTTP Whiteboard specification supports Servlets, Filters, static resources and Http/Servlet listeners based off the Servlet 3.1 specification. It leverages the OSGi Whiteboard pattern (www.osgi.org/wiki/uploads/Links/whiteboard.pdf) to register them, which effectively means that if you register a Servlet or a Filter as a service, it will be made available by the whiteboard runtime. This specification also includes a wide range of DTOs to allow runtime introspection. 

Updated specifications

  • Declarative Services - This specification has undergone extensive changes bringing several exciting enhancements: new annotations for field injection, a strong-typed mechanism based on annotations for providing configuration and DTOs for introspection. Declarative Services now also support Prototype Service Factories which were introduced in the Core R6 release. Numerous other small improvements were also made to DS. 
  • Remote Service Admin - This specification has had minor updates which allow remote endpoints to be updated. In the past the only way to do this was to remove/re-add the endpoint but in practise this caused unnecessary volatility in the system, especially for discovery providers. With the update facility this volatility is now avoided.
  • Repository - The OSGi Repository service now supports composite queries that span multiple namespaces. With this you can ask the repository questions like 'Is there a bundle that exports javax.mail and has the ASL license?' As this information is expressed in different capability namespaces, it's an example of a composite query. A requirement builder utility has also been added to by this specification to make the developer's life easier. 
  • Subsystems - This specification has been updated to allow providing a Deployment Manifest at deploy time. No longer does it need to be embedded in the subsystem archive. Deployment manifests freeze the dependencies that a subsystem has to particular versions; for example the versions validated during a QA phase. With this release these manifests can be provided separately, without the need to modify the subsystem archive (.esa file). The subsystems specification also received a number of other updates. 
A number of smaller changes were made to other specifications. Look for the Changes sections at the back of each chapter for details.

Capability Namespaces

The Enterprise R5 specification provided a number of capability namespaces for general use: osgi.extender, osgi.service and osgi.contract. The Enterprise R6 specification adds the osgi.implementation capability. This capability is useful to ensure that a given technology is present. For example, if you want to ensure that the HTTP Whiteboard implementation is present in a given framework, just add a requirement of the osgi.implementation capability:
  Require-Capability: osgi.implementation;
  filter:="(&(osgi.implementation=osgi.http)(version:Version>=1)(!(version:Version>=2)))"


Note that if the implementation is an extender, then osgi.extender is used instead of osgi.implementation.
Specifications that have been updated in this round have these standard capabilities added, where this made sense.
In addition, Portable Java Contracts have been defined using the osgi.contract namespace to achieve portable bundles for JSR-based java packages that don't follow semantic versioning. This allows for portable consumer bundles of these packages. See here: http://blog.osgi.org/2014/09/portable-java-contracts-for-javax.html and http://www.osgi.org/Specifications/ReferenceContract.

Enjoy, take a look at all this good stuff. The PFD spec is available here: http://www.osgi.org/Specifications/Drafts. A number of (near) finished implementation are available, you can find them listed on the OSGi Specification Implementation wikipedia page: http://en.wikipedia.org/wiki/OSGi_Specification_Implementations

David Bosschaert
Raymond Augé

OSGi Enterprise Expert Group co-chairs

Wednesday, May 27, 2015

IoT Requirements Meeting Berlin & San Jose

Last week Thursday we had an OSGi IoT Requirements day in Berlin and next week Thursday (June 4) we will have another workshop in San Jose.

Now I always like to go to Berlin (I worked there part-time for Deutsche Telekom for about 3 years) but this time was even more special. The reason was the excitement that made me fondly remember the early days of the OSGi. The more than 30 people that signed up for the requirements day represented the industry very well and it was good to see some faces that had disappeared over time but that are now interested again.

A certain 'déja vu' was definitely present. Then again, the differences with those early days are huge. Today we have a mature proven specification, many implementations, books, and so much more. We also now face an industry where Java is no longer seen as overweight except for the smallest of devices. However, the field today is also more crowded. An impressive number of organizations have sprung up around IoT or are taken advantage of the energy in the industry. Over the past few weeks I had moved back to the future a bit by extending OSGi enRoute with some IoT support at the request of the Alliance's board. (Watch this blog if you want to use that dusty Raspberry Pi that has been lying on your shelf for the past 3 years.) I confess, I find that writing software that actually moves the world more fun than being locked up in cyberspace. And best of all, in this world they the dynamic nature of OSGi is a prerequisite.

Anyway. The workshop turned out to be a very interesting day with some really good results. We gathered quite a few topics and their requirements and had some interesting discussions. After the next workshop in San Jose (contact us on iot@osgi.org if you still want to participate, there are a few seats left) we will disseminate the results through a mailing list that we will open up after San Jose.  I will also use this blog to report about progress.

Let's see what San Jose brings!

Peter Kriens




Monday, March 30, 2015

Yet Another Maven Bundle Plugin!

It must have been 8 years ago that Richard S. Hall visited me here in the south of France. During these days we hacked together a rudimentary plugin for Maven so that Richard could use bnd's functionality in his maven build. This was where we laid the foundation for the "funky" XML that described the bundle. As this was our first maven plugin, we had no clue what we were doing but it seemed to work for Richard. It is now 19 releases later. Surprisingly, the Apache Felix bundle plugin is one of the most popular downloads outside the standard Sonatype maven plugins. 

That said, the plugin was showing some strains that were not easy to correct in an existing plugin for backward compatibility reasons. Therefore, last week Neil Bartlett published a new variation on this plugin in the bndtools project.  This plugin fits better in the maven model, instead of taking over the JAR process it now only outputs the contents of the JAR in the classes folder. This fitted better when you had later phases that further processed the classes directory. Neil Bartlett, the author of the plugin describes the process in detail in his blog. Since we receive a lot of pressure to be more maven like, it is not unlikely that we will add more features to this plugin and bndtools to make them interoperate more closely.

Inspired by this new maven plugin, BJ Hargrave, added similar support to the Gradle plugin, making it easier for native Gradle builds to use the standard bnd plugin. Similar support was already available in ant.

The new plugins will be part of the bndtools build so that we can release the plugins synchronized with the new features in bnd so that we can publish them timely on Maven Central.

This does not mean that the older plugin will be disbanded any time soon. Since it is so popular and has some behaviors that are different than the new plugin we will continue provide support for the Apache Felix group to keep publishing this plugin.

Peter Kriens

Thursday, January 8, 2015

Java Modularity Revisited

There is a new JSR for Java modularity: JSR 376 and it is already approved by the Executive Committee. Not sure where to start, but I would love to participate in this group because the approach seems to be much more attractive this time around. Reading the short description I understand that this time packages are not ignored, but they actually are the units of export. This means that OSGi and JSR 376 will share the same basic concepts. Even more positive, the JSR clearly states that it will be made compatible with OSGi. All in all an excellent start.

That said, why write a blog when you're all happy?

The key concern is that there is currently no OSGi expert in the EG. As stated, I'd love to participate. There are a number of issues that I think will require some attention to not gratuitously create hardships for the 'sophisticated applications' (words from the JSR, not mine!)  that will use OSGi on top of JSR 376.

First there is the rather simple problem (but oh so contentious) of versioning. With OSGi and bnd we have quite deep knowledge of semantic versioning as it is used in a Java world. What we learned is that interface/contract based programming with multiple implementations creates some subtleties around semantic versioning that are not present in language like Javascript, Ruby, etc. I would really appreciate a chance to present these lessons to the EG. We might solve the biggest pain the OSGi currently has with the JVM: packages that have no version, if we can solve this problem I will not ask for anything else! (Well, for now.)

Second, the dependency model. The prevalent dependency model in software is transitive identity dependency, an archetypical example is maven. It is simple but it also creates humongous graphs. Though Maven does not download the Internet, people download the internet because it is so easy to do. This is exactly the problem we had in Object Oriented technology and interfaces gave us the tool to break the transitivity. The OSGi model provides an elegant solution in the same vein as interfaces did for objects. I am not sure if this model should be pushed completely in the VM but it would be worthwhile to have a discussion around the differences and what the consequences for the OSGi compatibility are.

Last but and I guess also least: the Service Loader. The Service Loader in the Java Platform provides a way for modules to locate classes by their interface name. This is a crucial service in a module oriented system, it allows the discovery of available implementations. However, one could ask if (ab)using class loaders for discovery is a brilliant idea or if it is a hack that looks acceptable because we're so used to class loading hacks? The drawbacks of class loading hacks for extensions are that objects are created without context, often requiring statics and singletons to communicate. There are better solutions and I think it would be great if we could address service discovery in a better, more Java oriented, way. And I do believe this a crucial part of a module system; when you put a fence around your territory you better think about the gates.

So where do I sign up?

Peter Kriens


Monday, January 5, 2015

Location confirmed for OSGi Exam in San Francisco - Jan 22, 2015

Happy New Year to everyone. We hope you had a good end to 2014 and are refreshed and raring to go for 2015.

For those of you in the Bay Area don't forget the OSGi Developer Certification - Foundation Level Exam on Thursday Jan 22 between 13.30 and 17.00. 

We are pleased to confirm that we have finalized the downtown San Francisco location of the exam and it is:

Rincon Center, 121 Spear Street
San Francisco
CA
94105





This is just a 5 minute walk from the Embarcadero BART station so we hope it will work well for everyone.

You can find out further details about the exam and topics that may be included on the OSGi website here.


To book a place please sign up here.



If you have any questions please email us.


Wednesday, December 3, 2014

OSGi Developer Certification Exam - San Francisco - Jan 22, 2015

We are pleased to announce the next OSGi Developer Certification - Foundation Level exam will be taking place on Thursday January 22, 2015 in San Francisco.
Picture courtesy of www.pachd.com
Picture Courtesy of
www.pachd.com 

So if you want to test and prove your OSGi proficiency and achieve an OSGi Alliance certified level of competency then be sure to sign up here.

Everyone passing the exam receives:

  • An electronic certificate (with a unique number)
  • A 'certification badge'

Plus, the OSGi Alliance maintains a register of all Certified Developers so that an individuals certification status can be verified.

The exam is open to anyone, however we recommend that you should have gained some practical experience using OSGi and have a good understanding of the OSGi R5 specification topics that are covered in the exam (full details here).

There is a special discounted price for students, and OSGi Alliance members. Please contact us by email for discount details.

More information about the exam, logistics and the benefits of achieving OSGi Developer Certification - Foundation Level can be found on the OSGi Alliance website here.

We hope you can join us.

If you have any questions please contact us by email.

Blog Archive