Enterprise bean handler

The Enterprise Java™ Bean (EJB) handler is a Java component that consists of enterprise bean clients. The handler publishes a set of properties that a client uses to communicate with and deliver an integration message to a target client. The target client can run on the local application server or on a remote application server.

To establish a connection, the remote Java class and the home Java class must be available in the class path of the handler. If the client is on a remote application server that is different from the handler application server, the client jar file reference must be in the class path of the handler. The handler picks up the context factory class name from the local application server when the enterprise bean client is on a remote application server that is the same as the handler application server.

CONTEXTFACTORY property

This required property specifies a J2EE context factory class name. The documentation for your application server contains the name of the default context factory to use.

EJBEXIT property

This optional property is used for customization and specifies the fully qualified name of a custom Java class that implements the EJBExit interface.

If you do not specify a value for this property, the DefaultEJBExit interface is executed and attempts to resolve the enterprise bean method signature and parameters.

If the enterprise bean client has its own method signature and parameters, create a Java class that contains your version of the EJBExit interface and implementations of the following methods:

public Class[] getClassParams()

The getClassParams() method returns the method signature in the form of an array of Java classes.

public Object[] getObjectParams(byte[] data, String interfaceName, Map String,? metaData)throws MXException

The getObjectParams() method returns the parameters of the enterprise bean business method in the form of an array of Java objects.

public void responseOk(Object response)throws MXException

The responseOk() method is called after a successful enterprise bean invocation.

public void responseError(Exception e) throws MXException

The responseError() method is called with the originating exception as a parameter if an error is encountered during enterprise bean invocation.

The following code illustrates what your implementation of getClassParams() looks like when the enterprise bean client has a business method with a byte array and a string:

Class[] classParams = {byte[].class, String.class};
return classParams;

The following code illustrates what your implementation of getObjectParams () looks like when the enterprise bean client has a business method with a byte array and a string:

byte[] data = ...;
String ifaceType = ...;

Object[] objParams = {data,ifaceType};
return objParams;

Complete one of the following actions to identify the location of the package structure for the EJBExit class file:

  • Place the class in the Java package structure in the applications/maximo/businessobjects/classes directory.
  • Modify the mboweb\webmodule\META-INF\MANIFEST.MF class path to include the package structure.
  • Rebuild the application EAR file and include the EJBExit class file.

JNDINAME property

This required property specifies the name by which the enterprise bean client is registered in the Java Naming and Directory Interface (JNDI) tree on the application server. The filename is ibm-ejb-jar-bnd.xml and the property is set to

<ejbBindings xmi:id="Session_enterpriseservice_Bnd" 
  jndiName="ejb/maximo/remote/enterpriseservice">
    <enterpriseBean xmi:type="ejb:Session" 
      href="META-INF/ejb-jar.xml#Session_enterpriseservice"/>
</ejbBindings>

METHODNAME property

This required property specifies the public business method that is exposed by the enterprise bean client that is invoked by this handler.

PROVIDERURL property

This required property specifies the URL of the target application server on which the enterprise bean is running. The system then maps to the java.naming.provider.url property and creates the InitialContext object.

If the handler and the target enterprise bean are running on the same application server instance, do not specify this property because it defaults to the local server URL.

USERNAME and PASSWORD properties

The user name and password properties correspond to the java.naming.security.principal (USERNAME) and java.naming.security.credentials (PASSWORD) properties that are used to create the InitialContext object.