@Test public final void testRequestIsMarkedAsProcessed() throws IOException, ServletException { _sessionTrackerValve.invoke( _request, _response ); verify(_request).setNote(eq(RequestTrackingHostValve.REQUEST_PROCESSED), eq(Boolean.TRUE)); }
@Override public void invoke( final Request request, final Response response ) throws IOException, ServletException { final Object processRequest = request.getNote(RequestTrackingHostValve.REQUEST_PROCESS); if(processRequest != Boolean.TRUE) { request.setNote(INVOKED, Boolean.TRUE); try { getNext().invoke( request, response ); } finally { request.setNote(RequestTrackingHostValve.REQUEST_PROCESSED, Boolean.TRUE); } } else { boolean sessionIdChanged = false; try { request.setNote(INVOKED, Boolean.TRUE); sessionIdChanged = changeRequestedSessionId( request, response ); getNext().invoke( request, response ); } finally { request.setNote(RequestTrackingHostValve.REQUEST_PROCESSED, Boolean.TRUE); request.setNote(RequestTrackingHostValve.SESSION_ID_CHANGED, Boolean.valueOf(sessionIdChanged)); } } }
RequestTrackingContextValve extends ValveBase { @Override public void invoke( final Request request, final Response response ) throws IOException, ServletException { final Object processRequest = request.getNote(RequestTrackingHostValve.REQUEST_PROCESS); if(processRequest != Boolean.TRUE) { request.setNote(INVOKED, Boolean.TRUE); try { getNext().invoke( request, response ); } finally { request.setNote(RequestTrackingHostValve.REQUEST_PROCESSED, Boolean.TRUE); } } else { boolean sessionIdChanged = false; try { request.setNote(INVOKED, Boolean.TRUE); sessionIdChanged = changeRequestedSessionId( request, response ); getNext().invoke( request, response ); } finally { request.setNote(RequestTrackingHostValve.REQUEST_PROCESSED, Boolean.TRUE); request.setNote(RequestTrackingHostValve.SESSION_ID_CHANGED, Boolean.valueOf(sessionIdChanged)); } } } }
RequestTrackingContextValve extends ValveBase { @Override public void invoke( final Request request, final Response response ) throws IOException, ServletException { final Object processRequest = request.getNote(RequestTrackingHostValve.REQUEST_PROCESS); if(processRequest != Boolean.TRUE) { request.setNote(INVOKED, Boolean.TRUE); try { getNext().invoke( request, response ); } finally { request.setNote(RequestTrackingHostValve.REQUEST_PROCESSED, Boolean.TRUE); } } else { boolean sessionIdChanged = false; try { request.setNote(INVOKED, Boolean.TRUE); sessionIdChanged = changeRequestedSessionId( request, response ); getNext().invoke( request, response ); } finally { request.setNote(RequestTrackingHostValve.REQUEST_PROCESSED, Boolean.TRUE); request.setNote(RequestTrackingHostValve.SESSION_ID_CHANGED, Boolean.valueOf(sessionIdChanged)); } } } RequestTrackingContextValve( @Nonnull final String sessionCookieName,
            @Nonnull final MemcachedSessionService sessionBackupService ); }
RequestTrackingContextValve extends ValveBase { @Override public void invoke( final Request request, final Response response ) throws IOException, ServletException { final Object processRequest = request.getNote(RequestTrackingHostValve.REQUEST_PROCESS); if(processRequest != Boolean.TRUE) { request.setNote(INVOKED, Boolean.TRUE); try { getNext().invoke( request, response ); } finally { request.setNote(RequestTrackingHostValve.REQUEST_PROCESSED, Boolean.TRUE); } } else { boolean sessionIdChanged = false; try { request.setNote(INVOKED, Boolean.TRUE); sessionIdChanged = changeRequestedSessionId( request, response ); getNext().invoke( request, response ); } finally { request.setNote(RequestTrackingHostValve.REQUEST_PROCESSED, Boolean.TRUE); request.setNote(RequestTrackingHostValve.SESSION_ID_CHANGED, Boolean.valueOf(sessionIdChanged)); } } } RequestTrackingContextValve( @Nonnull final String sessionCookieName,
            @Nonnull final MemcachedSessionService sessionBackupService ); boolean wasInvokedWith(final Request currentRequest); @Override void invoke( final Request request, final Response response ); }
RequestTrackingContextValve extends ValveBase { @Override public void invoke( final Request request, final Response response ) throws IOException, ServletException { final Object processRequest = request.getNote(RequestTrackingHostValve.REQUEST_PROCESS); if(processRequest != Boolean.TRUE) { request.setNote(INVOKED, Boolean.TRUE); try { getNext().invoke( request, response ); } finally { request.setNote(RequestTrackingHostValve.REQUEST_PROCESSED, Boolean.TRUE); } } else { boolean sessionIdChanged = false; try { request.setNote(INVOKED, Boolean.TRUE); sessionIdChanged = changeRequestedSessionId( request, response ); getNext().invoke( request, response ); } finally { request.setNote(RequestTrackingHostValve.REQUEST_PROCESSED, Boolean.TRUE); request.setNote(RequestTrackingHostValve.SESSION_ID_CHANGED, Boolean.valueOf(sessionIdChanged)); } } } RequestTrackingContextValve( @Nonnull final String sessionCookieName,
            @Nonnull final MemcachedSessionService sessionBackupService ); boolean wasInvokedWith(final Request currentRequest); @Override void invoke( final Request request, final Response response );  }