The EJB event sample program

Actions of the default program

The default implementation of DFHEJEP is provided to support the RM for enterprise beans. It is intended to be installed in CICS® regions that are used for application development. We recommend that you install the default program in your development regions.

The default program records useful EJB events in a file named DFHADEM. It records only a subset of all possible EJB events--only the ones that may help an application developer determine why there is a problem with a DJAR. Because CICS categorizes each EJB event in one of three types (informational, warning, or error), DFHEJEP can discard whole groups of uninteresting events by checking for a single value in the communications area.

Your application developers can use the RM for enterprise beans to query the contents of DFHADEM. This enables them to check the outcome of DJAR requests and the status of DJAR resources in the region.

Before recording any events, the default program determines (by checking for the existence of file DFHADEM) whether the RM for enterprise beans is being used in the region; if it is not, the default program records no events and ends. This means that there is no processing overhead in a production region, in which the RM for enterprise beans would not normally be used.

Writing your own EJB event program

You can write your own EJB event program in any of the languages supported by CICS. The default EJB event program is a C language program named DFHEJEP. The source of the default program is provided in C. The corresponding copy book that defines the communications area is provided in assembler-language, C, COBOL, and PL/I. The names of the supplied source programs and copy books, and the CICSTS31.CICS libraries in which they can be found, are summarized in Table 36.

Table 36. EJB event programs and copy books
Language Member name Library
Programs:
 
C
 
 
DFHEJEP
 
 
SDFHC370
Copy books:
 
Assembler
C
COBOL
PL/I
 
 
DFHEJEPD
DFHEJEPH
DFHEJEPO
DFHEJEPL
 
 
SDFHMAC
SDFHC370
SDFHCOB
SDFHPL1

You can use the supplied program as the basis of your own EJB event program. Your program could, for example, use different criteria than the default program to filter the EJB events passed to it; or send the filtered events to a different destination.

An implementation of DFHEJEP does not have to be particularly efficient, because none of the EJB events for which DFHEJEP is driven occur during the execution of normal EJB method calls.

Related concepts
Overview of the EJB event program
Related reference
The DFHEJEP communications area
Event codes
[[ Contents Previous Page | Next Page Index ]]