this.event = event;
}
public void run()
{
ScheduledFuture future = null;
try
{
future = scheduledExecutor.schedule(new Runnable()
{
public void run()
{
loggers.log(listener.reference, LogService.LOG_WARNING, "Listener timeout, will be blacklisted");
LOGGER.log(Level.WARNING, "Listener timeout, will be blacklisted");
remove(listener);
}
}, timeout, timeUnit);
listener.handleEvent(event);
}
catch (RejectedExecutionException ree)
{
loggers.log(listener.reference, LogService.LOG_WARNING, "Unable to schedule timeout for listener call, call skipped", ree);
LOGGER.log(Level.WARNING, "Unable to schedule timeout for listener call, call skipped", ree);
}
catch (Throwable t)
{
loggers.log(listener.reference, LogService.LOG_WARNING, "Listener threw exception", t);
LOGGER.log(Level.WARNING, "Listener threw exception", t);
}
finally
{
if (future != null) future.cancel(false);
if (latch != null) latch.countDown();
}
}