| Skip Navigation Links | |
| Exit Print View | |
|
Importing an SNA Custom Handshake Class Java CAPS Documentation |
Importing an SNA Custom Handshake Class
Adding a Custom Handshake Class to a Project
Configuring the Adapter for a Custom Handshake Class
Importing a Custom Handshake Class into a Project
To use a custom handshake class with the SNA Adapter, you need to configure the Adapter by specifying the class name. You also need to import the file into the SNA Project, and if you are using it in a Java Collaboration Definition, you need to import it into the Collaboration as well.
Perform the following steps to use a custom handshake class:
Before you perform these steps, create the custom class and make it available to the NetBeans IDE.
In order for the SNA Adapter to know which custom handshake class to use, you need to specify the class name in the Adapter properties of the Connectivity map.

The SNA Adapter Properties Editor appears, displaying the default properties for the inbound Adapter.

For the sample code provided with the Adapter, enter com.stc.connector.snalu62.api.SNACustomerHandshakeImplSampleAccept.

The SNA Adapter Properties Editor appears, displaying the default properties for the outbound Adapter.

For the sample code provided with the Adapter, enter com.stc.connector.snalu62.api.SNACustomerHandshakeImplSampleInitialize.
In order to use a custom class in a Project and a Java Collaboration Definition (JCD), you need to package the class into a JAR file and then import the file into both the Project and the JCD.
The Import Files window appears.

The selected JAR file appears in the Selected Import Files pane at the bottom of the Import Files window.
The selected JAR file appears in the Project tree under the project you selected.

The Add/Remove JAR Files window appears.

The selected JAR file appears in the Imported JAR Files pane.
The selected JAR file appears under the JCD in the Projects window.
Note - If you make any changes to the class, repeat the previous steps.
The Java Collaboration can handle the SNA connection completely using the default class that is provided with the Adapter, com.stc.connector.snalu62.api.SNACustomerHandshakeImplSampleDummy. This class has been implemented in the SNA Adapter. The sample code for this custom class is shown below:
package com.stc.connector.snalu62.api;
import com.stc.connector.logging.LogFactory;
import com.stc.connector.logging.Logger;
import com.stc.connector.snalu62.exception.SNAApplicationException;
/**
* This is a sample class to implement the interface SNACustomerHandshake.
* It implements a dummy handshake. That is, the method startConversation()
does not perform a function.
* No SNA conversation is established inside this implementation class.
You should establish the SNA conversation manually
(e.g. in the java Collaboration).
*/
public class SNACustomerHandshakeImplSampleDummy implements SNACustomerHandshake {
public static final String version = "cvs $Revision: 1.1.2.2 $
$Date: 2005/11/10 21:40:15 $";
private Logger logger = LogFactory.getLogger
("STC.eWay.SNALU62." + getClass().getName());
/**
* Constructor
*
*/
public SNACustomerHandshakeImplSampleDummy() {
super();
}
/**
* @see com.stc.connector.snalu62.api.SNACustomerHandshake#startConversation
(com.stc.connector.snalu62.api.SNACPICCalls)
*/
public void startConversation(SNACPICCalls cpic) throws SNAApplicationException {
logger.info("SNACustomerHandshakeImplSampleDummy.startConversation():
Done nothing here.");
}
}