SimpleTimer.addPeriodicEvent(
"ProtocolDecoder:timeouts",
5000,
new TimerEventPerformer() {
public void perform( TimerEvent ev ) {
loop++;
long now = SystemTime.getCurrentTime();
try{
class_mon.enter();
if ( loop % LOG_TICKS == 0 ){
if (Logger.isEnabled()){
if ( decoders.size() > 0 ){
Logger.log( new LogEvent(LOGID, "Active protocol decoders = " + decoders.size()));
}
}
}
Iterator it = decoders.iterator();
while( it.hasNext()){
ProtocolDecoder decoder = (ProtocolDecoder)it.next();
if ( decoder.isComplete( now )){
it.remove();
}
}
}finally{
class_mon.exit();
}
}
}
);
if ( run_timer ){
try{
class_mon.enter();
decoders.add( this );
}finally{
class_mon.exit();
}
}