com.sun.jdmk.tools
Class MibGen

java.lang.Object
  extended by com.sun.jdmk.tools.MibGen

public final class MibGen
extends Object

The main class of the mibgen tool.

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 MBeans.

The compiler accepts SNMPv1 or SNMPv2 definitions mixed into a same MIB module. A MIB file can contain several MIB modules.

In order to invoke the class, you need to invoke:

where: In order to directly invoke the class, Java Dynamic Management(TM) Kit provides a script called mibgen.
On UNIX platforms the script is provided under <install_dir>/SUNWjdmk/5.1/bin. On Windows platforms the script is provided under <install_dir>\SUNWjdmk\5.1\bin.

Note:
The order followed by mibgen to find the MIB_CORE definitions file is:

  1. The user MIB_CORE definitions file specified in the <mib files> using the -mc mibgen option.
  2. The user command line parameter specified using the -Dmibcore.file java option.
  3. The default MIB_CORE definitions file provided with jdmk under <install_dir>/etc/mibgen (mib_core.txt).
    To succeed, you must be able to derive the jdmk installation directory from the CLASSPATH environment variable. Otherwise, mibgen will look for the mib_core.txt file under <current_dir>/etc/mibgen.


Method Summary
static int compile(String[] args)
          The compile method of the mibgen compiler.
static void main(String[] args)
          The main method of the mibgen compiler.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

main

public static void main(String[] args)
The main method of the mibgen compiler.

This 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.

This method allows you to specify optional command-line parameters listed above.


compile

public static int compile(String[] args)
The compile method of the mibgen compiler.

This method creates an instance of MibGen and invokes the compiler.
If an error occurs, the method returns with a status of 1.
If the compilation succeeds, the method return with a status of 0.


Open Source build 02
opendmk-1.0-b02 2007.10.01_19:17:46_MEST

Copyright 1998-2007 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.