SailFin: When Java EE Met SIP
Two key developers involved in the SailFin project are Binod and Vince. Here we meet them and find out about the project, its tools, and direction.
I am Vince Kraemer, a Staff Engineer with Sun Microsystems. I have been part of teams that have delivered "application servers", since I joined NetDynamics over ten years ago. Most of my work has been on the "user-side" of the applications servers, so I have worked on user interface issues: integrating with IDEs, command-line and web based interfaces, developing DTDs for documents that users would author. Those sorts of things.
I am Binod PG, a senior staff engineer in the Java Web Services division at Sun Microsystems. I am the architect of Project SailFin and a co-specification lead of the Java EE Connector Architecture 1.6 Expert Group.
In the past, I was involved in the development of many areas of the GlassFish applicaton server, including Java EE Service Engine, JBI
integration, Server Startup, Connector 1.5, JDBC, Connection Pool, and JMS
provider integration. I am also one of the owners of the Generic Resource Adapter for JMS project.
Prior to joining Sun in 2000, I worked on a number of server side
software technologies, including IMS PL/1 programs in IBM Mainframes and
internet projects in Microsoft IIS.
First, tell us: What is SailFin?
SailFin is a java.net project. The goal of the project is to develop a container for SIP Servlets, similar to a HTTP servlet container, that:
1. implements JSR-289,
2. interoperates with the other containers and services in the GlassFish server, and
3. leverages the infrastructure of the GlassFish server for high availability and clustering.
Prasad Subramanian, SailFin's technical lead, published a blog entry that has more details for folks that are interested. There he explains that SailFin is a subproject under GlassFish. It adds the SIP Servlet Container based on JSR 289 to GlassFish. In addition to the SIP Servlet Container, SailFin also aims at providing High Availability of the SIP Servet Container and a loadbalancer for both SIP and HTTP traffic. Given the functionality, the SailFin codebase requires GlassFish as its underlying runtime. The WebContainer from GlassFish and the SIP Servlet Container becomes the converged container that is typical of the SIP Application Servers based on JSR289.
Where does the name "SailFin" come from?
Sreeram Duvur, and others who originally conceived this project, named it SailFin, more than a year back. It predates me in the project. About the word itself, "SailFin" is a variety of fish that is sail-like finned.
I asked Sreeram and he explains it all as follows: "We were in a restaurant on Stockholm waterfront in November 2006. The menu had a flying fish on the cover. We needed a project name. Over some beers, we started to throw out names of fish that had some aerobatic capabilities. It turned out that we liked SailFin. Later we thought of BabelFish (the fish that translates many languages, from Hitchhiker's Guide to the Galaxy). But SailFin stuck. In reality SailFin is a smallish fish with a large fin that helps it exploit currents very efficiently. We thought that is how we are exploiting GlassFish download momentum. Some people are still looking for wings and whiskers. I shared the project idea slides with James Gosling and he came up with a logo that had a surfing feel to it. Duke on a surf board, sailing. We always wanted to add the flying fish to it, sort of tagging Duke on the board. Never got around to it."
Why would someone use SailFin?
If you are developing a next generation telecommunication service, SIP Servlets are going to play a bigger part in that. So, SailFin is a natural choice. By combining SIP Servlets and Java EE, you can add rich media interactions to enterprise applications. SailFin supports high availability and load balancing of converged HTTP and SIP applications. It augments the current GlassFish administration capabilities to SIP and Converged Applications. So, you get "all of GlassFish", plus a highly available Sip Servlet Container.
The main output of Project SailFin is going to be a SIP servlet container that implements JSR-289. The differences between JSR-289 and the previous SIP Servlet container spec, JSR-116, are significant. The parallel that I draw is this: JSR-289 is the SIP Servlet developers EJB3 spec. The productivity gains from annotation vs. descriptor are really significant.
What are its main advantages?SIP technology is behind the many popular telecom services we enjoy today like VOIP, presence and buddy management, web conferencing, IM, and so on. By implementing SIP Servlet technology, SailFin brings SIP technology to the enterprise Java developer, especially the Java EE developer. The new SIP Servlet API (JSR 289) provides a standard programming model for mixing Java EE and SIP Servlets.
What are similar products and how does this relate to those?
Oracle (OCMS), BEA (WLSS), and IBM (Websphere) have similar products. SailFin is the first of these in the open source.
What about tooling? Can you show some screenshots?The tooling for SailFin involves three major functional areas: server integration, development of converged servlet applications, and protocol level testing of deployed SIP applications. I discuss each of these below.
- The server integration.
The ability to register a domain that has SailFin functionality included. This has been added to NetBeans IDE 6.1 feature set by extending the current GlassFish server integration plugin.
There is a new server choice in the first page of the add server wizard:
SIP servlet applications are displayed in a new branch of a domain's application tree.
There are a couple of new Sun specific descriptor files that have been added to SailFin. The first is a minor revision of the sun-ejb-jar_3_0-0.dtd (named sun-ejb-jar_3_0-1.dtd). Since this file contains only minor changes the xml editor for the sun-ejb-jar.xml file is still functional. The user can drop down into the XML view to edit the additional fields, if necessary.
The second new file is the sun-sip-app_1_1-0.dtd. The necessary work to support things like xml completion have been done. There is no "visual" editor for this file.
- Converged servlet applications. A converged servlet application lets users mix SIP and HTTP servlets in their project. It has the same structure as an HTTP servlet application (Web Application). There is a wizard to create a project that is a converged servlet project:
This project is implemented as a project template, based on a Web Application project.
There are two additional templates associated with a converged servlet application:
The SIP Servlet wizard looks like the HTTP servlet wizard. It is pretty boring! The SIP Listener wizard is a bit more interesting:
- SIP protocol level testing.
Testing an application that uses HTTP/HTML is pretty easy in NetBeans. You create your project, author a jsp or servlet and 'Run'. NetBeans does the deployment, opens the browser and attempts to "hit" your app. We wanted to make the experience for people developing converged servlet applications similar. This was going to be hard, since there isn't a browser that generates SIP requests. Luckily, our partners at Ericsson had something that would fill that bill. They have a 'test agent' that is part of their SDS product (based on Eclipse/SWT). One of their engineers ported the feature to NetBeans/Swing in short order by using Matisse.
The test agent is implemented in the SipAgent module/plugin.
The agent allows users to interact with an application deployed into the SailFin SIP servlet container at the protocol level.
The user can open the test agent by clicking on the icon that gets added to Build toolbar...
When the agent opens, the initial screen looks like this:
There are three main areas on this screen. The message creation area in the upper left "third" of the window which is where the user can create a complete message to be sent, by hand. The message history area in the upper right third of the window. The user can select messages that they have sent from the agent and messages that their agent has received. This area also contains some buttons that allow a user to create some "standard" request and/or responses easily. There are shortcuts to send and 'ACK', 'BYE' and 'CANCEL' request. There is also a shortcut that allows the user to send a '200 OK' response. Sending these messages takes two clicks on this main page: the shortcut and the 'Send Message' button in the message creation area. The lower third of the page allows the user to configure where to send SIP protocol messages and where to listen for them.
If the user needs to create a more complicated request, there is a request editor:
This editor appears when a user clicks on the 'New Request...' (from the message creation area) or the 'Request...' button (from the message history area).
If the user needs to create a different response, there is a response editor:
This editor appears when the user clicks on the 'Response...' button from the message history area. Note that when the user deploys a converged servlet application project, the test agent is opened automatically. If there is a web interface that is part of the application, the user can change the project properties to cause a Run to open the browser, too. There are also changes/extensions in the Admin console that ships with builds from Project SailFin:
How do I get started using SailFin?
The server integration code changes are "prebuilt" into NetBeans IDE 6.1.
The modules that support SIP servlet application development and testing
currently ship with builds of SailFin. The modules are located in the
<sailfin-root>/lib/tools/netbeans directory. Users need to install
these modules by using the 'Downloaded' tab of the Plugins dialog. Once
Project SailFin releases its final bits, the modules will be available
from a NetBeans update center "near you".
- Download and install NetBeans IDE 6.1.
- Download and install a recent build from Project SailFin: https://sailfin.dev.java.net/downloads/downloads.html
- Start the IDE.
- Register the installed SailFin default domain.
- Install the NetBeans modules that come with the SailFin bits.
- Create an initial converged servlet project.
- Implement a SIP Servlet that echoes a request in its responses. The code is pretty simple.
- Use 'Run Project' to: deploy the project into your registered sailfin domain; open the test agent configured to send messages a SIP listener @ localhost:5060 [the default value]
- Use the 'New Request...' button to create a request.
- Edit an INVITE request and send it.
And then see what happens!
Also note that there are samples bundled with SailFin that anyone can use to get a feel for things. Our first sample is a Call Setup
application. The steps are explained here! Plus, here is a tech tip that uses the Call Setup sample and explains Sip
Servlets and Converged applications using SailFin.