IBM Books

Host Access Class Library for Java


Debugging Host Access Class Library Applets

This section describes the different tools for debugging Host Access Class Library (ECL) applets and how to use them.

Trace facility

ECL incorporates a trace facility which can be activated programmatically by passing specific parameters to the ECLSession constructor. The trace facility provides a user-friendly, windowed interface and allows customizable tracing of the public ECL classes as well as most of the internal classes.

The trace facility supports different trace levels from 1 to 3. Each trace level is cumulative with the previous trace level, with 1 producing the least trace information and 3 producing the most. Trace level 1 generates trace information for method entry and exit, including method parameters and return values. Trace level 2 generates all the trace level 1 information plus some additional information. Trace level 3 generates all the trace level 2 information plus a LOT of additional information, right down to the bytes going through our transport layer to and from the host.

The following sample shows how to construct ECLSession and enable tracing for the ECLPS and DataStream components.

Properties p = new Properties(); p.put(ECLSession.SESSION_HOST, new String("myHost")); p.put(ECLSession.SESSION_TRACE, ECLSession.SESSION_TRACE_PS + " " + ECLSession.SESSION_TRACE_DATASTREAM)); ECLSession s = new ECLSession(p);

ECLSession provides the following constants for the all the traceable components:

Constant Component Traced
SESSION_TRACE_SESSION ECLSession
SESSION_TRACE_PS ECLPS
SESSION_TRACE_FIELDLIST ECLFieldList
SESSION_TRACE_FIELD ECLField
SESSION_TRACE_OIA ECLOIA
SESSION_TRACE_ERR ECLErr
SESSION_TRACE_XFER ECLXfer
SESSION_TRACE_OIA_EVENT ECLOIAEvent
SESSION_TRACE_PS_EVENT ECLPSEvent
SESSION_TRACE_COMM_EVENT ECLCommEvent
SESSION_TRACE_DS Datastream
SESSION_TRACE_TRANSPORT Transport

Presentation Space Debugger

ECL incorporates a presentation space debugger which can be activated programmatically by providing special parameters to the ECLSession constructor. The presentation space debugger provides a windowed interface which can be used to peek at the various planes which comprise the complete presentation space. It has the ability to show the text, field, color, extended field, DBCS, and grid planes.

The presentation space debugger does not allow interaction with presentation space.

The following sample shows how to construct ECLSession and activate the presentation space debugger.

Properties p = new Properties(); p.put(ECLSession.SESSION_HOST, new String("myHost")); p.put(ECLSession.SESSION_PS_DEBUGGER, ""); ECLSession s = new ECLSession(p);


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