IBM WebSphere Developer Technical Journal: What is Gluecode? And why?

A view from atop the application server landscape

This article provides an introduction to Gluecode, describes the components that make up Gluecode, and its relationship with IBM® WebSphere® Application Server.

Share:

Introduction

Gluecode can be described as an application server platform that encompasses several open source products and groups them together using a layered architecture, hence the name Gluecode. The heart of Gluecode is Apache Geronimo, an open source Java™ 2 Platform, Enterprise Edition (J2EE) server developed under the Apache Software Foundation, and is itself built upon other open source projects. Gluecode leverages Geronimo's architecture to connect the various open source projects together, and comes configured with a subset of the Geronimo server. Figure 1 shows an outline of the stack of products and components that make up Gluecode Standard Edition.

Figure 1. Gluecode Standard Edition
Figure 1. Gluecode Standard Edition

The version of Geronimo inside Gluecode Standard Edition does not come configured with the full set of services that you can download directly from Apache, yet the architecture is flexible enough so that you can add additional services, if desired. (One has to consider the level of support when adding other open source modules.) When opening the Gluecode administration console (which we will look at shortly), one can see the variety of components that have been integrated by Gluecode (Figure 2).

Figure 2. Gluecode integrated components
Figure 2. Gluecode integrated components

Apache Geronimo

Rather than give an elaborate introduction to Geronimo (there are several excellent resources available, including an Apache Geronimo project resource area in developerWorks), we will look briefly at Geronimo's open source architecture and offer additional resources.

The heart of the Geronimo J2EE server is the Geronimo kernel, which manages various services. Services are represented as Geronimo Beans (or GBeans), and the various different open source projects plug into Geronimo through this mechanism. To illustrate, Figure 2 shows the Geronimo kernel with a few services, such as a Web container. Other services are created dynamically; for example, when an application is deployed, a GBean is created for the application, as well as for the sub-modules in certain situations. The Geronimo configuration lets you to define dependencies between components, as well.

Figure 3. Geronimo kernel
Figure 3. Geronimo kernel

With a full range of function and flexibility, Geronimo can be used with other open source projects to build inexpensive solutions. Implementing Gluecode provides an entry point to higher end implementations that you would consider building with WebSphere Application Server. We will elaborate more on this later. Check the Resources section for detailed information on Geronimo.


ActiveMQ

Another major component of Gluecode Standard Edition is ActiveMQ, a lightweight open source JMS 1.1 provider that offers several functions, including:

  • Transactional messaging: Provides persistence as well as a 1.5 Java connector that becomes a resource in an application server.

  • High performance market data distribution: Provides throughput and routing capabilities.

  • Clustering and general purpose asynchronous messaging: Combined with other open source projects (such as Active Cluster) to provide clustering capabilities.

  • Web steaming of data: Provides real time data in a browser using AJAX.

  • REST API for HTTP access to messaging: Provides HTTP access to the underlying messaging product; REST is an alternative to SOAP over HTTP.

Figure 4. ActiveMQ
Figure 4. ActiveMQ

ActiveMQ supports:

  • JMS 1.1 and can be included inside a J2EE 1.4. Active MA includes a J2C 1.5 resource adaptor to be plugged into a J2EE 1.4 compliant server.

  • Transient, persistent, transactional, and XA messaging.

  • Pluggable transport protocols such as in-VM (within the same JVM), TCP, SSL, NIO, UDP, multicast, JGroups and JXTA transports.

  • Very fast persistence, using JDBC along with a high performance journal. The high performance journal component writes persistent messages as fast as possible to a journal. Through configured intervals, messages are moved from a journal to an underlying JDBC database.

  • High performance clustering, client-server, peer based communication.

  • An implementation of the REST API to provide technology-agnostic and language-neutral Web-based API-to-messaging provider.

  • Embedding real time data in a browser by using Ajax, which provides Web streaming support to Web browsers using pure DHTML, enabling browsers to be part of the messaging fabric.

  • Being used in a J2SE environment for unit testing.

  • Clients written in C, Ruby, Perl, Python, and PHP, using a technology called STOMP (Streaming Text Orientated Messaging Protocol), which is another open source project that provides a messaging protocol for multiple languages.

  • Wildcard support for publish/subscribe JMS applications to subscribe to powerful destination hierarchies.

  • Composite destinations to let many destinations be used in one simple atomic JMS operation. In other words, a single logical destination can represent many physical destinations.

  • A provided implementation of ActiveCluster, a framework for writing cluster-based applications that monitors the available nodes in a cluster and communicates with them. ActiveCluster consists of an API together with a default implementation.

Geronimo comes configured with the ActiveMQ core and J2C adapter for connection into the Geronimo J2EE server, but Gluecode does not include all of the services listed above. Some of these extended features, such as Active Cluster, can be configured separately.


