Launching / Connecting to an Environment

EIS environments are deployed as jar files. To use one, you should copy the jar file into the base directory of your Eclipse project (the project folder).

An example of this can be seen above, where the Test project contains the Vacworld EIS Environment, which is released as the file ita-2.2.0.jar.

When working with EIS environments, the first thing that needs to be done is for the environment to be actually loaded into the EIS Interface. In ASTRA, this is done via an action that is defined as part of the EIS API:

  package examples;
  
  agent Vac {
      module EISAPI eis;
      
      initial !init();
      
      rule +!init() {
          eis.launch("vacworld", "ita-2.2.0.jar");
          eis.join("vacworld");
      }
  }

The launch(…) action installs the VacWorld environment into the EIS interface and makes it accessible to ASTRA agents through the “vacworld” identifier. This action only needs to be performed once by a single agent. Other agents need only to connect to the EIS environment by using the join(…) action:

  package examples;
  
  agent Vac2 {
      module EISAPI eis;
      
      initial !init();
      
      rule +!init() {
          eis.join("vacworld");
      }
  }

As we will see later, it is possible for a single agent deployment to interact with more than one EIS environment at a time. Because of this, many of the actions and terms have been overloaded to work with both a specified environment and a default environment. The default environment is the last environment that the agent joined. This, however can be overridden with the EIS API setDefaultEnvironment(…) action. For completeness, an agent can get its current default environment identifier using the the EIS API.defaultEnvironment() term.