@Override public void invoke(Request request, Response response) throws IOException, ServletException { // Get the Manager Manager manager = request.getContext().getManager(); // If it is an AbstractManager, handle possible failover if (manager instanceof DeltaSessionManager) { DeltaSessionManager absMgr = (DeltaSessionManager) manager; String localJvmRoute = absMgr.getJvmRoute(); if (localJvmRoute != null) { handlePossibleFailover(request, absMgr, localJvmRoute); } } // Invoke the next Valve getNext().invoke(request, response); }
@Override public void invoke(Request request, Response response) throws IOException, ServletException { String sessionId = request.getRequestedSessionId(); Session session = request.getContext().getManager().findSession(sessionId); if (session != null) { if (!session.isValid()) { session.expire(); request.getContext().getManager().remove(session); } else { manager.add(session); session.access(); session.endAccess(); } } try { getNext().invoke(request, response); } finally { manager.store(request.getSession(false)); } }
@Override public void invoke(Request request, Response response) throws IOException, ServletException { String sessionId = request.getRequestedSessionId(); Session session = request.getContext().getManager().findSession(sessionId); if (session != null) { if (!session.isValid()) { session.expire(); request.getContext().getManager().remove(session); } else { manager.add(session); session.access(); session.endAccess(); } } try { getNext().invoke(request, response); } finally { manager.store(request.getSession(false)); } }
@Override public void invoke(Request request, Response response) throws IOException, ServletException { String sessionId = request.getRequestedSessionId(); Session session = request.getContext().getManager().findSession(sessionId); if (session != null) { if (!session.isValid()) { session.expire(); request.getContext().getManager().remove(session); } else { manager.add(session); session.access(); session.endAccess(); } } try { getNext().invoke(request, response); } finally { manager.store(request.getSession(false)); } }
@Override public void invoke(Request request, Response response) throws IOException, ServletException { String sessionId = request.getRequestedSessionId(); Session session = request.getContext().getManager().findSession(sessionId); if (session != null) { if (!session.isValid()) { session.expire(); request.getContext().getManager().remove(session); } else { manager.add(session); session.access(); session.endAccess(); } } try { getNext().invoke(request, response); } finally { manager.store(request.getSession(false)); } }
@Override public void invoke(Request request, Response response) throws IOException, ServletException { Manager manager = request.getContext().getManager(); DeltaSessionFacade session = null;
@BeforeMethod public void setUp() throws Exception { _service = mock( MemcachedSessionService.class ); _request = mock( Request.class ); _response = mock( Response.class ); final Context _contextContainer = mock(Context.class); final Host _hostContainer = mock(Host.class); final SessionManager _manager = mock(SessionManager.class); when(_service.getManager()).thenReturn(_manager); when(_manager.getContext()).thenReturn(_contextContainer); when(_contextContainer.getParent()).thenReturn(_hostContainer); when(_contextContainer.getPath()).thenReturn("/"); _sessionTrackerValve = createSessionTrackerValve(); _nextValve = mock( Valve.class ); _sessionTrackerValve.setNext( _nextValve ); _sessionTrackerValve.setContainer(_hostContainer); when(_request.getRequestURI()).thenReturn( "/someRequest"); when(_request.getMethod()).thenReturn("GET"); when(_request.getQueryString()).thenReturn(null); when(_request.getContext()).thenReturn(_contextContainer); when(_request.getNote(eq(RequestTrackingHostValve.REQUEST_PROCESSED))).thenReturn(Boolean.TRUE); when(_request.getNote(eq(RequestTrackingHostValve.SESSION_ID_CHANGED))).thenReturn(Boolean.FALSE); }
/** * @return the Context within which this Request is being processed. */ public Context getContext() { return request.getContext(); }
/** * Return the Context within which this Request is being processed. */ public Context getContext() { return (request.getContext()); }
/** * Return the Context within which this Request is being processed. */ public Context getContext() { return (request.getContext()); }
/** * Return the Context within which this Request is being processed. */ public Context getContext() { return (request.getContext()); }
if(!_enabled.get() || !_msmContext.equals(request.getContext())) { getNext().invoke( request, response ); } else if ( _ignorePattern != null && _ignorePattern.matcher( requestId ).matches() ) {
@Override public ServletContext getServletContext() { return getContext().getServletContext(); }
/** * {@inheritDoc} */ @Override public boolean authenticate(HttpServletResponse response) throws IOException, ServletException { if (response.isCommitted()) { throw new IllegalStateException( sm.getString("coyoteRequest.authenticate.ise")); } return getContext().getAuthenticator().authenticate(this, response); }
/** * {@inheritDoc} */ @Override public void logout() throws ServletException { getContext().getAuthenticator().logout(this); }
/** * Check the configuration for aborted uploads and if configured to do so, * disable the swallowing of any remaining input and close the connection * once the response has been written. */ protected void checkSwallowInput() { Context context = getContext(); if (context != null && !context.getSwallowAbortedUploads()) { coyoteRequest.action(ActionCode.DISABLE_SWALLOW_INPUT, null); } }
/** * Method called by Tomcat < 8.5.5 */ public boolean authenticate(Request request, HttpServletResponse response) throws IOException { return authenticateInternal(request, response, request.getContext().getLoginConfig()); }
/** * Check the configuration for aborted uploads and if configured to do so, * disable the swallowing of any remaining input and close the connection * once the response has been written. */ protected void checkSwallowInput() { Context context = getContext(); if (context != null && !context.getSwallowAbortedUploads()) { coyoteRequest.action(ActionCode.DISABLE_SWALLOW_INPUT, null); } }
@Override public void addElement(CharArrayWriter buf, Date date, Request request, Response response, long time) { buf.append(wrap(request.getContext().getServletContext() .getAttribute(attribute))); } }
private void getReload(Request req, Response resp) { ClassLoader webLoader = req.getContext().getLoader().getClassLoader(); if (webLoader instanceof NuxeoDevWebappClassLoader) { NuxeoDevWebappClassLoader loader = (NuxeoDevWebappClassLoader) webLoader; // only if dev.bundles was modified loader.getBootstrap().loadDevBundles(); // log.error("###### reloaded dev bundles"); } resp.setStatus(200); }