Apache Pluto

Apache Pluto is a reference implementation of the JSR 168 Portlet Specification. A portlet is a Java-based Web component that processes requests and generates dynamic content. The content generated by a portlet is called a fragment, a piece of markup adhering to certain rules. A fragment can be aggregated with other fragments to form a complete document; a portlet's content normally aggregates with the content of other portlets to form the portal page. A portlet container manages a portlet's life cycle and provides a run time environment for portlets implemented according to the portlet API. In this environment, portlets can be instantiated, used, and finally destroyed. The portlet container is not a standalone container like the servlet container; instead, it is implemented as a thin layer on top of the servlet container and reuses the functionality provided by the servlet container.

Pluto serves as a portlet container that implements the portlet API and offers developers a working example platform from which they can test their portlets. However, it is cumbersome to execute and test the portlet container without a driver (in this case, the portal). Pluto's simple portal component is built only on the portlet container and the JSR 168 requirements.

Gluecode includes the Apache Pluto Portlet Container to support the JSR168 portlets used in the Gluecode console. Developers can develop JSR 168 compliant portlets and deploy them to Gluecode through a manual, file editing procedure for portlet testing; however, they will be part of the console manually deleted. Once tested, the portlets can be deployed to the WebSphere Portal for integration testing.


Apache Derby

Derby is an Apache open source database implemented fully in Java. Some background: Cloudscape®, an Oakland, California start-up, was founded in 1996 to develop Java database technology. The first release of the database engine, then called JBMS, was in 1997. Subsequently, the product was renamed Cloudscape and releases were made about every six months. In 1999, Informix® Software acquired Cloudscape, and in 2001, IBM acquired the database assets of Informix, including Cloudscape. The database engine was rebranded as IBM Cloudscape and releases continued, mainly focusing on its embedded use with IBM's middleware. In August 2004, IBM contributed the code to the Apache Software Foundation as Derby, an incubator project sponsored by the Apache DB project. In July 2005, Derby graduated from the incubator into the Apache DB project.


Other Apache libraries

Gluecode Standard Edition comes with many third party Apache libraries either directly or through its inclusion of the Geronimo J2EE server. Here are some of the different libraries that ship with Gluecode Standard Edition:

  • The Jasper Compiler from Tomcat is used as the Gluecode JSP compiler. The JSP compiler creates servlet (or servlet-like classes) from existing JSPs.

  • HOWL is an Apache component used for transaction logging and recovery.

  • Several of the "commons" libraries from Apache are available, such as the JSTL expression language tools and collection libraries.

  • Castor and XMLBeans are available as a Java XML binding tool.

  • Other libraries that enable streaming, concurrency, and more are also available as well. You can view the libraries available through the Repository View in the Gluecode administration console.

Even more libraries can be added to Gluecode, such as Apache Axis for adding Web services.


Gluecode centralized console

Gluecode Standard Edition comes configured with its own centralized administrative console that enables you to perform a wide range of admin functions, as shown on the main menu in Figure 5.

Figure 5. Gluecode main menu
Figure 5. Gluecode main menu

Most of the console artifacts are actually JSR 168 portlets. The console provides these pages for performing admin tasks:

  • Server Info: View different aspects of the running server, such as JVM properties and classpath information.

  • Server Management: Shutdown the server from the console.

  • Logs: manage the logging levels of Gluecode, and view logs from various components within Gluecode.

  • Applications: Install and manage applications. Applications require deployment plans, which are either packaged with the WAR file in the WEB-INF directory or kept in a separate file and provided to the deployment tool. Deployment plans are XML files used in Gluecode Standard Edition to configure services, resources, and applications. The basic information in a deployment plan includes the name for the startup configuration and its parent, service-specific information (such as the port number for the Web container), and the server resources, which map to the resource references listed declared in application modules. Deployment plans can also be packaged with the application EAR file. If packaged in the application EAR, the file is placed in the META-INF directory in a file called geronimo-application.xml.

  • Repository: View and install third party JAR files.

    Figure 6. Gluecode repository page
    Figure 6. Gluecode repository page
  • Databases: Manage and add JDBC data sources.

  • JMS: Add and manage JMS artifacts to the Gluecode server (ActiveMQ), such as JMS connection factory and JMS destinations (queues and topics).

  • Security: Add users and groups to application and console realms. (See Gluecode security.)

  • Web server: View and configure HTTP and HTTPS connections for the Jetty Web container. You can also collect statistics for HTTP connections.

  • Certificates: Import and view security certificates. (See Gluecode security.)

  • Mail: View, update, and test mail communication with a mail server. Gluecode Standard Edition uses the JavaMail API as a framework to build Java-based e-mail clients.

  • Internal DB: View details of the internal Derby database. You can also actually execute and test SQL queries through the console as well.

    Figure 7. Gluecode repository page
    Figure 7. Gluecode repository page

