@Test public void onPostAddShouldSetIdleTimeout() throws Exception { Mockery context = new Mockery(); final NextFilter nextFilter = context.mock(NextFilter.class); final IoSessionEx session = context.mock(IoSessionEx.class); final IoFilterChain filterChain = context.mock(IoFilterChain.class); final IoSessionConfigEx config = context.mock(IoSessionConfigEx.class); context.checking(new Expectations() { { oneOf(filterChain).getSession(); will(returnValue(session)); oneOf(session).getConfig(); will(returnValue(config)); oneOf(config).setIdleTimeInMillis(IdleStatus.WRITER_IDLE, 100 - 100/4); } }); IdleTimeoutFilter filter = new IdleTimeoutFilter(100); filter.onPostAdd(filterChain, "test", nextFilter); context.assertIsSatisfied(); }
@Override public void onPostAdd(IoFilterChain filterChain, String name, NextFilter nextFilter) throws Exception { schedulePong((IoSessionEx)filterChain.getSession()); }
IdleTimeoutFilter extends IoFilterAdapter<IoSessionEx> { @Override public void onPostAdd(IoFilterChain filterChain, String name, NextFilter nextFilter) throws Exception { schedulePong((IoSessionEx)filterChain.getSession()); } }
IdleTimeoutFilter extends IoFilterAdapter<IoSessionEx> { @Override public void onPostAdd(IoFilterChain filterChain, String name, NextFilter nextFilter) throws Exception { schedulePong((IoSessionEx)filterChain.getSession()); } IdleTimeoutFilter(long inactivityTimeout); }
IdleTimeoutFilter extends IoFilterAdapter<IoSessionEx> { @Override public void onPostAdd(IoFilterChain filterChain, String name, NextFilter nextFilter) throws Exception { schedulePong((IoSessionEx)filterChain.getSession()); } IdleTimeoutFilter(long inactivityTimeout); @Override void onPostAdd(IoFilterChain filterChain, String name, NextFilter nextFilter); }
IdleTimeoutFilter extends IoFilterAdapter<IoSessionEx> { @Override public void onPostAdd(IoFilterChain filterChain, String name, NextFilter nextFilter) throws Exception { schedulePong((IoSessionEx)filterChain.getSession()); } IdleTimeoutFilter(long inactivityTimeout); @Override void onPostAdd(IoFilterChain filterChain, String name, NextFilter nextFilter);  }