protected void registerCommitSessionValve() { if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Registering CommitSessionValve"); } commitSessionValve = new CommitSessionValve(); getPipeline().addValve(commitSessionValve); }
protected void unregisterJvmRouteBinderValve() { if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Unregistering JVM route binder valve"); } if (jvmRouteBinderValve != null) { getPipeline().removeValve(jvmRouteBinderValve); } }
Context context = request.getContext(); if( context.getLoader() != null ) { (context.getLoader().getClassLoader()); context.getPipeline().getFirst().event(request, response, event); response.setSuspended(false); Throwable t = (Throwable) request.getAttribute( RequestDispatcher.ERROR_EXCEPTION); request.getSession(false);
/** * Select the appropriate child Host to process this request, * based on the requested server name. If no matching Host can * be found, return an appropriate HTTP error. * * @param request Request to be processed * @param response Response to be produced * * @exception IOException if an input/output error occurred * @exception ServletException if a servlet error occurred */ @Override public final void invoke(Request request, Response response) throws IOException, ServletException { // Select the Host to be used for this Request Host host = request.getHost(); if (host == null) { response.sendError (HttpServletResponse.SC_BAD_REQUEST, sm.getString("standardEngine.noHost", request.getServerName())); return; } if (request.isAsyncSupported()) { request.setAsyncSupported(host.getPipeline().isAsyncSupported()); } // Ask this Host to process this request host.getPipeline().getFirst().invoke(request, response); }
Container parent = context.getParent(); while ((sso == null) && (parent != null)) { Valve valves[] = parent.getPipeline().getValves(); for (int i = 0; i < valves.length; i++) { if (valves[i] instanceof SingleSignOn) { parent = parent.getParent(); if (log.isDebugEnabled()) { if (sso != null) log.debug("Found SingleSignOn Valve at " + sso); else log.debug("No SingleSignOn Valve is present");
MessageBytes requestPathMB = request.getRequestPathMB(); if ((requestPathMB.startsWithIgnoreCase("/META-INF/", 0)) || (requestPathMB.equalsIgnoreCase("/META-INF")) || (requestPathMB.startsWithIgnoreCase("/WEB-INF/", 0)) || (requestPathMB.equalsIgnoreCase("/WEB-INF"))) { response.sendError(HttpServletResponse.SC_NOT_FOUND); return; Wrapper wrapper = request.getWrapper(); if (wrapper == null || wrapper.isUnavailable()) { response.sendError(HttpServletResponse.SC_NOT_FOUND); return; response.sendAcknowledgement(); } catch (IOException ioe) { container.getLogger().error(sm.getString( "standardContextValve.acknowledgeException"), ioe); request.setAttribute(RequestDispatcher.ERROR_EXCEPTION, ioe); response.sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); return; if (request.isAsyncSupported()) { request.setAsyncSupported(wrapper.getPipeline().isAsyncSupported()); wrapper.getPipeline().getFirst().invoke(request, response);
/** * Create a new StandardEngine component with the default basic Valve. */ public StandardEngine() { super(); pipeline.setBasic(new StandardEngineValve()); /* Set the jmvRoute using the system property jvmRoute */ try { setJvmRoute(System.getProperty("jvmRoute")); } catch(Exception ex) { log.warn(sm.getString("standardEngine.jvmRouteFail")); } // By default, the engine will hold the reloading thread backgroundProcessorDelay = 10; }
context.setWebappVersion("3.1"); context.setName("Oryx"); context.addWelcomeFile("index.html"); addErrorPages(context); authenticator.setNonceValidity(10 * 1000L); // Shorten from 5 minutes to 10 seconds authenticator.setNonceCacheSize(20000); // Increase from 1000 to 20000 context.getPipeline().addValve(authenticator);
public void shutdown() { _log.info( "Stopping services." ); _manager.getContext().getParent().getPipeline().removeValve(_trackingHostValve); _manager.getContext().getPipeline().removeValve(_trackingContextValve); _backupSessionService.shutdown(); if ( _lockingStrategy != null ) { _lockingStrategy.shutdown(); } if ( _storage != null ) { _storage.shutdown(); _storage = null; } _transcoderFactory = null; _invalidSessionsCache.clear(); }
Context context = request.getContext(); if (context == null) { response.sendError (HttpServletResponse.SC_INTERNAL_SERVER_ERROR, sm.getString("standardHost.noContext")); if( context.getLoader() != null ) { (context.getLoader().getClassLoader()); context.getPipeline().getFirst().invoke(request, response); response.setSuspended(false); Throwable t = (Throwable) request.getAttribute(Globals.EXCEPTION_ATTR);
@Override protected synchronized void startInternal() throws LifecycleException { super.startInternal(); try { this._client = buildClient(); } catch (Throwable t) { log.fatal("Unable to load serializer", t); throw new LifecycleException(t); } this.requestValve = new RedisSessionRequestValve(this, ignorePattern); getContext().getParent().getPipeline().addValve(requestValve); this.sessionExpirationTime = getContext().getSessionTimeout(); if (this.sessionExpirationTime < 0) { log.warn("Ignoring negative session expiration time"); this.sessionExpirationTime = 0; } log.info("Will expire sessions after " + sessionExpirationTime + " minutes"); setState(LifecycleState.STARTING); }
_log.info( getClass().getSimpleName() + " starts initialization... (configured" + " nodes definition " + _memcachedNodes + ", failover nodes " + _failoverNodes + ")" ); _trackingHostValve = createRequestTrackingHostValve(sessionCookieName, _currentRequest); final Context context = _manager.getContext(); context.getParent().getPipeline().addValve(_trackingHostValve); _trackingContextValve = createRequestTrackingContextValve(sessionCookieName); context.getPipeline().addValve( _trackingContextValve ); _backupThreadCount, _storage, _memcachedNodesManager, _statistics ); _log.info( "--------\n- " + getClass().getSimpleName() + " finished initialization:" + "\n- sticky: "+ _sticky + "\n- operation timeout: " + _operationTimeout +
/** * Select the appropriate child Host to process this request, * based on the requested server name. If no matching Host can * be found, return an appropriate HTTP error. * * @param request Request to be processed * @param response Response to be produced * @param valveContext Valve context used to forward to the next Valve * * @exception IOException if an input/output error occurred * @exception ServletException if a servlet error occurred */ public final void invoke(Request request, Response response) throws IOException, ServletException { // Select the Host to be used for this Request Host host = request.getHost(); if (host == null) { response.sendError (HttpServletResponse.SC_BAD_REQUEST, MESSAGES.noHost(request.getServerName())); return; } // Ask this Host to process this request host.getPipeline().getFirst().invoke(request, response); }
/** * register all cluster valve to host or engine */ protected void registerClusterValve() { if(container != null ) { for (Valve v : valves) { ClusterValve valve = (ClusterValve) v; if (log.isDebugEnabled()) log.debug("Invoking addValve on " + getContainer() + " with class=" + valve.getClass().getName()); if (valve != null) { container.getPipeline().addValve(valve); valve.setCluster(this); } } } }
this.context = context; if (context != null) { this.servletContext = context.getServletContext(); Pipeline p = context.getParent().getPipeline(); if (p != null) { hostValve = p.getBasic(); setCharacterEncoding(reqEncoding); getResponse().getResponse().setCharacterEncoding(resEncoding); initSessionTracker();
/** * unregister all cluster valve to host or engine */ protected void unregisterClusterValve() { for (Valve v : valves) { ClusterValve valve = (ClusterValve) v; if (log.isDebugEnabled()) log.debug("Invoking removeValve on " + getContainer() + " with class=" + valve.getClass().getName()); if (valve != null) { container.getPipeline().removeValve(valve); valve.setCluster(null); } } }
embeddedContext.setFailCtxIfServletStartFails(true); context.addServletContainerInitializer(starter, NO_CLASSES); for (LifecycleListener lifecycleListener : this.contextLifecycleListeners) { context.addLifecycleListener(lifecycleListener); context.getPipeline().addValve(valve);
@Override public void setWrapper(Wrapper wrapper) { Valve valve = createValve(); if (wrapper != null) { host = (Host) wrapper.getParent().getParent(); Engine engine = (Engine) host.getParent(); Service service = engine.getService(); connectors = service.findConnectors(); try { deployerOName = new ObjectName(host.getParent().getName() + ":type=Deployer,host=" + host.getName()); } catch (MalformedObjectNameException e) { logger.trace("", e); } host.getPipeline().addValve(valve); mbeanServer = ManagementFactory.getPlatformMBeanServer(); } else if (host != null) { host.getPipeline().removeValve(valve); } }
Container parent = request.getContext().getParent(); while ((sso == null) && (parent != null)) parent = parent.getParent(); continue; Valve valves[] = ((Pipeline) parent).getValves(); for (int i = 0; i < valves.length; i++) parent = parent.getParent();
private void configureEngine(Engine engine) { engine.setBackgroundProcessorDelay(this.backgroundProcessorDelay); for (Valve valve : this.engineValves) { engine.getPipeline().addValve(valve); } }