Running the first mobile agent

This is short description what should be done to successfully run the first mobile agent under Windows NT 4.0 with MS Visual J++ installed.

  1. Install Concordia (in this exapmle it is run on the localhost but could be on any machine)
  2. Install JDK 1.1.6+ ( :( )
  3. Run the Concordia Server (in this exapmle it is run on localhost but could be on any machine)
  4. Run MS Visual J++
  5. Create the new project - console application
  6. Define the project specific classpath:
    1. Click the Project in the menu
    2. Choose Project Properties (should be the last ithem)
    3. Choose Classpath tab
    4. In Project Specific click on button New..
    5. Type the full path to files that could be found in Concordia Server Control Panel / Configure button
      (e.g. E:\Program Files\Mitsubishi Electric\Concordia\Agents\lib\Concordia.jar
      and E:\Program Files\Mitsubishi Electric\Concordia\lib\3rdpty.jar)
  7. Define external program to run your programs
    This is neccessery if you want to launch agents from your code (See Lesson 2)
    1. Click the Project in the menu
    2. Choose Project Properties (should be the last ithem)
    3. Choose the Launch tab
    4. Chech Custom
    5. In Program box type full path to Sun's Java (e.g. E:\JEZICI\jdk1.1.7A\bin\java.exe)
    6. In Argument box type -classpath "<JAVAPACKAGES>" Project1.Class1
      (Project1 is the name of your package and Class1 is the class to execute)
  8. Add method to created class that will be run on remote server (see example  for steps 6, 7, 8.)
  9. Import COM.meitca.concordia.*;
  10. New Class extends Agent
  11. Build
  12. Start Concordia Agent Lunch Wizard
  13. Enter full path to created class
    (e.g. F:\Users\Dejan\Programiranje\Project1\Class1.class) and click the Next button.
  14. Click Next..
  15. Click Insert to add server name and method
  16. Add server name or IP of Concordia server - replace New Destination (e.g. localhost)
  17. Add method that will be executed on th server - replace New Method (e.g. pisi())
  18. Click Finish
  19. Server should execute the method or report errors

Example. Text in red is added to file created by wizard

/** * This class can take a variable number of parameters on the command
* line. Program execution begins with the main() method. The class
* constructor is not invoked unless an object of type 'Class1'
* created in the main() method.
*/
import COM.meitca.concordia.*;
public class Class1 extends Agent {
/** * The main entry point for the application.
* * @param args Array of parameters passed to the application
* via the command line.
*/
    public static void main (String[] args) {
        // TODO: Add initialization code here
    }
   
    public void pisi() {
        // TODO: Add initialization code here
        System.out.println("Dejan was here!\n");
    }

}