Gluecode security

Gluecode uses security realms that are built around the Java Authentication and Authorization Service (JAAS). By default, there are default realms configured, one for the console, and another for applications. The default realm is a property file realm, as well as a realm for Derby, but you can configure the LDAP as a security realm.

Gluecode ships with a login module for LDAP that can be configured against LDAP servers for a more robust security implementation. Applications can then programmatically authenticate using JAAS. In addition, security can be added to Web components declaratively or programmatically. The declarative method involves adding security constraints through the web.xml file and through the application server-specific deployment files. Programmatic security requires Java source code modification.

The key trade-off between the two methods is ease of use versus granularity of control. The declarative method offers ease of use, while the programmatic method provides finer levels of security control with respect to resource authentication and authorization. Developers can also create their own custom SecurityRealm/LoginModule pairs. There is a third method, which can be called semi-custom, where a developer can use the supplied SimpleSecurityRealm class and develop a custom JAAS login module. Multiple security realms can be defined in Gluecode Standard Edition to authenticate and authorize users by providing a set of principals for access control. Principals usually represent a logged-in user and the groups to which that user is assigned. The list of roles provided by an application module is then mapped to users and groups. Typically, authentication implies validating a username and password, although, as mentioned above, Gluecode supports Kerberos authentication with an appropriate login module.

Gluecode Standard Edition servers can be configured to use SSL/HTTPS. This involves:

  • Creating a keystore.
  • Configuring a Jetty connector.
  • Deploying and starting the connector.

Consult Gluecode documentation for details on how to do this.


Gluecode is a look to the future

IBM offers various levels of support for Gluecode Standard Edition and for Apache Geronimo (see Resources). If you add other Apache libraries or services, then you must use the open source community to get support for those services. Gluecode and Geronimo provide many development shops the ability to build applications with basic J2EE needs.

Gluecode can serve as starting point for an application that might later grow to a more robust platform such as WebSphere Application Server. Obviously, WebSphere adds many qualities of service and more enhanced programming models, such as Enterprise JavaBeans (EJB), WebSphere extended programming models, and a full service integration bus for asynchronous and synchronous services. A development project that starts out with Gluecode can move up the stack as the application grows.

Figure 8. Application growth path
Figure 8. Application growth path

The Gluecode messaging platform can be used as a starting point for building larger enterprise service bus (ESB) implementations as well, since messaging is a key requirement for building a larger ESB.

Figure 9. Figure 8. Messaging/ESB growth path
Figure 9. Figure 8. Messaging/ESB growth path

Similarly, Gluecode also offers an effective starting point for portlet and database support.

Figure 10. Portal and database application growth path
Figure 10. Portal and database application growth path

Furthermore, in most enterprises there will usually be a mix of enterprise-class and less critical systems that require integration. Figure 11 shows such an example. Because Gluecode is built on an open J2EE standard, there are a number of ways a Gluecode application can integrate a larger enterprise.

Figure 11. Gluecode in the enterprise
Figure 11. Gluecode in the enterprise

Conclusion

Gluecode Standard Edition lets you to build a low cost solution while leveraging many popular open source products. Gluecode enables J2EE-based Web applications with support for JDBC and JMS, and can also serve as springboard for enterprise-class applications.

Resources

Learn

Get products and technologies

Comments

developerWorks: Sign in

Required fields are indicated with an asterisk (*).


Need an IBM ID?
Forgot your IBM ID?


Forgot your password?
Change your password

By clicking Submit, you agree to the developerWorks terms of use.

 


The first time you sign into developerWorks, a profile is created for you. Information in your profile (your name, country/region, and company name) is displayed to the public and will accompany any content you post, unless you opt to hide your company name. You may update your IBM account at any time.

All information submitted is secure.

Choose your display name



The first time you sign in to developerWorks, a profile is created for you, so you need to choose a display name. Your display name accompanies the content you post on developerWorks.

Please choose a display name between 3-31 characters. Your display name must be unique in the developerWorks community and should not be your email address for privacy reasons.

Required fields are indicated with an asterisk (*).

(Must be between 3 – 31 characters.)

By clicking Submit, you agree to the developerWorks terms of use.

 


All information submitted is secure.

Dig deeper into WebSphere on developerWorks


static.content.url=http://www.ibm.com/developerworks/js/artrating/
SITE_ID=1
Zone=WebSphere, Open source
ArticleID=94277
ArticleTitle=IBM WebSphere Developer Technical Journal: What is Gluecode? And why?
publish-date=09212005