A Tangled Web

http://blogs.sun.com/mwhite/date/20080709 Wednesday July 09, 2008

Adding new platform support

In light of a couple of recent requests about supporting Open ESB on the WebLogic application server I thought it would be nice to provide some background information on how we have implemented support for various platforms in Open ESB. Last year I wrote a blog entry about our platform support:

http://blogs.sun.com/mwhite/entry/application_server_platform_independence_in

There are some wiki pages for the ports that have been done to other platforms:

http://wiki.open-esb.java.net/Wiki.jsp?page=OpenESBJavaSE

http://wiki.open-esb.java.net/Wiki.jsp?page=OpenESBJBoss

http://wiki.open-esb.java.net/Wiki.jsp?page=OpenESBWebSphere

Now here is some information about the organization of the actual source code. I've used links to the FishEye view of the source files and directories here.

There is an enumerator of platforms (called JBI providers in the code) here:

runtime/base/src/com/sun/jbi/JBIProvider.java

Here is where we keep the interfaces that we provide for platform support:

runtime/base/src/com/sun/jbi/platform

In this directory, PlatformContext.java is the interface that is implemented for each platform. PlatformEventListener.java file is an optional interface that  can provide event support for things like creation of a new instance, creation of a cluster, etc. This is currently used only in the GlassFish implementation.

This is the basic setup / life cycle class for the JBI runtime:

runtime/framework/src/com/sun/jbi/framework/JBIFramework.java

Look in the following directories to see the various platform support code:

GlassFish:  runtime/framework/src/com/sun/jbi/framework/sun

JBoss:  runtime/framework/src/com/sun/jbi/framework/jboss

WebSphere:  runtime/framework/src/com/sun/jbi/framework/websphere

Java SE:  runtime/framework/src/com/sun/jbi/framework/jse

In each of the above directories, there is an implementation of PlatformContext and a subclass of the JBIFramework class, along with any other classes that are
specific to a particular platform.  Also, there is a JBIBootstrap class in each of these directories, which sets up the required class loader hierarchy.

For creating the actual artifacts that comprise the support for a platform, there are Maven poms  for each platform here:

esb-packages/jbise-package

esb-packages/jboss-package

esb-packages/websphere-package

Note that for GlassFish there is not a separate directory here as that is our primary platform.

From some minimal research I did on WebLogic a some time ago, it appeared that WebLogic had a concept of a life cycle module, similar to what GlassFish has. If that is still the case it is probably the most straightforward way to implement an Open ESB environment for WebLogic. JBoss uses a similar approach, with the concept of a life cycle module. However, rather than the life cycle module implementing an interface that is invoked by Java method calls, the life cycle is provided by implementing an MBean interface that has the life cycle operations. For this the JBIFramework class is wrapped inside the MBean that provides the life cycle. In WebSphere, there was no life cycle module support so the Open ESB runtime is wrapped in a servlet - a little funky, but it works.

Comments:

Post a Comment:
  • HTML Syntax: NOT allowed