[SNMP4J] How to stop/restart BaseAgent?

Mark Gorokhov mark.gorokhov at comtechmobile.com
Tue Mar 11 18:31:40 CET 2008


The method BaseAgent.stop() stops the 'session' and sets it to null. 

Restarting the agent BaseAgent.run() from STATE_STOPPED recreates the
'session' object.

The following objects 
    SnmpTargetMIB
    NotificationOriginatorImpl
    ProxyForwarderImpl 
are created in BaseAgent with 'session' object as a parameter in their
constructors and hold the reference to the original 'session' which is
stopped and is not valid.

Is this correct?

I think that BaseAgent.initSnmpSession() should propagate new active
'session' into the above mentioned classes (and probably somewhere else)
and replace stopped 'session'. This simple task requires missing
setSession() in these classes.

Mark




More information about the SNMP4J mailing list