Java Dynamic Management Kit 5.1 Tools Reference Guide

1.6.3 Skeletal MBeans Representing SNMP Table Entries

For each table in a MIB, the mibgen compiler generates an MBean that represents a table entry. These skeletal MBeans must be completed by adding implementation specific code, called access methods. The generated code is initialized with default values for table–entry fields. Therefore, if you compile the generated code directly, you obtain a running agent. In this case, values returned by the agent when querying the MIBs are not meaningful. The mibgen compiler uses the entry names that are specified in the MIB definition to name MBeans that are generated from table entries. For example, for a table entry definition named sysApplInstallPkgEntry in the MIB, mibgen will generate a skeletal MBean class named SysApplInstallPkgEntry and an interface named SysApplInstallPkgEntryMBean.


Note –

Remote creation of table entries is disabled by default, for security reasons. You can dynamically enable and disable remote creation of table entries by calling the setCreationEnabled operation on the generated MBean-like object.


The RowStatus convention, that is defined in RFC 2579, is fully supported by the code generator. When a table is defined using SNMPv2, if it contains a control variable with row status syntax, the mibgen compiler generates a set of methods allowing this table to be remotely controlled by this variable. However, the remote creation and remote deletion of rows remains disabled by default.

Table objects are divided into two categories:

When remote table-entry creation is enabled, and the creation of a new table is requested, a factory method is called on the MBean-like object to instantiate the new table entry. By default, an instance of the skeleton class for that table entry is instantiated.

To Instantiate Your Own Implementation Class
  1. Subclass the MBean-like object to redefine the factory method for remote entry creation.

  2. Redefine this factory method so that it returns an instance of your implementation class, instead of the default skeleton.

  3. Subclass this table's group MBean to instantiate your new MBean-like object, instead of the generated default object.

    This is demonstrated in the RowStatus example, which is presented in the Java Dynamic Management Kit 5.1 Tutorial.