If you use annotations to declare OID assignments, include a dependency on the ant-update-bytecode plugin in the module build script to substitute the OID parts into the compiled classes.

The following example shows an annotation that an Ant task will process to replace the token with the OID part from the relevant imported property.

@Description("Thread-pool task execution statistics")

The update-bytecode Ant task can process the value in the @SNMPOIDSuffix annotation by replacing the @…​@ string with the value of the relevant referenced property.

The following script shows the usage of the update-bytecode Ant task. Use the script after compilation but before building the jar file.

  <replaceproperties annotations="true"/>
  <fileset dir="${classes}">
    <include name="**/*Stats.class"/>
Previous page Next page