Integrating your J2EE Session EJB with an Application

When you package your task as a J2EE session EJB, the task name is given to a method which performs the task when invoked. The Attachmate EJB interface contains one method per task in each task file for which an EJB is generated.

To integrate your J2EE session EJB with an application
  • Open your EJB in your IDE.

    The method or methods will be displayed in your IDE. Inputs and outputs are represented as JavaBeans generated from schema contained in the task file. The single parameter of a task method is a bean and the return type is a bean or void if the task has no outputs.

Example:

In this example, you set task inputs, execute the task, and get task outputs.

//create inputs object, define outputs variable 
AccountQueryStateful.AccountLookupTaskInput.IMSInputs si 
Continued line= new AccountQueryStateful.AccountLookupTaskInput.IMSInputs(); AccountQueryStateful.AccountLookupTaskOutput.IMSOutputs so = null; // set task input(s) si.setAccountNumber(AccountNumber); // execute task with inputs and collect outputs so = ejb.AccountLookupTask(si); // get task output(s) Balance = so.getBalance();

Alternatively, you may access the J2EE resource adapter directly. For details, see the help topic, Accessing Data with the Attachmate J2EE Resource Adapter

Code Samples for J2EE Architecture

Related Topics
Bullet Using J2EE Architecture
Bullet Deploying J2EE Session EJBs
Bullet Accessing Data with the Attachmate J2EE Resource Adapter
Bullet How to Provide Tasks in a J2EE App Server
  Attachmate