Server Access for EJB support for EJB technology

In support of the Enterprise JavaBeans specification 1.1, IBM provides WebSphere InterChange Server Access for Enterprise JavaBeans (EJB). With this product, you create a session bean called a WebSphere Access EJB (often called just an Access EJB). This session bean enables J2EE client components to access to WebSphere InterChange Server (ICS). InterChange Server is the component of the WebSphere business integration system that provides the ability to maintain business processes that involve multiple EISs.

Note:
For an overview of the features and capabilities of the WebSphere business integration system, see the Technical Introduction to IBM WebSphere InterChange Server.
The WebSphere Access EJB brings the following benefits to client components in a J2EE application:

Figure 6 shows the support WebSphere business integration system provides for the middle tier of an N-tier architecture (shown in Figure 2).

Figure 6. WebSphere business integration system role in N-tier architecture

The figure shows the middle-tier support that WebSphere business integration system provides in an N-tier architecture. The figure shows a flow chart of N-tier architecture. There are 3 labelled tiers, from top to bottom: Client tier, Middle tier and Server tier. The Client tier has 2 nodes: Java client and Servlet or other web-based client. These 2 nodes flow into the Middle tier where the application server resides, within which are various IBM WebSphere Access EJB instances. Each of these instances flows into the Server tier into one of several IBM WebSphere InterChange Servers (multiple EJB instances can pass into the same server, and EJB instances can pass to more than 1 server), from which the IBM WebSphere Integration Adapters are invoked (one for each server) and lastly passed on to the EIS application.

As Figure 6 shows, WebSphere business integration system provides the following components for middle-tier support:

Certified application servers

WebSphere business integration system has certified WebSphere Application Server, Version 4.0 Advanced Edition as an application server for use with a WebSphere Access EJB.

Note:
A WebSphere Access EJB works with any J2EE application server that supports the Enterprise JavaBeans specification 1.1.

This application server provides basic resource-allocation services to enterprise beans that access EISs. For a WebSphere Access EJB, each application server provides support for the middleware services summarized in Table 3.

Table 3. Middleware services that support a WebSphere Access EJB

Middleware service WebSphere business integration system support
Connection management Yes
Security management Minimum
Transaction management

No

However, you can achieve some transaction management through the use of transactional collaborations. For more information, see the Collaboration Development Guide.

WebSphere Application Server, Version 4.0 Advanced Edition provides support for the following:

IBM WebSphere Access EJB

A WebSphere Access EJB enables a client component to access and use IBM WebSphere Business Integration Collaborations and other services. Collaborations represent business processes, which can involve multiple EISs. The WebSphere business integration system solution initiates execution of a collaboration at the request of the Access EJB. The Access EJB sends data that represents the triggering event of a collaboration to the WebSphere business integration system solution, which in turn sends it to an ICS instance. Because these solutions are external to the WebSphere business integration system, their request for collaboration execution initiates a call-triggered flow. By requesting execution of collaborations, Access EJBs can send and receive information in the ICS-managed EISs.

To communicate with an ICS-managed EIS, a J2EE client component sends a request to a WebSphere Access EJB, which communicates with ICS to initiate the request. ICS handles any communication with ICS-managed EISs by controlling execution of the collaboration. To provide this communication, the IBM WebSphere Server Access for EJB product includes the following components:

The client component and Access EJB

The WebSphere Access EJB session bean encapsulates the operation of collaboration execution, thereby hiding from the client component the details of initiating and subsequently communicating with InterChange Server. This session bean is stateless; that is, it does not support exchange of information between the methods of the session bean. However, because an Access EJB instance is stateless, all instances are equivalent. Therefore, the EJB container can access the instances interchangeably and can delegate the client requests to any available instance.

Server Access for EJB provides the following elements to an application server for the Access EJB's deployment within an EJB container:

Each of these pieces is described in more detail in the following sections.

Home and remote interfaces

A client component communicates with a WebSphere Access EJB through the methods of its home and remote interfaces. Server Access for EJB provides the definitions of these two interfaces, while the deployment tools of the application server generate their implementations (see Figure 4).

Home interface

The home interface of the Access EJB provides a J2EE client component with the methods it needs to control the life cycle of the bean. Therefore, Server Access for EJB provides a Java class file that contains the definition of the Access EJB home interface, including the definitions for the following interface methods:

Remote interface

The remote interface of the Access EJB provides a J2EE client component with the methods it needs to execute the EJB's business methods. Therefore, Server Access for EJB provides a Java class file that contains the definition of the Access EJB remote interface. This remote interface provides the executeCollaborationExtended() and executeCollaborationExtendedWithLocale() methods.

Note:
The signature of the executeCollaborationExtended() and executeCollaborationExtendedWithLocale() methods in the remote interface's definition matches the signature of its implementation in the Server Access for EJB's implementation of the SessionBean interface.

For more information, see Sending data to an ICS-managed EIS.

SessionBean class

To implement the Access EJB, Server Access for EJB extends the SessionBean interface of the javax.ejb package to provide a Java class that implements the SessionBean interface. The methods in SessionBean use IBM WebSphere InterChange Server Access to communicate directly with InterChange Server. By isolating the Server Access Interface calls to the session bean, neither client components nor the application server need to know this API. Instead, the client component uses calls in the Access EJB home and remote interfaces to request ICS services.

Figure 8 shows the WebSphere business integration system implementation of the EJB Architecture.

