RMI Tutorials

 



 

Introduction

 

This tutorial will guide you through designing the RMI client program and accessing the simulated agent by providing working, illustrative examples.  It describes how the simulated SNMP and TL1 agents can be accessed and controlled from a remote system using the RMI client APIs bundled with Simulation Toolkit.  

 

Application Overview

 

The RMI tutorial is available in <SimulatorHome>/tutorials/rmi directory.  The client folder contains sample RMI client program which can be run on any remote system. The simulator folder contains the script files to start the simulated agents that can be managed via RMI.

 

The RMI client program invokes some of the RMI client API methods in the simulator to control the simulated agents running in another system.

 

Working with the Tutorial

 

In this section, the steps to start the simulated agent and the RMI client programs are provided. This would help you run the application by yourself and view the results.

 

Starting the Agent

 

The <SimulatorHome>/tutorials/rmi/simulator/bin directory contains the batch/shell files to start the simulated SNMP and TL1 agents with RMI support.

 

Starting the Standalone SNMP Agent with RMI support

 

Execute the following command from <SimulatorHome>/tutorials/rmi/simulator/bin directory.

 

StartAgentSimulator.bat/sh  - snmp  - c <configuration filename>  -tn  <database table name>

 

(or)

 

StartAgentSimulator.bat/sh  - snmp   - m <MIB filename> -tn  <database table name>

 

The above command will start the simulated SNMP agent at port 8001, that can be managed via RMI. It will also start the RMI registry at port number 1099 at localhost.  

 

Starting the Standalone TL1 Agent with RMI support

 

1. Execute the following command from <SimulatorHome>/tutorials/rmi/simulator/bin directory.

 

StartAgentSimulator.bat/sh  - tl1  - c <configuration filename>  -tn  <database table name>

 

(or)

 

StartAgentSimulator.bat/sh  - tl1  - t <TCS filename> -tn  <database table name>

 

The above commands will start the simulated TL1 agent at port 9099,  that can be managed via RMI. It will also start the RMI registry at port number 1099 at localhost.  

 

Starting the Simulated Network with RMI support

 

Batch/Shell files are not provided to start the network with RMI support. This can be done from the Network Designer UI :

    1. Go to <Simulator_Home>/bin/cmdline directory.

    2. Execute the StartRMIRegistry.bat file for Windows OS and StartRMIRegistry.sh file for Linux OS. This command starts the RMI registry at the default port 1099.

    3. Create the network with the required number of devices in the Network Designer.

    4. Select the option Manage using RMI in the Settings -> Runtime Settings dialog.

    5. Start the network. Now when the network is started, all the devices in the network will be accessible via RMI.

Starting the RMI Client

 

The RMI client folder available in <SimulatorHome>/tutorials/rmi directory contains the RMI client programs and RMI client APIs.

 

The following files and directories are available under the client folder :

Note: You can create a zip of the client folder, extract and run it in any other system separately.

 

To run the client program,

  1. Edit the RMIParameters.conf file available in the conf folder, with the host name and port number of the  system, where the simulated agent is running.

  2. Run the executeScript.bat/sh command from <SimulatorHome>/tutorials/rmi/client/bin directory. The SimulatorRMIClient gets the simulator object reference and executes the sample RMI API methods based on the reference obtained.

Note:

  1. Refer to the SimulatorRMIClient.java file in <SimulatorHome>/tutorials/rmi/source directory , to learn how to write your own RMI client programs.

  2. The javadocs of the RMI client api methods  that can be accessed via RMI is available in SimScrRmiIntf.html in <Simulator_Home>/examples/javadocs directory.

  3. If any changes are made in the source files, compile the source files and keep the class files in the classpath.

 

 



Copyright © 1996-2006, AdventNet Inc. All Rights Reserved.