protected void unregisterJvmRouteBinderValve() { if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Unregistering JVM route binder valve"); } if (jvmRouteBinderValve != null) { getPipeline().removeValve(jvmRouteBinderValve); } }
protected void unregisterCommitSessionValve() { if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Unregistering CommitSessionValve"); } if (commitSessionValve != null) { getPipeline().removeValve(commitSessionValve); } }
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(); }
@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); } }
/** * Remove the specified Valve from the pipeline associated with this * Container, if it is found; otherwise, do nothing. * * @param valve Valve to be removed */ public synchronized void removeValve(Valve valve) { pipeline.removeValve(valve); fireContainerEvent(REMOVE_VALVE_EVENT, valve); }
/** * Remove the specified Valve from the pipeline associated with this * Container, if it is found; otherwise, do nothing. * * @param valve Valve to be removed */ public synchronized void removeValve(Valve valve) { pipeline.removeValve(valve); fireContainerEvent(REMOVE_VALVE_EVENT, valve); }
/** * Remove the specified Valve from the pipeline associated with this * Container, if it is found; otherwise, do nothing. * * @param valve Valve to be removed */ public synchronized void removeValve(Valve valve) { pipeline.removeValve(valve); fireContainerEvent(REMOVE_VALVE_EVENT, valve); }
/** * Remove the specified Valve from the pipeline associated with this * Container, if it is found; otherwise, do nothing. * * @param valve Valve to be removed */ public synchronized void removeValve(GlassFishValve valve) { pipeline.removeValve(valve); if (notifyContainerListeners) { fireContainerEvent(REMOVE_VALVE_EVENT, valve); } }
/** * Removes the given valve from the currently active pipeline, keeping the * valve that is not currently active in sync. */ public synchronized void removeValve(GlassFishValve valve) { super.removeValve(valve); if (pipeline == vsPipeline) { origPipeline.removeValve(valve); } else { vsPipeline.removeValve(valve); } }
@Override public void removeRequestListener(ServletRequestListener listener) { if (this.valveFactory != null) { Valve listenerValve = this.valveFactory.createValve(listener); Pipeline pipeline = this.context.getPipeline(); for (Valve valve : pipeline.getValves()) { if (listenerValve.equals(valve)) { pipeline.removeValve(valve); break; } } } }
/** * {@inheritDoc} * @see org.jboss.modcluster.Context#removeRequestListener(javax.servlet.ServletRequestListener) */ public void removeRequestListener(ServletRequestListener listener) { Valve listenerValve = new RequestListenerValve(listener); Pipeline pipeline = this.context.getPipeline(); for (Valve valve: pipeline.getValves()) { if (listenerValve.equals(valve)) { pipeline.removeValve(valve); return; } } }
/** * 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); } } }
/** * Remove an existing Valve. * * @param name MBean Name of the component to remove * * @exception Exception if a component cannot be removed */ public void removeValve(String name) throws Exception { // Acquire a reference to the component to be removed ObjectName oname = new ObjectName(name); Container container = getParentContainerFromChild(oname); Valve[] valves = container.getPipeline().getValves(); for (int i = 0; i < valves.length; i++) { ObjectName voname = ((JmxEnabled) valves[i]).getObjectName(); if (voname.equals(oname)) { container.getPipeline().removeValve(valves[i]); } } }
protected void unregisterJvmRouteBinderValve() { if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Unregistering JVM route binder valve"); } if (jvmRouteBinderValve != null) { getPipeline().removeValve(jvmRouteBinderValve); } }
protected void unregisterCommitSessionValve() { if (getLogger().isDebugEnabled()) { getLogger().debug(this + ": Unregistering CommitSessionValve"); } if (commitSessionValve != null) { getPipeline().removeValve(commitSessionValve); } }
/** * Remove an existing Valve. * * @param name MBean Name of the component to remove * * @exception Exception if a component cannot be removed */ public void removeValve(String name) throws Exception { // Acquire a reference to the component to be removed ObjectName oname = new ObjectName(name); ContainerBase container = getParentContainerFromChild(oname); Valve[] valves = container.getPipeline().getValves(); for (int i = 0; i < valves.length; i++) { ObjectName voname = ((ValveBase) valves[i]).getObjectName(); if (voname.equals(oname)) { container.getPipeline().removeValve(valves[i]); } } }
/** * Remove an existing Valve. * * @param name MBean Name of the component to remove * * @exception Exception if a component cannot be removed */ public void removeValve(String name) throws Exception { // Acquire a reference to the component to be removed ObjectName oname = new ObjectName(name); Container container = getParentContainerFromChild(oname); Valve[] valves = container.getPipeline().getValves(); for (int i = 0; i < valves.length; i++) { ObjectName voname = ((JmxEnabled) valves[i]).getObjectName(); if (voname.equals(oname)) { container.getPipeline().removeValve(valves[i]); } } }
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(); }
@Test public void requestListener() throws IOException, ServletException { // Test addRequestListener() ServletRequestListener listener = mock(ServletRequestListener.class); Pipeline pipeline = mock(Pipeline.class); Valve valve = mock(Valve.class); when(this.context.getPipeline()).thenReturn(pipeline); when(this.valveFactory.createValve(same(listener))).thenReturn(valve); this.catalinaContext.addRequestListener(listener); verify(pipeline).addValve(same(valve)); // Test removeRequestListener() when(this.context.getPipeline()).thenReturn(pipeline); when(pipeline.getValves()).thenReturn(new Valve[] { valve }); when(this.valveFactory.createValve(same(listener))).thenReturn(valve); this.catalinaContext.removeRequestListener(listener); verify(pipeline).removeValve(same(valve)); }
@Override protected synchronized void stopInternal() throws LifecycleException { setState(LifecycleState.STOPPING); log.info("Stopping"); getContext().getParent().getPipeline().removeValve(requestValve); getClient().shutdown(); super.stopInternal(); }