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.
@ParameterSetInterface("ExecutorStats")
@Description("Thread-pool task execution statistics")
@SNMPOIDSuffix("@oid.parameter-set-types.core-util.ExecutorStats@")
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.
<oc:update-bytecode>
<replaceproperties annotations="true"/>
<fileset dir="${classes}">
<include name="**/*Stats.class"/>
</fileset>
</oc:update-bytecode>