IBM Books

Host Access Beans for Java


Building Host Access Beans Applets

This section describes some basic guidelines for building a Java program using the Host Access Beans. For information on how to use the Host Access Beans in a JavaBean Visual Development Environment such as Sun's BeanBox or IBM's VisualAge for Java, see Using Host Access Beans in Visual Development Environments.

This section does not cover all the topics necessary to use your Host Access Beans program in a browser. For topics such as security and making classes visible in the browser environment, please see your browser documentation.

Publishing Customized Screens

If you have created customized screens with Screen Customizer, you can display the customized screens with your CustomTerminal bean program. All customized screen files are contained in the custom subdirectory of the directory where Screen Customizer was installed. To use the customized screens, the custom directory and its entire contents must be copied to the same location as your CustomTerminal bean program.

Source Code Preparation

Java programs that use the Host Access Beans must import the Host Access Beans packages to obtain class definitions and other compile-time information. The Host Access Beans packages can be imported into a Java source file using the following statements:

import com.ibm.eNetwork.beans.HOD.*;
import com.ibm.eNetwork.beans.HOD.event.*; 

For Screen customizer, you should import the following two packages:

import com.ibm.hi.customizer.beans.*;
import com.ibm.hi.customizer.beans.event.*; 

Some Host Access Beans methods require use of Host Access Class Library (HACL) constants. To use the HACL classes, Java programs must import the Host Access Class Library package by using the following statement:

import com.ibm.eNetwork.ECL.*;

Jar and Classpath Considerations

Host Access Beans files are located in the install_dir\toolkit\jars directory, where install_dir is the directory where you installed the Host Access Toolkit files. Both Java 1 and Java 2 environments are supported.  Java archive (JAR) and cabinet (CAB) files for the Java 1 environment and JAR files for the Java 2 environment are located in the following directories: 

where install_dir is the directory into which the Toolkit files are installed (by default, C:\Program Files\IBM\Host Access Toolkit). The following  files contain full Host Access Beans and Screen Customizer support (except for a few noted exceptions):

These files are suitable for Bean Builder environments and for writing Java applications. However, since they are not signed, they are not suitable for downloading over the web through a web browser.

For downloading applets, the Host Access Beans support has been divided into several smaller signed component archive files. JAR files are provided for Netscape and Appletviewer environments and browsers that support a Java 2 plug-in.  CAB files are provided for Microsoft Internet Explorer environments. Since download delays are important in web browser environments, the component archive files will allow users to specifiy only those components which will actually be used and will avoid costly delays of downloading support that will never be used.

To further optimize download times, release versions of the components are also provided. The release versions of the components have the trace code removed which means they will be smaller and download faster than their debug counterparts. Most users will predominantly use the release versions of the components for web environments and only use the debug versions when problem determination is required. For Java application environments, users can use either release or debug components (or even the habeans.jar file) since download times are not a factor.

Most components have debug and release versions, stored in subdirectories of the same name. However, some components, such as host code pages, only have a release version. Except for the host code page archives, you cannot mix some release versions and some debug versions. If problem determination is needed, or you are using debug components since download times are not important, you must use all debug components.

The table shown below shows all the different components, their release and debug names, and the components that they depend on.

Note: Except for hafntib, hafntap, hafnthe, hafntar, and the host code pages, the Java 2 versions of these components have a "2" on the end of the JAR file name (for example, habase2 and habasen2).

Function

Release Name

Debug Name

Dependency (Release Name)

Support Included in habeans.jar

Base function

habasen

habase

-

Yes

Printer base

haprintn

haprint

-

Yes

3270 terminal support

ha3270n

ha3270

 

Yes

3270 Bidi terminal support

ha3270bn

ha3270b

ha3270n, habidin

Yes

3270 Thai terminal support

ha3270tn

ha3270t

ha3270n, hathain

Yes

3270 host print support

ha3270pn

ha3270p

ha3270n

Yes

3270 hostgraphics support

hahostgn

hahostg

ha3270n

No

5250 terminal support

ha5250n

ha5250

-

Yes

5250 Bidi terminal support

ha5250bn

ha5250b

ha5250n, habidin

Yes

5250 Thai terminal support

ha5250tn

ha5250t

ha5250n, hathain

Yes

5250 Hindi terminal support

ha5250hn

