Updated idle timeout checking.

Now that applications are notified in a different thread, idleness becomes an event
and therefore a new IdleListener interface has been introduced and implemented.
This commit is contained in:
Simone Bordet 2012-03-01 15:02:35 +01:00
parent e8d09fad53
commit 0161f780c9

View File

@ -46,7 +46,7 @@ public class AsyncTimeoutTest
Executor threadPool = Executors.newCachedThreadPool();
ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
Generator generator = new Generator(new StandardCompressionFactory.StandardCompressor());
Session session = new StandardSession(SPDY.V2, threadPool, scheduler, new TestController(), null, 1, null, generator)
Session session = new StandardSession(SPDY.V2, threadPool, scheduler, new TestController(), new TestIdleListener(), 1, null, generator)
{
@Override
public void flush()
@ -90,7 +90,7 @@ public class AsyncTimeoutTest
Executor threadPool = Executors.newCachedThreadPool();
ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor();
Generator generator = new Generator(new StandardCompressionFactory.StandardCompressor());
Session session = new StandardSession(SPDY.V2, threadPool, scheduler, new TestController(), null, 1, null, generator)
Session session = new StandardSession(SPDY.V2, threadPool, scheduler, new TestController(), new TestIdleListener(), 1, null, generator)
{
private final AtomicInteger flushes = new AtomicInteger();
@ -144,4 +144,12 @@ public class AsyncTimeoutTest
{
}
}
private static class TestIdleListener implements IdleListener
{
@Override
public void onIdle(boolean idle)
{
}
}
}