Example on Discovery Service

Contents:

Introduction

This is a simple example to illustrate the usage of  Discovery service provided with AdventNet  Agent  Toolkit.
__________________________________________________________________________________________________________________________

Overview

The main file 'DynamicJmxAgent.java' has 2 adaptors (HTML / RMI) registered with the MBeanServer. It also has DiscoveryService mbean registered with the MBeanServer. Thus when this agent is started, it  broadcasts packet for discovery. The discovery client (TestClient.java) will receive it and discovers this Multi-Protocol agent and the adaptors present in the agent. The client can similarly discover all the agents(with dicovery service) in the network.

If the client started after the Multi-Protocol agent is started the client broadcasts discovery packet , to which the Multi-Protocol agents will respond. This allows all the agents to be discovered by the discovery client.
__________________________________________________________________________________________________________________________

Getting Started :

Source files

Following are the source files ,

Compilation

To compile the source files go to AdventNet/JavaAgent/examples/jmx/discovery directory in the command prompt and type,

compile *.java [Windows]
sh compile sh *.java [Linux/Solaris]

This will compile the source files in the respective directory.

Running the Agent

To start the agent go to AdventNet/JavaAgent/examples/jmx/discovery directory in the command prompt and,

1. Use startJMXAgent.bat/sh

          By default,
                (a) HTML  Adaptor will be started at port 8030
                (b) RMI Adaptor will be started at port 1099

2. Start the client using startDiscoveryClient.bat/sh

3. The discovered agent information will be printed in the client console.

Testing

__________________________________________________________________________________________________________________________

Copyright (c) 1996-2004 AdventNet, Inc. All Rights Reserved.