ha5250h

ha5250n, hahindin

Yes

5250 ENPTUI support

ha5250en

ha5250e

ha5250n

Yes

5250 host print support

ha5250pn

ha5250p

ha5250n

Yes

CICS terminal support

hacicsn

hacics

ha3270n

Yes

VT terminal support

havtn

havt

 

Yes

VT Bidi terminal support

havtbn

havtb

havtn, habidin

Yes

VT Thai terminal support

havtthn

havtt

havtn, hathain

Yes

Thai support

hathain

hathai

-

Yes

Hindi support

hahindin

hahindi

 

Yes

Double byte (DBCS) support

hadbcsn

hadbcs

 

Yes

Secure Sockets Layer (SSL) support

hassln

hassl

 

Yes

SSL Client Authentication

hacltaun

hacltau

hassl

No

Service Location Protocol (SLP) support

haslpn

haslp

 

No

Macro Runtime Support

hamacrtn

hamacrt

 

Yes

File Transfer support

haxfern

haxfer

hamacrtn

Yes

3270 File Transfer support

ha3270xn

ha3270x

ha3270n, haxfern, hamacrtn

Yes

5250 File Transfer support

ha5250xn

ha5250x

ha5250n, haxfern, hamacrtn

No

IBM Trace Facility support

-

hatrace

 

No

License Use Management

halumn

halum

 

No

APL fonts

(habeansnlv)

hafntap

 

No

IBM3270 fonts

(habeansnlv)

hafntib

 

No

Arabic fonts

(habeansnlv)

hafntar

 

No

Hebrew fonts

(habeansnlv)

hafnthe

 

No

Thai fonts

(habeansnlv)

hafntth

 

No

The following table shows the component names for the host code pages:

Host Code Pages

Name

Base

hacp

Arabic

hacpar

Latin1a (de, es, fr, it, pt)

hacp1a

Latin1b (other locales)

hacp1b

Russian

hacpru

Turkish

hacptr

Latin2 (Central European)

hacpce

Japanese

hacpja

Korean

hacpko

Chinese

hacpzh

Chinese (Traditional)

hacpzhtw

Hebrew

hacphe

Thai

hacpth

Greek

hacpgr

Hindi

hacphi

All applications will use the habase (or habeans) and hacp archive files since those contain the core Host Access Beans files and core codepage files respectively.

To successfully compile and run your application, the CLASSPATH environment variable must be updated to include the JAR files needed by your application. For example, if you need 5250 file transfer, you would need to include ha5250xn.jar, ha5250n.jar, haxfern.jar, and hamacrtn.jar in your CLASSPATH. You can also set the classpath using the Java compiler's -classpath parameter when compiling your application.

To find the Host Access Beans classes in the jar file, the classpath variable (or -classpath parameter) must point directly to the jar files. For example, if your application uses 3270 and SSL functions, and the JAR files are located in the c:\jars directory, the classpath should look like this:

CLASSPATH=c:\jars\habasen.jar;c:\jars\hacp.jar;c:\jars\ha3270n.jar;
          c:\jars\hassln.jar

Note:  In Personal Communications, there is only one JAR file, pcseclj.jar. The JAR file is located in the Personal Communications installation directory, usually C:\Program Files\IBM\Personal Communications. This JAR file is equivalent to habeansnlv.jar. Most of the other support functions are available using the appropriate session configuration parameters in Personal Communications.

Executing

When an applet that uses the Host Access Beans is run in a browser environment, the browser must be able to find the Host Access Beans classes. See your browser documentation for information on how to expose classes in the browser environment.

When running an applet using the appletviewer or running your program as an application, you need to make sure the CLASSPATH environment variable contains the fully qualified path name of the Host Access Beans JAR files used.

Loadable Applet Interface

Optionally, you can use the loadable applet interface (com.ibm.eNetwork.HOD.common.cached.LoadableAppletInterface) to have the Host On-Demand server manage the caching of Host On-Demand libraries. A custom application that implements this interface and is launched via a customized Deployment Wizard-derived HTML page can have the server manage how the required Host On-Demand libraries are cached. In contrast, the custom application libraries themselves are always downloaded and temporarily cached in the browser. For more information, see Appendix B, Using the Loadable Applet Interface.


[ Top of Page | Previous Page | Next Page | Table of Contents ]