Accessibility
Icon or Spacer
   

ColdFusion/JRun Connectivity

By: Brian Surkan
Product Manager, Allaire, Inc.

Introduction

The JRun 3.0 Server offers a number of key services of which ColdFusion applications can take advantage. ColdFusion integrates with JRun on multiple levels, ranging from the ability to call servlets to Enterprise JavaBeans (EJB) client support.

HTTP Integration

HTTP GET and POST Connectivity

At a fundamental level, ColdFusion and JRun can be integrated over standard HTTP in a manner similar to any other application server integration. Both JRun and ColdFusion are able to retrieve request parameters appended to a standard URL via the "GET" method. In addition, they can both read request parameters encoded into a standard HTTP request header by using the "POST" method. All HTTP request parameters can be used interchangeably between servers.

Interoperability at this level leverages fundamental HTTP connectivity and may require some coordination on shared variable references and session identification between the two servers involved. This is a very simple integration with minimal direct coordination between the two servers.

XML Connectivity

Both ColdFusion and JRun provide support for generic eXtensible Markup Language (XML) parsing and generation, as well as support for Allaire's Web Distributed Data Exchange (WDDX), an XML format designed for ease of use in cross-server interoperability.

The WDDX standard uses XML as a data encoding and transmission format for complex data structures. A filter is used on both sending and receiving ends of the transmission to convert to/from the WDDX XML format and the native data structure format of choice. Converters are freely available from www.wddx.org for download and use without licensing constraints for the following languages:

  • ColdFusion (built in, no download required)
  • COM (Visual Basic/Active Server Pages)
  • Java
  • JavaScript
  • PHP

Support for arbitrary XML packet sharing between servers is also supported by virtue of the XML parser included with ColdFusion 4.5.1. It allows users of ColdFusion to parse any generic XML packet. The same parsers are also available for JRun from IBM's Web site. By using XML as an intermediary, applications can syndicate and/or transmit information through firewalls over HTTP to virtually any other type of server.

Integration over HTTP is largely passive, allowing information to be passed from one page request to another. This addresses a number of integration needs but does not fully address the need for more intimate component interactions. In situations where modular Java components or shared business logic access is desired, direct, interactive access to such shared components can be a more appropriate solution. Remote Method Invocation (RMI) addresses this need by allowing ColdFusion applications to invoke objects and methods directly in Java.

Remote Method Invocation (RMI) Integration

JSP/Servlet Connectivity

JRun provides full support for JavaServer Pages (JSPs) and servlets, with JSPs being autocompiled into standard servlets. ColdFusion applications can integrate with servlets (including compiled JSPs) via the CFSERVLET tag included in the ColdFusion 4.5 Server. This tag provides a streamlined interface for servlet invocation, including the sending of serialized complex data structures to the servlet.

EJB/Java Object Connectivity

ColdFusion 4.5 added support for Java objects, including EJB, arbitrary Java classes, and JavaBeans. This Java interface allows for both the instantiation and manipulation of any arbitrary Java class with ColdFusion as the RMI client to the class.

EJB connectivity is particularly interesting for the purpose of creating multitier Web applications involving a transactable object middle tier made up of session or entity EJBs.

Java Custom Tag Connectivity

In the ColdFusion 4.5.1 release, the API for integrating custom tags written in C into ColdFusion applications was extended to support custom tags written in Java. This allows users to leverage the Java-based extensions transparently from ColdFusion applications.

Conclusion

ColdFusion and JRun can be used as independent application servers or in tandem as a hybrid solution that leverages the relative strengths of each server. Integration also enables modular application development across Allaire application server offerings and encourages the server-independent consolidation of business logic.

Allaire has made an ongoing commitment to extend the integration between JRun and ColdFusion. As part of the platform initiative, future versions of ColdFusion and JRun will integrate intimately on the Java platform, with ColdFusion templates compiling natively into Java byte code.

About the Author

Brian Surkan is a product manager in the application servers group at Allaire, stewarding on-going product direction, and day-to-day project-management issues related to application servers. He started at Allaire back in the Spring of 1997 as a database application developer. Brian has a degree in Economics and Computer Science from Carnegie Mellon University, and focuses on economics and philosophy in his spare time.