Installing Server Access for EJB

As part of the IBM WebSphere InterChange Server installation, InterChange Server Installer installs the files in the directories shown in Table 6.. These directory paths are relative to the InterChange Server product directory.

Table 6. Installed file structure for WebSphere Access EJB

Directory Description
DevelopmentKits\J2EE\EJB
Contains the EJB session bean, the WebSphere Access EJB, packaged into a single Java archive (jar) file, called cwsession_ejb-jar.jar. This jar file contains the following files:
  • Java class files for the EJB and its home and remote interfaces
  • Utility classes to communicate with InterChange Server
  • Deployment descriptor: META-INF/ejb-jar.xml
  • IBM WebSphere InterChange Server Access stubs
DevelopmentKits\J2EE\EJB\
samples
Contains source code for EJB samples

Using IBM WebSphere InterChange Server Installer

To install Server Access for EJB, run ICS Installer and select options as follows:

When InterChange Server Installer installs Server Access for EJB, it copies to the machine the contents of the directories listed in Table 6. For information on ICS Installer, see the System Installation Guide for Windows or for UNIX.

Note:
You can install Server Access for EJB on a machine other than the one that contains WebSphere business integration system installation without using ICS Installer. In this case, copy the WebSphere Access EJB jar file (cwsession_ejb-jar.jar) into a deployment directory on the machine on which it is to run (the same machine as the application server).

Deploying the WebSphere Access EJB

The Enterprise JavaBeans specification 1.1 requires that an EJB provider define common EJB properties in an XML file named ejb-jar.xml. The WebSphere Access EJB jar file contains this deployment descriptor, which provides information that the EJB container needs to deploy WebSphere Access EJB in an application server. The deployment descriptor contains an <ejb-jar> element, which is the root element of the deployment descriptor. This element contains information about the WebSphere Access EJB. All general information is represented in string format.

Table 7 shows the elements in the deployment descriptor of the WebSphere Access EJB.

Table 7. Contents of the WebSphere Access EJB deployment descriptor

Deployment descriptor element Description
<enterprise-beans>
Marks the beginning of the subsection within the <ejb-jar> element that provides the structure of an enterprise bean.
<session>
Marks the beginning of the subsection within the <enterprise-beans> section that provides the definition of a session bean.
<ejb-name>
Local name of the enterprise bean; this name does not have to match the JNDI name that the Deployer assigns to the enterprise bean:
com.crossworlds.access.business.
cwsession.CwSession
<home>
The fully qualified name of the Java class that implements the home interface ( EJBHome) for the WebSphere Access EJB:
com.crossworlds.access.business.
cwsession.CwSessionHome
<remote>
The fully qualified name of the Java class that implements the remote interface ( EJBObject) for the WebSphere Access EJB:
com.crossworlds.access.business.
cwsession.CwSession
<ejb-class>
The fully qualified name of the Java class that implements a WebSphere Access EJB ( SessionBean):
com.crossworlds.access.business.
cwsession.CwSessionBean
<session-type>
Because a WebSphere Access EJB is a stateless session bean, this value is set to:
Stateless
<transaction-type>
Because the transaction demarcation for a WebSphere Access EJB is performed by the EJB container, this value is set to:
Container
<env-entry>
These environment entries provide information for each ICS instance that a WebSphere Access EJB can access. For more information, see Configuring Server Access for EJB.
<assembly-descriptor>
Marks the beginning of the subsection within the <ejb-jar> element that describes how the Enterprise JavaBeans in this deployment descriptor are assembled into a larger application deployment unit.
<container-transaction>
Marks the beginning of the subsection within the <assembly-descriptor> section that provides declaration information about transaction attributes.
<method>
Marks the beginning of the subsection within the <container-transaction> section that provides information about the methods in the WebSphere Access EJB remote interface that require transaction attributes.
<trans-attribute>
Because a collaboration executes within its own transaction context within ICS, this value is set to:
NotSupported

If a client component calls with a transaction context, the EJB container suspends the association of the transaction context with the current thread before it invokes either the executeCollaborationExtended() or executeCollaborationExtendedWithLocale() methods.

Note:
The ejb-jar.xml deployment descriptor is consistent with the XML DTD for an EJB, as specified in the Enterprise JavaBeans specification 1.1.

