Chapter 17. EJB application support 545
In order to support chained Integration Objects, the Host Publisher EJB is
implemented as a stateful session bean, where the life cycle of a Host Publisher
EJB instance corresponds to the processing of an Integration Object chain.
When EJB Access Beans for an Integration Object chain are processed, two EJB
Access Bean properties are used:
hPubAccessHandle
Contains the handle for the Host Publisher EJB instance corresponding to the
Integration Object chain.
hPubLinkKey
Contains the key that represents the connection for the Integration Object
chain.
EJB Access Bean chaining in a Web container
When EJB Access Beans are processed in a Web container, the EJB Access
Bean saves the values of the hPubAccessHandle and hPubLinkKey properties in
the HttpSessionObject associated with the client session. The properties are
retrieved by subsequent EJB Access Beans in processing the Integration Object
chain.
The EJB Access Bean for the first Integration Object in a chain creates an
instance of the Host Publisher EJB. That instance is used for all EJB Access
Beans for the subsequent Integration Objects in the chain. After the processing
of the EJB Access Bean for the last Integration Object in a chain, the Host
Publisher EJB instance corresponding to that Integration Object chain is
removed.
EJB Access Bean chaining outside of a Web container
When EJB Access Beans are processed outside of a Web container (for
example, directly from a Java program), the calling program must retrieve the
values of the hPubAccessHandle and hPubLinkKey properties. The properties
can be retrieved after the EJB Access Bean for the first Integration Object in the
chain has been processed. The calling program must set the two properties for
all subsequent EJB Access Beans in the Integration Object chain before they are
processed.
The procedure to create the Integration Objects is exactly the same. However,
you need to always remember to activate the Create EJB Integration Object
Support option, as illustrated in Figure 17-3 on page 510.