next up previous contents
Next: Installation and Usage Up: Design of the Applet Previous: The Architecture of the

Organization of the Java Code

The Java code for the Applet is split into multiple parts. The main program is contained in the file ``fluid.java''. This file includes the fluid class, which extends the applet class and is run in the first place after the bytecode has been loaded into the browser.

The applet makes use of so called ``threads''. This is very advantageous when programming SNMP communications. Using threads, one can send SNMP requests asynchronously at any time without having to wait for a reply. The response is received within the ``callback'' method, which is running inside a separate thread. Alternatively, one can still use synchronous communication. When programming the main SNMP communications with the NeTraMet meter we found this technique very convenient.

Besides the code in ``fluid.java'', there are some other files that contain mainly the code for the user interface. Those are:

netramet/FlowDataEntry.java
describes the data structure that is stored for each flow inside the applet.
netramet/Ruleset.java
describes the data structure of rulesets. It is currently only used for the search of the ruleset in the meters table. Later it could be expanded to hold the whole Ruleset information in order to allow ruleset upload as well.
StatusPanel.java
Contains the code for the display of general status information, like connection state with the meter, SNMP community name etc.
FlowPanel.java
which represents the canvas in which the actual flow data is displayed.
FlowFrame.java
which contains the code for the Pop-Up windows that appear when data for a particular flow is to be displayed.

Figure 5.3 gives an overview of the applets structure. As it can be seen from the figure, more than one FlowFrame object can be child of the FlowPanel. These frames contain the information about particular flows and are opened whenever the user selects one of the points inside the flow panel representing a flow.


  
Figure 5.3: Structure of the Java Sourcecode
\begin{figure}
 \begin{center}
 \vspace{1cm}
 
\epsfig {file=xfigpics/javafiles.xfig.eps}
 \end{center}\end{figure}


next up previous contents
Next: Installation and Usage Up: Design of the Applet Previous: The Architecture of the
root
8/4/1997