Figure 11 shows a deployment descriptor of the WebSphere Access EJB, which is contained in the ejb-jar.xml file. You do not usually need to edit this file. Most application servers provide tools that provide access to the deployment descriptor.

Figure 11. WebSphere Access EJB deployment descriptor

<ejb-jar>
   <enterprise-beans>
      <session>
      <ejb-name>com.crossworlds.access.business.cwsession.CwSession</ejb-name>
      <home>com.crossworlds.access.business.cwsession.CwSessionHome</home>
      <remote>com.crossworlds.access.business.cwsession.CwSession</remote>
      <ejb-class>
         com.crossworlds.access.business.cwsession.CwSessionBean
         </ejb-class>
      <session-type>Stateless</session-type>
      <transaction-type>Container</transaction-type>
      <env-entry>
         <description> 
            The list of interchange servers which this bean would access. It would
            be of the format ICServer1, ICServer2 
            </description>
         <env-entry-name>ICServers</env-entry-name>
         <env-entry-type>java.lang.String </env-entry-type>
         <env-entry-value>CrossWorlds,dexter</env-entry-value>
         </env-entry>
      <env-entry>
         <description>Trace Level for the bean </description>
         <env-entry-name>traceLevel</env-entry-name>
         <env-entry-type>java.lang.Integer </env-entry-type>
         <env-entry-value>5</env-entry-value>
         </env-entry>
 
<!--  COMMENT: Now we will have entries for each of the InterChange Server instances listed above -->
   <!-- The First ICS instance: CrossWorlds -->
      <env-entry>
         <env-entry-name>CrossWorlds/userName</env-entry-name>
         <env-entry-type>java.lang.String</env-entry-type>
         <env-entry-value>admin</env-entry-value>
         </env-entry>
      <env-entry>
         <env-entry-name>CrossWorlds/passWord </env-entry-name>
         <env-entry-type>java.lang.String</env-entry-type>
         <env-entry-value>null</env-entry-value>
         </env-entry>
      <env-entry>
         <env-entry-name>CrossWorlds/iorLocation </env-entry-name>
         <env-entry-type>java.lang.String</env-entry-type>
         <env-entry-value>
            c:/CrossWorlds/CrossWorldsInterchangeServer.ior</env-entry-value>
            </env-entry>
      <env-entry>
         <env-entry-name>CrossWorlds/numAccessSessions </env-entry-name>
         <env-entry-type>java.lang.Integer</env-entry-type>
         <env-entry-value>10 </env-entry-value>
         </env-entry>
   <!-- The Second ICS instance: dexter -->
      <env-entry>
         <env-entry-name>dexter/userName</env-entry-name>
         <env-entry-type>java.lang.String</env-entry-type>
         <env-entry-value>admin</env-entry-value>
         </env-entry>
      <env-entry>
         <env-entry-name>dexter/passWord </env-entry-name>
         <env-entry-type>java.lang.String</env-entry-type>
         <env-entry-value>null</env-entry-value>
         </env-entry>
      <env-entry>
         <env-entry-name>dexter/iorLocation </env-entry-name>
         <env-entry-type>java.lang.String</env-entry-type>
         <env-entry-value>
            D:/CrossWorlds2k/dexterInterchangeServer.ior
            </env-entry-value>
         </env-entry>
      <env-entry>
         <env-entry-name>dexter/numAccessSessions </env-entry-name>
         <env-entry-type>java.lang.Integer</env-entry-type>
         <env-entry-value>10 </env-entry-value>
      </env-entry>
   </session>
   </enterprise-beans>
 
   <assembly-descriptor>
   <container-transaction>
         <method>
            <ejb-name>
               com.crossworlds.access.business.cwsession.CwSession
               </ejb-name>
            <method-intf>Remote</method-intf>
            <method-name>*</method-name>
            </method>
         <trans-attribute>NotSupported</trans-attribute>
      </container-transaction>
   </assembly-descriptor>
</ejb-jar>
Important:
The WebSphere Access EJB deployment descriptor in Table 11 has been formatted differently from the actual ejb-jar.xml file. In this version, carriage returns have been inserted into the text to improve readability. These carriage returns do not appear in the actual deployment descriptor. For the most accurate version of this file, use the appropriate application-server tool to view the actual ejb-jar.xml file on your system.

For information on how to customize the <env-entry> elements, see Setting environment entries.

Copyright IBM Corp. 1997, 2004