Figure 8. IBM WebSphere Access EJB communication to ICS

The figure shows a schematic of the implementation of EJB architecture with WebSphere business integration system. On the left of the image is a large square labelled "Application server", inside this square is a smaller square labelled "EJB container ", inside this is a smaller square labelled "WebSphere Access EJB" which contains 2 cells called: "InterChange ServerAccess Interface" and SessionBean implementation". An arrow, labelled "CORBA-IIOP" leads from the "InterChange Server Access interface (server-side)" which is one of three cells in the main square on the right side of the image which is in turn labelled "WebSphere InterChange Server". The other two cells in this square are labelled "Collaboration" and "Data handler instance", both of which are connected to the "InterChange Server Access interface (server-side)" cell by double-headed arrows. From the main WebSphere InterChange Server square an arrow flows to a cell labelled "WebSphere Business Integration Adapter" and from there to a cell labelled "EIS application".

This SessionBean class contains the implementations of the following methods:

Create method of the session bean

server Access for EJB's SessionBean class contains the implementation of the single create method of an Access EJB. Within SessionBean, this create method is called ejbCreate(). The ejbCreate() method contains the bean-specific implementation of the home interface's create() method; it performs the necessary calls to InterChange Server Access to obtain a connection with InterChange Server. The EJB container includes a call to ejbCreate() in its implementation of create().

Note:
The signature of ejbCreate() in the SessionBean class matches the signature of create() in the definition of the WebSphere Access EJB home interface. It is create() that is surfaced to client components.

For more information, see Creating a session object.

Business method of the session bean

Server Access for EJB's SessionBean class contains the implementation of the business methods of the Access EJB, executeCollaborationExtended() and executeCollaborationExtendedWithLocale(). These business methods enable execution of IBM WebSphere Business Integration Collaborations by client components. They performs the necessary calls to the InterChange Server Access to initiate the execution of a specified collaboration within a specified ICS instance. Upon successful execution of the methods, the Access EJB returns the data in the format that the client has requested.

Note:
The signature of the executeCollaborationExtended() and executeCollaborationExtendedWithLocale() methods in the SessionBean class matches the signature in the WebSphere Access EJB remote interface's definition.

For more information, see Sending data to an ICS-managed EIS.

Standard interface methods

Server Access for EJB's SessionBean class contains implementations of the other required methods in the SessionBean interface. Table 4 summarizes these standard SessionBean methods.

Table 4. Other standard methods in SessionBean interface

SessionBean method Description
ejbActivate()
Because the Access EJB is a stateless session bean, this method is not implemented.
ejbPassivate()
Because the Access EJB is a stateless session bean, this method is not implemented.
ejbRemove()


Contains the bean-specific implementation of the remove() method in the home interface; it performs the necessary cleanup activities before the bean instance is removed. The EJB container includes a call to ejbRemove() in its implementation of remove().
setSessionContext()


Called by the EJB container to associate a bean with a specific session context. A session context is a bean's mechanism for interacting with a container, including obtaining environmental, transactional and security-related information.

Deployment descriptor

Server Access for EJB provides a customized EJB deployment descriptor (ejb-jar.xml) for a WebSphere Access EJB to be deployed within the EJB container. At deployment, the EJB container generates implementations for both the home and remote interfaces of the Access EJB using information in this deployment descriptor. The container also obtains other information from this deployment descriptor. This ejb-jar.xml deployment descriptor is consistent with the XML DTD for an EJB, as specified in the Enterprise JavaBeans specification 1.1. For more information about the internal structure of the Access EJB deployment descriptor, see Deploying the WebSphere Access EJB.

The Access EJB and InterChange Server

To communicate with an ICS-managed EIS, a J2EE client component sends a request to a WebSphere Access EJB, which communicates with ICS to initiate the request. ICS handles any communication with ICS-managed EISs by controlling execution of the collaboration. To provide communication between the Access EJB and ICS, IBM provides WebSphere InterChange Server Access.

InterChange Server Access is the low-level Java interface that enables external processes (called an access clients) to request execution of a collaboration. An Access EJB is an external process to the WebSphere business integration system and therefore uses InterChange Server Access to communicate with an instance of ICS. The InterChange Server Access methods use CORBA-IIOP as the underlying transport mechanism. By isolating the calls to InterChange Server Access within an Access EJB, the client component does not have to contain ICS-specific code.

Figure 9 shows the structure of the communication between an Access EJB and ICS.

Figure 9. Access to an ICS-managed EIS through InterChange Server Access

The figure shows a schematic of the access to an ICS-managed EIS through InterChange Server Access. The figure is a flow diagram starting in the upper left with an arrow pointing right which is labelled "J2EE client component requests information from an ICS-managed EIS". This arrow ends at a cell labelled "WebSphere Access EJB" the left half of which is shaded, the right half is labelled "InterChange Server Access interface". From this cell an arrow points right, labelled "CORBA-IIOP" which ends at a second cell denoted by "WebSphere InterChange Server". The left half of this cell is labelled "InterChange Server Access interface" and the right half is shaded. From this cell an arrow points down to a cell labelled "WebSphere Business Integration Adapter" and from that cell an arrow points down to a cell denoted "EIS application".

Note:
For more information on the IBM WebSphere InterChange Server Access, see the Access Development Guide.

Copyright IBM Corp. 1997, 2004