本文整理了Java中org.apache.catalina.Pipeline.addValve()
方法的一些代码示例,展示了Pipeline.addValve()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Pipeline.addValve()
方法的具体详情如下:
包路径:org.apache.catalina.Pipeline
类名称:Pipeline
方法名:addValve
[英]Add a new Valve to the end of the pipeline associated with this Container. Prior to adding the Valve, the Valve's setContainer()
method will be called, if it implements Contained
, with the owning Container as an argument. The method may throw an IllegalArgumentException
if this Valve chooses not to be associated with this Container, or IllegalStateException
if it is already associated with a different Container.
Implementation note: Implementations are expected to trigger the Container#ADD_VALVE_EVENT for the associated container if this call is successful.
[中]在与此容器相关联的管道末端添加一个新阀门。在添加阀门之前,如果阀门实现了Contained
,将调用阀门的setContainer()
方法,并将拥有的容器作为参数。如果此阀门选择不与此容器关联,则该方法可能抛出IllegalArgumentException
,如果它已与其他容器关联,则可能抛出IllegalStateException
。
实现说明:如果此调用成功,则实现将触发相关容器的容器#ADD_VALVE_事件。
代码示例来源:origin: org.springframework.boot/spring-boot
private void configureEngine(Engine engine) {
engine.setBackgroundProcessorDelay(this.backgroundProcessorDelay);
for (Valve valve : this.engineValves) {
engine.getPipeline().addValve(valve);
}
}
代码示例来源:origin: org.springframework.boot/spring-boot
private void configureEngine(Engine engine) {
engine.setBackgroundProcessorDelay(this.backgroundProcessorDelay);
for (Valve valve : this.engineValves) {
engine.getPipeline().addValve(valve);
}
}
代码示例来源:origin: redisson/redisson
getEngine().getPipeline().addValve(new UpdateValve(this));
代码示例来源:origin: redisson/redisson
getEngine().getPipeline().addValve(new UpdateValve(this));
代码示例来源:origin: redisson/redisson
getEngine().getPipeline().addValve(new UpdateValve(this));
代码示例来源:origin: redisson/redisson
getEngine().getPipeline().addValve(new UpdateValve(this));
代码示例来源:origin: SonarSource/sonarqube
@Test
public void enable_access_logs_by_Default() throws Exception {
Tomcat tomcat = mock(Tomcat.class, Mockito.RETURNS_DEEP_STUBS);
Props props = new Props(new Properties());
props.set(PATH_LOGS.getKey(), temp.newFolder().getAbsolutePath());
underTest.configure(tomcat, props);
verify(tomcat.getHost().getPipeline()).addValve(any(ProgrammaticLogbackValve.class));
}
代码示例来源:origin: apache/geode
protected void registerJvmRouteBinderValve() {
if (getLogger().isDebugEnabled()) {
getLogger().debug(this + ": Registering JVM route binder valve");
}
jvmRouteBinderValve = new JvmRouteBinderValve();
getPipeline().addValve(jvmRouteBinderValve);
}
代码示例来源:origin: apache/geode
protected void registerCommitSessionValve() {
if (getLogger().isDebugEnabled()) {
getLogger().debug(this + ": Registering CommitSessionValve");
}
commitSessionValve = new CommitSessionValve();
getPipeline().addValve(commitSessionValve);
}
代码示例来源:origin: OryxProject/oryx
authenticator.setNonceValidity(10 * 1000L); // Shorten from 5 minutes to 10 seconds
authenticator.setNonceCacheSize(20000); // Increase from 1000 to 20000
context.getPipeline().addValve(authenticator);
代码示例来源:origin: SonarSource/sonarqube
private static void configureLogbackAccess(Tomcat tomcat, Props props) {
if (props.valueAsBoolean(PROPERTY_ENABLE, true)) {
ProgrammaticLogbackValve valve = new ProgrammaticLogbackValve();
LogbackHelper helper = new LogbackHelper();
LogbackHelper.RollingPolicy policy = helper.createRollingPolicy(valve, props, "access");
FileAppender appender = policy.createAppender("ACCESS_LOG");
PatternLayoutEncoder fileEncoder = new PatternLayoutEncoder();
fileEncoder.setContext(valve);
fileEncoder.setPattern(props.value(PROPERTY_PATTERN, DEFAULT_SQ_ACCESS_LOG_PATTERN));
fileEncoder.start();
appender.setEncoder(fileEncoder);
appender.start();
valve.addAppender(appender);
tomcat.getHost().getPipeline().addValve(valve);
}
}
代码示例来源:origin: org.springframework.boot/spring-boot
context.getPipeline().addValve(valve);
代码示例来源:origin: psi-probe/psi-probe
@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);
}
}
代码示例来源:origin: magro/memcached-session-manager
_trackingHostValve = createRequestTrackingHostValve(sessionCookieName, _currentRequest);
final Context context = _manager.getContext();
context.getParent().getPipeline().addValve(_trackingHostValve);
_trackingContextValve = createRequestTrackingContextValve(sessionCookieName);
context.getPipeline().addValve( _trackingContextValve );
代码示例来源:origin: org.glassfish.main.web/web-core
/**
* Add Tomcat-style valve.
*/
public synchronized void addValve(Valve valve) {
pipeline.addValve(valve);
if (notifyContainerListeners) {
fireContainerEvent(ADD_VALVE_EVENT, valve);
}
}
代码示例来源:origin: org.glassfish.web/web-glue
/**
* Adds the given Tomcat-style valve to the currently active pipeline,
* keeping the pipeline that is not currently active in sync.
*/
public synchronized void addValve(Valve valve) {
super.addValve(valve);
if (pipeline == vsPipeline) {
origPipeline.addValve(valve);
} else {
vsPipeline.addValve(valve);
}
}
代码示例来源:origin: org.glassfish.web/web-glue
/**
* Adds the given valve to the currently active pipeline, keeping the
* pipeline that is not currently active in sync.
*/
public synchronized void addValve(GlassFishValve valve) {
super.addValve(valve);
if (pipeline == vsPipeline) {
origPipeline.addValve(valve);
} else {
vsPipeline.addValve(valve);
}
}
代码示例来源:origin: org.apache.geode/geode-modules
protected void registerJvmRouteBinderValve() {
if (getLogger().isDebugEnabled()) {
getLogger().debug(this + ": Registering JVM route binder valve");
}
jvmRouteBinderValve = new JvmRouteBinderValve();
getPipeline().addValve(jvmRouteBinderValve);
}
代码示例来源:origin: org.apache.geode/geode-modules
protected void registerCommitSessionValve() {
if (getLogger().isDebugEnabled()) {
getLogger().debug(this + ": Registering CommitSessionValve");
}
commitSessionValve = new CommitSessionValve();
getPipeline().addValve(commitSessionValve);
}
代码示例来源:origin: justlive1/oxygen
private void configEngine(Engine engine, TomcatConf tomcatConf) {
engine.setBackgroundProcessorDelay(tomcatConf.getBackgroundProcessorDelay());
if (tomcatConf.isAccessLogEnabled()) {
AccessLogValve value = new AccessLogValve();
value.setBuffered(tomcatConf.isAccessLogBuffered());
value.setFileDateFormat(tomcatConf.getAccessLogFileFormat());
value.setRequestAttributesEnabled(tomcatConf.isAccessLogRequestAttributesEnabled());
value.setPattern(tomcatConf.getAccessLogPattern());
engine.getPipeline().addValve(value);
}
}
内容来源于网络,如有侵权,请联系作者删除!