Articles by Yan Pujante
-
Code Alert! This is a part of our continuing series on Engineering at LinkedIn. If this isn’t your cup of Java, check back tomorrow for regular LinkedIn programming. In the meanwhile, check out some of our recent announcements, tips and tricks, or success stories.
When you start using OSGi, the very first problem you are going to be faced with, is the fact that OSGi requires bundles. A bundle is nothing more than a jar file with extra manifest information. Here is a ‘typical’ example of a manifest for an OSGi bundle (the entries in bold are the OSGi specific headers).
- Topics:
- Engineering
-
In my last post I talked about how the Spring-DM extender automatically recognizes new namespaces. In this post I’ll talk about how to configure the extender itself. First let’s talk a little bit about fragments (since it is the mechanism used by Spring-DM).
What is a fragment?
A fragment is a special kind of OSGi bundle. By itself a fragment does not do anything: it cannot be started (it is illegal to have an activator for a fragment). A fragment needs to be ‘attached’ to another bundle called the host bundle. You define a fragment bundle by adding a special header in the MANIFEST:- Topics:
- Engineering
-
LinkedIn has been extensively using the Spring Framework for wiring purposes and life cycle management (we seldom use other features like AOP, JDBC, Spring MVC, etc.). In other words we essentially use the IoC container. To give you an idea of how extensive we use it, as of this writing, we have over 1000 Spring files that make up the LinkedIn platform!
Before Spring 2.0, there was no easy way to extend the framework itself to add your own custom XML tags. One might wonder why you would want to do this? Well I guess the best answer lies in the fact that it was introduced with Spring 2.0 . More seriously, the idea of having your own custom tags can be compared to the ability of creating a JSP tag library for JSPs: you can create tags that are more specific to your domain, define required attributes so that it can actually be validated with an XML schema (instead of properties), etc.
- Topics:
- Engineering
-
In this post I will describe how I was able to make LinkedIn’s JSP compiler work within an OSGi container.
I guess the first question I need to answer is why on earth does LinkedIn has its own JSP compiler? The answer is partly for historical reasons and partly for feature reasons. The JSP compiler that we have (I am the author of it) has enhanced the JSP standard in the following manner:
- Topics:
- Engineering
-
For about 2 months now, LinkedIn has been actively working on a new iteration of its architecture: one that scales both from a customer point of view, and from a developer point of view. Our desire for modularity, decoupling, and service discovery led LinkedIn to look at OSGi for its new platform/container. Currently we’re using Tomcat for our frontend and Jetty for our backend. OSGi has the right properties that we believe will help us achieve our goal.
Probably one of the most known pieces of software that uses OSGi is Eclipse, the most popular open source IDE for Java (yes, it’s a lot more than that, but this is what it’s famous for). OSGi is a specification and Equinox is an open source implementation of the specification on top of which Eclipse is built. There are other implementations of OSGi, like Apache Felix and Knopflerfish. I went to the EclipseCon 2008 conference a couple of months ago to follow the OSGi track. The good news is that OSGi as a server container is getting a lot of traction as more and more people are embracing the new technology and seeing the advantages of what it can bring (multiple versions of the same class in the same container, dynamic updates of classes, etc.).
- Topics:
- Engineering







