All Packages Class Hierarchy This Package Previous Next Index
Class com.sun.jaw.tools.MibGen
java.lang.Object
|
+----com.sun.jaw.tools.MibGen
- public final class MibGen
- extends Object
- implements Runnable
The class compiles a SNMP MIB expressed using SNMP V1 or SNMP V2 SMI
and generates code for implementing the MIB as a set of
Java BeansTM.
The compiler accepts SNMPv1 or SNMPv2 definitions mixted into a same MIB module.
A MIB file can contain several MIB modules.
In order to invoke the class, you need to invoke:
java com.sun.jaw.tools.MibGen [-n] [-d dir] [-tp packageName] [-desc] [-m] [-mo] [-a] [-p prefix]
[-help] mib1...mibN
where:
- -n: Parses the mib files without generating code.
- -d dir: Generates code in the specified target directory.
- -tp packageName: Generates code in a specific Java package.
- -desc: Includes the "DESCRIPTION" clause of OBJECT-TYPE in generated code.
- -a: Generates code for all the mib files.
- -m: Generates code for the manager API (in addition to the agent code). Exclusive with -n.
- -mo: Only generates code for the manager API. Exclusive with -n.
- -p prefix: Uses the specified prefix for naming generated clases.
- -help: Prints a usage message explaining how to invoke the compiler;
- mib: List of MIB files to compile.
In order to directly invoke the class, Java Dynamic Management provides a script called mibgen.
On Solaris the script is provided under $(PACKAGE_ROOT)/jaw/bin. If you use default install
path the script is here.
-
MibGen(OutputStream, String, String[])
- Create a new MIB compiler.
-
getCompilationStatus()
- Indicates compilation status.
-
main(String[])
- Static invocation of
MibGen.
-
run()
- Start compilation.
MibGen
public MibGen(OutputStream o,
String prog,
String args[])
- Create a new MIB compiler.
- Parameters:
- o - Output stream to use for printing traces
- prog - Command name to use when printing messages
- args - Command arguments.
getCompilationStatus
public int getCompilationStatus()
- Indicates compilation status.
Once the compilation is performed, the method indicates whether or
not the compilation was successful.
- Returns:
- 0 if the compilation was successful or 0 if an error occured.
run
public void run()
- Start compilation.
main
public static void main(String args[])
- Static invocation of
MibGen.
The method creates an instance of MibGen and invokes the
compiler.
If an error occurs, the method exits the VM with a status of 1.
If the compilation succeeds, the method exits the VM with a status of 0.
All Packages Class Hierarchy This Package Previous Next Index