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.
WebSphere business integration system provides many collaborations through its Exchange. In addition, you can create custom collaborations. By providing connectivity for an enterprise bean to IBM WebSphere Business Integration Collaborations, the bean can essentially execute complex business logic, which could span application and enterprise boundaries.
The client component requests execution of a collaboration, which contains the business logic; ICS manages access to the necessary EISs. The client is not required to develop any code to access ICS.
Through collaborations and IBM WebSphere Business Integration Adapters, a client component can have enterprise connectivity to the many EIS applications that ICS manages.
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
As Figure 6 shows, WebSphere business integration system provides the following components for middle-tier support:
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.
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
WebSphere Application Server, Version 4.0 Advanced Edition provides support for the following:
For more information on deploying an Access EJB within these application servers, see Configuring Server Access for EJB.
At run time, an EJB container manages interactions between the WebSphere Access EJB instance and the client component through the home and remote interfaces that Server Access for EJB provides, as Figure 7 shows.
Figure 7. Accessing an ICS-managed EIS through 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:
To provide communication between the client component and the Access EJB, the client component calls either the home or remote interface of the Access EBJ. The client component (in the client tier) interacts with the Access EJB to request execution of a business process (in the form of a collaboration) in an ICS-managed EIS.
To provide communication between the Access EJB and ICS, each of these components uses WebSphere InterChange Server Access. The Access EJB (in the middle tier) communicates with InterChange Server through InterChange Server Access to send the request for collaboration execution to ICS (in the server tier).
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.
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).
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:
The home interface provides the client component with a single create() method, which takes no arguments and returns an Access EJB instance.
When called from a client component, the create() method requests the creation of an Access EJB, which handles communication with an InterChange Server instance. However, it is the responsibility of the EJB container within the application server to handle the actual instances of the Access EJB. The application server checks its pool of available Access EJB instances. If a matching instance exists, it returns to the client a handle to that instance. Otherwise, it initiates creation of a new Access EJB instance and returns its handle to the client. For information, see Creating a session object.
For more information, see Removing the session object.
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.
For more information, see Sending data to an ICS-managed EIS.
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
This SessionBean class contains the implementations of the following methods:
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().
For more information, see Creating a session object.
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.
For more information, see Sending data to an ICS-managed EIS.
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
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.
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