Let's take a look at some commercial Java deployment solutions. We will focus on three major representative cases of some real-world Java deployment problems.
Sitraka's DeployDirector offers full coverage of all the deployment circuit's stages for Java applications, leaving out only the Software Development Phase. (Sitraka was formerly known as KL Group).
Getting into the deployment lifecycle details, it covers almost all the phases in Figure 2.5 except for a few. The AH On-The-Run Management stage is partially covered, apart from a sound logging system, whereas the Publication Phase is unstructured, making it difficult for third-party Distributors to adopt this deployment solution. Despite these limitations, DeployDirector is currently one of the most complete deployment solutions available for Java.
Its architecture is composed by an AH to be installed on the client platform. It consists of a server-side application that implements the Deployment Server together with a repository facility for the resources to be deployed.
The whole system is Web-centric in that the Deployment Server is implemented though servlets operating with standard Web and application servers such as IBM Websphere, Apache (Tomcat and JServ), and Bea WebLogic. On the client side, the AH works together with an applet, and the Web browser is fully integrated.
The DeployDirector software architecture is built around four main components:
Client Application Manager. The AH being installed on the client platform. JNLP clients are also supported, Web Start included.
Server Application Manager. The server-side software tool for managing the Deployment Servers.
The Vault. The repository for resources to be installed on client platforms. It resides at Deployment Servers.
The Remote Administration Tool. The GUI console is used to set deployment policies, prepare resource descriptions, and manage the other services available to this deployment circuit's implementation.
To the server side, DeployDirector lists many interesting features, including the following:
Deployment Servers' reliability tuning through server redundancy and replication, using the concept of clusters of Deployment Servers.
Deployment Server-Application Helper connection optimized through a fine-grained, byte-level differencing mechanism.
Security. The Deployment Server-Application Helper connection could be secured using SSL. Resources are accessible through a two-step process of authentication and authorization.
A user-friendly GUI that centralizes the management of all deployment policies, software publications, and management data for the administrator (on Deployment Servers).
A high level of customization, provided to developers by means of a pluggable class architecture.
On-The-Run-Management services such as an extensive logging service of client operations on Deployment Servers.
On the client side, other remarkable features are as follows:
Multiple JRE management. This allows the central organization of JREs, locally managed by the AH.
There are three different possibilities for Deployment Policies regarding the strategy of updates. Updates can be mandatory at application launch, user-requested, or automatic.
Highly customizable, both in technical settings (proxy settings, for example) and in user interface.
Also to consider is the very good quality and availability of technical documentation.
Several missing features are as follows:
As said before, the role of the Distributor is not general enough to be performed by third-party organizations taking advantage of this software. This tool has been provided mainly for in-house deployment; that is, for companies that produce, deploy, and use their own software.
Little details (as of version 1.3) such as a difficult management of standard JRE distributions, a not-so-finely-grained JRE version definition, and so on.
Finally, some stages are partially covered, as mentioned before. The only additional service beyond standard deployment services is a logging system that can be used for statistics, properties inspection, and other management operations. Also, publication features are a bit too coarse, especially for complex product lines.
The power of the addressable Deployment Policies comprises update strategies, per-user policies, connection options, and so on. A quite rich set of policies, though with only a few possible values, is available that covers all the more useful cases.
DeployDirector is a complete new-generation deployment solution that addresses the needs of organizations using Java software and necessitating sophisticated control on their own produced Java software.
DeployDirector Bundler for JNLP
A related utility is offered by Sitraka, mimicking its more sophisticated DeployDirector's GUI for visually creating a JNLP file for deploying Java code by means of the Java Network Launching Protocol.
InstallShield Java Edition
Having seen the importance of installer utilities, it is time to cover one of them practically. We mention InstallShield Java Edition here simply because it is an installer utility written in Java. Figure 2.6 demonstrated the particular case of our reference abstract deployment model adapted to installer utilities. It is time to see concretely what this class of products (listing, among others, Denova's JExpress, InstallAnywhere, and so on) offers to Java developers.
First of all, the fact that it is written in Java doesn't necessarily mean it will run on all the Java-supported platforms. Indeed, as of version 3.5, it is restricted to just a few: namely, Windows, Solaris and Linux (Red Hat 6.2). It provides the following features:
JNLP-compliant, so Web Start can be used for launching the deployed applications.
Support for native libraries taking advantage of the Java Native Interface (JNI).
JRE bundling, for installing the JRE when there are no pre-existing JREs locally installed.
Final format options. The installer can be obtained as a Java class file, Java applet, ".exe" executable on a Windows platform; or as shell scripts for Solaris and Linux installations.
For a general discussion of this kind of technology, see the discussions in the previous chapters.
Java Deployment for Existing Solutions
Java and the Internet took existing software solutions by storm, too. It would be too lengthy even to mention the many Java-extensions available on the market for the various software appliances. Instead, we will focus on what Java implied for the deployment of database products. We will examine Oracle's Forms solution, just to select one, but all the major DB vendors provide similar competitive solutions as well.
The following case is representative of a certain class of "shallow-enabled" client porting of the Java technology that prevailed as one of the main usages of the applet technology in enterprise client applications.
Oracle's Forms Server
Java can be useful as a thin client in order to integrate server-side established technologies such as the Oracle database application. This is done using the Forms Server architecture via applets running in a common Web browser.
This technology includes a browser plug-in (much the same as the Sun's Plug-In technology) called JInitiator, It offers more up-to-date JRE environments on the client platform where the Oracle applets are run.
This is a typical example of a certain use of the Java technology that is very common when server-side established solutions need to be ported to the Web. Despite the fact that JInitiator and the Forms Server technology can be run from the Internet, their most common use is in corporate intranetsto access centralized data stored in Oracle server databases. Here, we are interested in showing the client-side deployment aspects of this and similar technologies.
In this case, anyway, Java technology has been used as a mere thin client; few of the very valuable features of the Java platform have been exploited. Nevertheless, this approach works, allowing Web browser clients to be able to execute quite sophisticated transactions. The AH installation costs, anyway, are the same as the Sun Plug-In discussed in Chapter 2.
When facing concrete deployment of Java software complexity-compatibility trade-offs, engineers have often given up the purity of the Java platform as such, favoring a better compatibility with the underlying platform, as we will discuss in the next section.
Nailing Down Java
When dealing with the deployment of Java executables today, few environments support natively up-to-date JREs. Anyway, there is always the other way around. That is, instead of carrying an interpreter to the place you need to run your classes, you can always package your bytecode in something native. In this way, Java is considered to be an intermediate language, from which you could create platform-dependent executables. Also common is an intermediate solution, consisting only of packaging the Java executables in a platform-dependent way. We will see a case of both these approaches in a moment.
Because this technical solution is related to the various platforms, we describe it here in this chapter. It is, of course, not a proper solution, in that you probably lose the best features of the Java platform. Nevertheless, it is a technique for deploying Java code to client platforms, so we will have a look at some related products, just to explore this alternative, too.
There are tools such as these for all the major platforms. We will refer to just two of them: a utility for the Mac and another one for the Windows platform to complete the picture.
JBindery is a packager utility for integrating Java software into the Mac OS. It is a deployment technology in that it enables Java software to be packaged and executed only on a given platform: the Mac OS. Indeed, there are often cases when an application is required to access platform-dependent features or to wrap developed applications in a more system-integrated way so that the end-user will find it more usable. JBindery is able to package Java classes and JAR files in a Mac-like appearance with many possible features, as follows:
Adding a Mac Virtual File System to the Java application. This typical Mac feature permits the bundling of many different files together into one, such as the bundling of an HTML page together with all its images, applets, and so on into a file shown by the Mac OS as a unique HTML file.
Specifying all Java-related information, such as the classpath, standard output, main class, execution parameters, and other various properties to be added to the Java environment, and so on.
Security issues. It is possible, for instance, to modify the -verify/-verifyremote command-line switches for the JVM, or modify OS' settings for the firewall, HTTP proxy, and so on.
JBindery can work as a launcher only to launch the Java class on the Mac OS without packaging it.
PLC's JOVE is a translator of bytecode that essentially transforms your Java executable into native Wintel code. To do so, it adds a little runtime support to the package, together with the translated program to be executed natively by the runtime support. In the translation and packaging support, the code is optimized to additionally enhance the performance. The outcome is a single platform-dependent executable. This solution is quite different from the other packager utilities, in that it translates the code, too, changing it deeply. The advantage is fast performance, but there are also drawbacks, such as limitations in supporting all Java bytecode instructions. For example, dynamic loading of classes is not supported. Before translating a Java executable this way, you have to run a verifier utility to see if the program can be translated into native code with this technology.
Other Java Deployment Means
In this section, we examine other interesting Java technologies related to deployment.
Defining mobile agent software is not simple; there are many slightly different definitions, and the whole topic is still evolving as an experimental technology. To shed some light on this promising Java phenomenon we will introduce it briefly here, and we will mention one product.
Briefly, we can say that a mobile agent is software that is
goal-driven, or as they like to say, proactive.
autonomous. It can be left working on its own, reacting to changes and events from outside.
able to communicate with other agents.
mobile. It can move from one host computer to another one.
adaptive. It can adapt its behavior based on its own past experience.
Given these properties, and the fact that mobile agents are designed for the Internet age, it is clear that they deal with the software deployment issue. Particularly, we are interested in the word mobile, which is the capability that this kind of technology has to transfer itself and operate on platforms different from the original one.
Given these definitions, it is clear that Java is the perfect implementer's choice. Java is platform-independent, so what could be better suited in moving from one host to another? Next, it can make use of many handy features, such as dynamic class loading, reflection, and so on. But what is more important is its intrinsic security, so that remote hosts can receive mobile agents without fear of malicious behavior.
We will examine the Aglet case, developed by IBM and available from their Web site. As the terms indicate, Aglets are thought of as a mix between the applet concept and that of a mobile agent, as described before. We can think of Aglets as mobile applets that have a well-defined lifecycle that involves their own deployment to Aglet-enabled hosts spread over the network. Aglets can move themselves from one host to another one, or they can be taken from somebody outside them. Aglets interact through the use of messages, both synchronously and asynchronously. The Aglet model uses the context concept. Contexts remain permanently on the host where they were created; aglets travel from one context to another.
The Aglet lifecycle comprises events for each stage that allow developers to plug into their own event-listener classes and to take advantage of the Java class framework implementing the Aglet concept, together with the other classes that loosely resemble the Applet-related classes.
Let's have a closer look at what we are interested in: the Aglet deployment process.
Aglets are transferred from one context to another by means of an Aglet Transfer Protocol (ATP) that conceptually performs the following operations:
The Aglet is serialized.
The serialized Aglet and its bytecode classes are physically transferred to the destination context.
The two byte streams are reconstructed at the destination host site.
The Aglet is brought to life again, by launching its bytecode classes and restoring its previous state.
All this is obtained with a single method, belonging to the Aglet class:
Note that here the proposed deployment process has an important property: It preserves the state of the object being deployed. That is important. We basically deployed classes, in Chapter 2 and throughout this book, with few exceptions. Of course, our model makes provisions for customizing the classes once deployed on the client platform, but it doesn't provide such a feature.
There is currently a lot of work going on with mobile agents totally implemented in Java, and the prospects seem quite promising for real-world, sophisticated applications.
TowerJ technology is an original approach that deserves a brief mention here. It is aimed at back-end, high-performance servers that run Java code (J2EE mostly), in which the powerful computing environment allows for more sophisticated technologies while still running usual Java code when needed, or using specially-compiled native executables that permit high performance on mission-critical servers. The main piece of the architecture, apart from the compiler technology, is its special JRE environment, capable of running Java code in the so-called "mix-mode."