SnmpTimerServerpublic final class SnmpTimerServer extends Thread This class retries any timed out inform requests. This class is for internal use. |
Fields Summary |
---|
private SnmpInformRequest | req | SnmpQManager | snmpq | String | dbgTag | boolean | isBeingDestroyed |
Constructors Summary |
---|
public SnmpTimerServer(ThreadGroup grp, SnmpQManager q)
// CONSTRUCTORS
//-------------
super(grp, "SnmpTimerServer") ;
setName(dbgTag) ;
snmpq = q ;
start() ;
|
Methods Summary |
---|
void | debug(java.lang.String func, java.lang.String info)
debug(dbgTag, func, info);
| void | debug(java.lang.String func, java.lang.Throwable exception)
debug(dbgTag, func, exception);
| void | debug(java.lang.String clz, java.lang.String func, java.lang.String info)
Trace.send(Trace.LEVEL_DEBUG, Trace.INFO_ADAPTOR_SNMP, clz, func, info);
| void | debug(java.lang.String clz, java.lang.String func, java.lang.Throwable exception)
Trace.send(Trace.LEVEL_DEBUG, Trace.INFO_ADAPTOR_SNMP, clz, func, exception);
| boolean | isDebugOn()
return Trace.isSelected(Trace.LEVEL_DEBUG, Trace.INFO_ADAPTOR_SNMP);
| boolean | isTraceOn()
return Trace.isSelected(Trace.LEVEL_TRACE, Trace.INFO_ADAPTOR_SNMP);
| public void | run()
Thread.currentThread().setPriority(Thread.NORM_PRIORITY);
if (isTraceOn()) {
trace("run", "Timer Thread started");
}
while (true) {
try {
if (isTraceOn()) {
trace("run", "Blocking for inform requests");
}
if (req == null) {
req = snmpq.getTimeoutRequests() ;
}
if (req != null && req.inProgress()) {
if (isTraceOn()) {
trace("run", "Handle timeout inform request " + req.getRequestId());
}
req.action() ;
req = null ;
}
if (isBeingDestroyed == true)
break;
} catch (Exception e) {
if (isDebugOn()) {
debug("run", e.getMessage());
}
} catch (ThreadDeath d) {
if (isDebugOn()) {
debug("run", "Timer server unexpectedly shutting down");
debug("run", d);
}
throw d ;
} catch (OutOfMemoryError ome) {
if (isDebugOn()) {
debug("run", "Received OutOfMemory");
}
yield();
} catch (Error err) {
if (isDebugOn()) {
debug("run", "Received Internal error");
debug("run", err);
}
}
}
| public synchronized void | stopTimerServer()
if (isAlive()) {
interrupt();
try {
// Wait until the thread die.
//
join();
} catch (InterruptedException e) {
// Ignore...
}
}
| void | trace(java.lang.String clz, java.lang.String func, java.lang.String info)
Trace.send(Trace.LEVEL_TRACE, Trace.INFO_ADAPTOR_SNMP, clz, func, info);
| void | trace(java.lang.String func, java.lang.String info)
trace(dbgTag, func, info);
|
|