5.3.1 Module Services

 



 

Overview

 

The Web NMS servers, both BE and FE, comprises of functionally independent modules (also called as processes) which interact among each other and make up the complete server application. The 'Module Services' provides a way for all these modules to be centrally controlled and coordinated, to ensure smooth operation of the server application. You can extend the functionality of the Web NMS servers by plugging in your own module, following the contracts defined by the Module Services.

 

What do Module Services offer?

How to Use Module Services ?

 

For plugging in your own module into the Web NMS Server, follow the steps detailed below :

 

Step 1

 

Implement the com.adventnet.nms.util.RunProcessInterface

 

The com.adventnet.nms.util.RunProcessInterface defines various methods through which the Web NMS servers control the corresponding module. In effect, the implementation of com.adventnet.nms.util.RunProcessInterfacebecomes the main class (or the entry point) for your module within the Web NMS server.

 

Details about an example implementation for the RunProcessInterface are provided below.

 

Step 2

 

Make an entry in the NmsProcesses[BE/FE].conf file

 

Specify the fully qualified class name of your implementation of com.adventnet.nms.util.RunProcessInterface and the parameters to be passed to it in the NmsProcessesBE.conf or NmsProcessesFE.conf, to plug-in your module in the BE or FE server, respectively.

 

A typical entry made in the NmsProcessesBE.conf file is provided below for your reference.

 

#java com.adventnet.nms.tl1.NMSTAServer [TAS_PORT port] [APPLET_DIRECTORY applet_directory]

PROCESS com.adventnet.nms.tl1.NMSTAServer

ARGS TAS_PORT 5005 APPLET_DIRECTORY html

 

Here,

Configuration Options

 

Specifying the modules and their parameters

 

To plug-in your module in the Web NMS servers, you need to make an entry in the NmsProcessesBE.conf / NmsProcessesFE.conf present in the <Web NMS HOME>/conf directory. You can also specify parameters in the configuration file, which will be passed as arguments to your module when it is started by the Web NMS server.

 

In the configuration file, the fully qualified class name of your implementation of com.adventnet.nms.util.RunProcessInterface should be specified against the keyword PROCESS and the parameters for the module have to be specified against the keyword ARGS.

 

The following is a typical entry in the conf file. NmsProcess is the implementation of com.adventnet.nms.util.RunProcessInterface which belongs to the test package. This module will take two parameters, TIMEOUT and RETRIES, with values 5 and 2 respectively.

 

PROCESS    test.NmsProcess
ARGS    TIMEOUT 5 RETRIES 2

 

Controlling the order of starting up and shutting down the modules

 

The Web NMS server starts the various modules in the order (top to bottom) they are specified in the NmsProcesses[BE/FE].conf configuration file and shuts them down in the reverse order. In Web NMS, modules are normally specified in the order of linear dependency, that is, any module is functionally dependent only on modules that are specified before that in the conf file. This ordering is essential for making sure that the Web NMS server startup and shutdown operations happen smoothly.

 

API Highlights

 

The com.adventnet.nms.util.RunProcessInterface interface defines the life cycle methods for the modules through which the Web NMS servers control them.

Please refer to the javadoc of com.adventnet.nms.util.RunProcessInterface for a complete description of the API.

 

Examples

 

Please refer to the example ProcessTest.java in <Web NMS Home>/default_impl/client_server_communication directory, which illustrates the implementation of the com.adventnet.nms.util.RunProcessInterface interface, which is started as a separate thread by specifying the entry in the conf file as explained above. Refer to the example implementation of RunProcessInterface in Communication Framework.

 

Developer Tips

more...

 


Copyright © 2013, ZOHO Corp. All Rights Reserved.