Java class library

Top  Previous  Next

Java applications may use XECI APIs using the XECI Java class library. The class library is contained in the jar eci.jar.

The access to the API is performed though the class com.hite.eci.ExternalCallInterface, documented in the com.hite.eci API

Sample

import java.io.IOException;

import java.net.InetSocketAddress;

import java.net.Socket;

import com.hite.eci.*;

import com.hite.hdm.ByteArray;

 

public class TestExternalCallInterface {

   public final static void main(String []argv) {

      try {

         ExternalCallInterface eci=new ExternalCallInterface(new InetSocketAddress("linux02"6000), true);

         byte[] v=new byte[80];

         ByteArray ca=new ByteArray(80);

         ca.setString("message from java"0);

         eci.link("XECISRV", ca.getBytes());

         System.out.println("--> ["+ca.getString(0, ca.length()));

         ca.fill(0, ca.length(), (byte)0);

         ca.setString("second message from java"0);

         eci.link("XECISRV", ca.getBytes());

         System.out.println("--> ["+ca.getString(0, ca.length()));

         eci.close();

      } catch (Exception e) {

         e.printStackTrace();

      }

      System.exit(0);

   }

}