IConnectorAccess Sample Code

package test;

import com.attachmate.connectors.IConnectorAccess;
import com.attachmate.connectors.screen.ScreenConnectorAccessImpl;

/**
 * A simple console application that demonstrates how to execute a task via
 * the IConnectorAccess API.
 * @see com.attachmate.connectors.IConnectorAccess
 */
public class ConnectorTest
{
    /**
     * Application entry point.
     * @param args Command line arguments.  Not used.
     */
    public static void main(String[] args)
    {
        //Instantiate the connector
        IConnectorAccess connector = new ScreenConnectorAccessImpl();

        try
        {
            //Open a task file and execute a task
            connector.open("C:\\Program Files\\Attachmate\\EAI\\recordings\\Test\\connector\\Test.xml");
            connector.execute("Task", "<ScreenInputs><Input>data</Input></ScreenInputs>");

            //Display the output XML
            System.out.println(connector.getData());
        }
        catch (Exception xx)
        {
            xx.printStackTrace();
        }
        finally
        {
            //Close the connector
            connector.close();
        }
    }
}
Related Topics
Bullet Using Tasks in Your Applications, Overview
Bullet Building Applications Using Native Win32 Technologies
Bullet Using the Enhanced Performance Option with IConnectorAccess
Bullet Proxy Service Interface API Reference
  Attachmate