Methods Summary |
---|
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);
|
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 | fireRequest(SnmpInformRequest req)This will fire the specified request.
if (req != null && req.inProgress()) {
if (isTraceOn()) {
trace("fireRequest", "Firing inform request directly. -> " + req.getRequestId());
}
req.action() ;
}
|
void | fireRequestList(java.util.Vector reqList)
// Fire all requests as independent requests.
while (!reqList.isEmpty()) {
SnmpInformRequest req = (SnmpInformRequest) reqList.lastElement() ;
if (req != null && req.inProgress())
fireRequest(req) ;
reqList.removeElementAt(reqList.size() - 1) ;
}
|
boolean | isDebugOn()
return Trace.isSelected(Trace.LEVEL_DEBUG, Trace.INFO_ADAPTOR_SNMP);
|
boolean | isTraceOn()
return Trace.isSelected(Trace.LEVEL_TRACE, Trace.INFO_ADAPTOR_SNMP);
|
private void | prepareAndSendRequest()
if (readyPool == null || readyPool.isEmpty()) {
// wait to be signaled by the an active request.
if (isTraceOn()) {
trace("prepareAndSendRequest", "Blocking for inform requests");
}
readyPool = snmpq.getAllOutstandingRequest(intervalRange) ;
if (isBeingDestroyed == true)
return;
} else {
if (isDebugOn()) {
debug("prepareAndSendRequest", "Inform requests from a previous block left unprocessed. Will try again");
}
}
if (isTraceOn()) {
trace("prepareAndSendRequest", "List of inform requests to send : " + reqListToString(readyPool));
}
synchronized(this) {
if (readyPool.size() < 2) {
// Fire all requests as independent requests.
fireRequestList(readyPool) ;
return ;
}
while (!readyPool.isEmpty()) {
SnmpInformRequest req = (SnmpInformRequest) readyPool.lastElement() ;
if (req != null && req.inProgress()) {
fireRequest(req) ;
}
readyPool.removeElementAt(readyPool.size() - 1) ;
}
readyPool.removeAllElements() ;
}
|
final java.lang.String | reqListToString(java.util.Vector vec)
StringBuffer s = new StringBuffer(vec.size() * 100) ;
Enumeration dbge = vec.elements() ;
while (dbge.hasMoreElements()) {
SnmpInformRequest reqc = (SnmpInformRequest) dbge.nextElement() ;
s.append("InformRequestId -> ") ;
s.append(reqc.getRequestId()) ;
s.append(" / Destination -> ") ;
s.append(reqc.getAddress()) ;
s.append(". ") ;
}
String str = s.toString() ;
s = null ;
return str ;
|
public void | run()
Thread.currentThread().setPriority(Thread.NORM_PRIORITY);
if (isTraceOn()) {
trace("run", "Thread Started");
}
while (true) {
try {
prepareAndSendRequest() ;
if (isBeingDestroyed == true)
break;
} catch (Exception anye) {
if (isDebugOn()) {
debug("run", "Exception in send server");
debug("run", anye);
}
} catch (ThreadDeath td) {
// This is not good but Netscape does kill all threads when
// the pagecontext changes.
if (isDebugOn()) {
debug("run", "Exiting... Fatal error");
}
throw td ;
} catch (OutOfMemoryError ome) {
if (isDebugOn()) {
debug("run", "Out of memory");
}
} catch (Error err) {
if (isDebugOn()) {
debug("run", err);
}
throw err ;
}
}
|
public synchronized void | stopSendServer()
if (isAlive()) {
interrupt();
try {
// Wait until the thread die.
//
join();
} catch (InterruptedException e) {
// Ignore...
}
}
|
void | trace(java.lang.String func, java.lang.String info)
trace(dbgTag, func, info);
|
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);
|