Running the SNA JCA LU0Connector in a managed environment

The following procedure describes how to install the SNA JCA LU0Connector in the managed environment of WebSphere(R) Application Server 5.1.1 and how to test its configuration.

Before you begin, make sure that the system containing WebSphere Application Server also has IBM(R) Communications Server Version 6.1.1.0 installed.

To install the SNA JCA LU0Connector, complete the following steps:

  1. Start the WebSphere Application Server and then start the Administration Console.
  2. In the left (node) pane, expand the Resources node and click Resource Adapters. In the Resource Adapters panel, click Install RAR.
  3. In the Install RAR File panel, if the RAR file is on the workstation, select Local Path and browse to the location of the RAR file. If the RAR file is on a server, select Server Path and enter the fully qualified path to the RAR file. Click Next.
  4. In the following panel, type an arbitrary name such as JCALU0 and description in the Name and Description fields. Click OK.
  5. Return to the Resource Adapters panel (Resources > Resource Adapters) and click the name of the new resource adapter you created.
  6. In the panel that appears, click J2C Connection Factories. In the J2C Connection Factories panel, click New.
  7. In the dialog that appears, type the connector's display name (such as JCALU0_CF) and JNDI name (such as LU0SNA) in the Name and JNDI name fields. Click Apply.
  8. In the Additional Properties section, click Custom Properties.
  9. In the Custom Properties panel, set the hostApplicationName property to the host APPLID and set the luNames property to the LU name or names defined in the host system. In the breadcrumb string at the top of the panel, click the display name of the connector (for exampleJCALU0_CF).
  10. Copy the lu0wrap.winj2c file from the <toolkit install>>\services\comms directory to a location defined in the PATH environment variable.
  11. Rename the file to lu0wrap.dll.

To test the connector and environment configuration, use code like the following example to test the SNA Lu0 Connector in a managed environment. You can include the method in EJB or servlet code.

private void runHostTransaction() throws Exception { 
  javax.naming.Context initialContext = new javax.naming.InitialContext(); 
  ConnectionFactory connectionFactory = (ConnectionFactory) initialContext.lookup("LU0SNA"); 
  Connection connection = connectionFactory.getConnection(); 
  Interaction interaction = connection.createInteraction(); 
  Lu0InteractionSpec interactionSpec = new Lu0InteractionSpec(); 
  interactionSpec.setInteractionVerb(interactionSpec.SYNC_SEND); 
  Lu0Record in = new Lu0Record(); 
  Lu0Record out = new Lu0Record(); 
  in.setData("AIR2TO "); 
  interaction.execute(interactionSpec, in, null); 
  interactionSpec.setInteractionVerb(interactionSpec.SYNC_RECEIVE); 
  interactionSpec.setExecutionTimeout(1000); 
  interaction.execute(interactionSpec, null, out); 
  System.out.println("Data received: " + out.getData()); 
  interaction.close(); 
  connection.close(); 
}