14.4 Deploying application clients
To run a Java-based client/server application, the client application executes in a client container of some kind. You might, for example, use a graphical Swing application that calls EJBs on an appserver. WAS V6 supports the following five types of application client environments:
- J2EE application client This client uses services provided by the J2EE client container.
This client is a Java application program that accesses EJBs, JDBC databases, and JMS queues. The J2EE application client program runs on client machines. This program allows the same Java programming model as other Java programs. However, the J2EE application client depends on the application client run time to configure its execution environment, and it uses the JNDI name space to access resources, the same as you would in a normal server application (like a servlet).
The J2EE application client brings the J2EE programming model to the client, and provides:
J2EE naming (java:comp/env), including EJB references and resource references
The J2EE application client is launched using the launchClient script, which sets up the environment with the necessary classpaths, and so on, for you.
- Thin application client This client does not use services provided by the J2EE client container.
This client provides a lightweight Java client programming model and is best suited for use in situations where a Java client application exists, but the application must be enhanced to make use of EJBs. It can also be used where the client application requires a thinner, more lightweight environment than the one offered by the J2EE application client. The Thin application client includes the IBM JDK. When launching the Thin application client, set up the correct classpaths yourself and make sure that the required libraries for your application and the WebSphere libraries are included.
- Pluggable application client This client does not use services provided by the J2EE Client Container.
This client is similar to the Thin application client, but does not include a JVM. The user is required to provide a JVM. It can also use the Sun JDK instead of the IBM JDK.
- Applet application client In the Applet client model, a Java applet embedded in an HTML document executes in a Web browser. With this type of client, the user accesses an enterprise bean in the appserver through the Java applet in the HTML document.
- ActiveX® to EJB Bridge application client The ActiveX application client allows ActiveX programs to access enterprise beans through a set of ActiveX automation objects. The ActiveX application client uses the Java Native Interface (JNI) architecture to programmatically access the Java virtual machine (JVM) API. Therefore, the JVM code exists in the same process space as the ActiveX application (Visual Basic®, VBScript, or Active Server Pages files) and remains attached to the process until that process terminates.
The capabilities of the different application clients are shown in Table 14-2.
Table 14-2
Available functions J2EE client Thin client Plugg- able client Applet client ActiveX client Provides all the benefits of a J2EE platform. Yes No No No Yes Portable across all J2EE platforms. Yes No No No No Provides the necessary run time support for communication between a client and a server. Yes Yes Yes Yes Yes Supports the use of nicknames in the deployment descriptor files. Yes No No No Yes Supports use of the RMI-IIOP protocol. Yes Yes Yes Yes Yes Browser-based application. No No No Yes No Enables development of client applications that can access enterprise bean references and CORBA object references. Yes Yes Yes Yes Yes Enables the initialization of the client application run time environment. Yes No No No Yes Supports security authentication to enterprise beans. Yes Yes Yes Limited Yes Supports security authentication to local resources. Yes No No No Yes Requires distribution of application to client machines. Yes Yes Yes No Yes Enables access to enterprise beans and other Java classes through Visual Basic, VBScript, and Active Server Pages (ASP) code. No No No No Yes Provides a lightweight client suitable for download. No Yes Yes Yes No Enables access JNDI APIs for enterprise bean resolution. Yes Yes Yes Yes Yes Runs on client machines that use the Sun Java Runtime Environment. No No Yes No No Supports CORBA services (using CORBA services can render the application client code nonportable). Yes No No No No Application client features comparison
Install the application client environments from the WebSphere installation windows by selecting the Launch the installation wizard for WebSphere Application Clients option. The installation package contains the following installable components:
- IBM Java Runtime Environment (JRE™), or an optional full Software Development Kit
- WAS run time for J2EE application client applications, or Thin application client applications
- An ActiveX to EJB Bridge run time for ActiveX to EJB Bridge application client applications (only for Windows)
- IBM plug-in for Java platforms for Applet client applications (Windows only)
The J2EE client is automatically installed as part of a full WebSphere install. In other words, if you will run the client application on a machine that already has WebSphere installed, you do not need to install the WebSphere J2EE client on top.