• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Pipeline类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.catalina.Pipeline的典型用法代码示例。如果您正苦于以下问题:Java Pipeline类的具体用法?Java Pipeline怎么用?Java Pipeline使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Pipeline类属于org.apache.catalina包,在下文中一共展示了Pipeline类的16个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: getAuthenticator

import org.apache.catalina.Pipeline; //导入依赖的package包/类
@Override
public Authenticator getAuthenticator() {
    if (this instanceof Authenticator)
        return (Authenticator) this;
    
    Pipeline pipeline = getPipeline();
    if (pipeline != null) {
        Valve basic = pipeline.getBasic();
        if ((basic != null) && (basic instanceof Authenticator))
            return (Authenticator) basic;
        Valve valves[] = pipeline.getValves();
        for (int i = 0; i < valves.length; i++) {
            if (valves[i] instanceof Authenticator)
                return (Authenticator) valves[i];
        }
    }
    return null;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:19,代码来源:StandardContext.java


示例2: getAuthenticator

import org.apache.catalina.Pipeline; //导入依赖的package包/类
@Override
public Authenticator getAuthenticator() {
	if (this instanceof Authenticator)
		return (Authenticator) this;

	Pipeline pipeline = getPipeline();
	if (pipeline != null) {
		Valve basic = pipeline.getBasic();
		if ((basic != null) && (basic instanceof Authenticator))
			return (Authenticator) basic;
		Valve valves[] = pipeline.getValves();
		for (int i = 0; i < valves.length; i++) {
			if (valves[i] instanceof Authenticator)
				return (Authenticator) valves[i];
		}
	}
	return null;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:19,代码来源:StandardContext.java


示例3: start

import org.apache.catalina.Pipeline; //导入依赖的package包/类
/**
 * Prepare for the beginning of active use of the public methods of this
 * component.  This method should be called after <code>configure()</code>,
 * and before any of the public methods of the component are utilized.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that prevents this component from being used
 */
public void start() throws LifecycleException {

    // Validate and update our current component state
    if (started)
        throw new LifecycleException
            (sm.getString("authenticator.alreadyStarted"));
    lifecycle.fireLifecycleEvent(START_EVENT, null);
    started = true;

    // Look up the SingleSignOn implementation in our request processing
    // path, if there is one
    Container parent = context.getParent();
    while ((sso == null) && (parent != null)) {
        if (!(parent instanceof Pipeline)) {
            parent = parent.getParent();
            continue;
        }
        Valve valves[] = ((Pipeline) parent).getValves();
        for (int i = 0; i < valves.length; i++) {
            if (valves[i] instanceof SingleSignOn) {
                sso = (SingleSignOn) valves[i];
                break;
            }
        }
        if (sso == null)
            parent = parent.getParent();
    }
    if (log.isDebugEnabled()) {
        if (sso != null)
            log.debug("Found SingleSignOn Valve at " + sso);
        else
            log.debug("No SingleSignOn Valve is present");
    }

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:44,代码来源:AuthenticatorBase.java


示例4: main

import org.apache.catalina.Pipeline; //导入依赖的package包/类
public static void main(String[] args) {

/* call by using http://localhost:8080/ModernServlet,
   but could be invoked by any name */

    HttpConnector connector = new HttpConnector();
    Wrapper wrapper = new SimpleWrapper();
    wrapper.setServletClass("ModernServlet");
    Loader loader = new SimpleLoader();
    Valve valve1 = new HeaderLoggerValve();
    Valve valve2 = new ClientIPLoggerValve();

    wrapper.setLoader(loader);
    ((Pipeline) wrapper).addValve(valve1);
    ((Pipeline) wrapper).addValve(valve2);

    connector.setContainer(wrapper);

    try {
      connector.initialize();
      connector.start();

      // make the application wait until we press a key.
      System.in.read();
    }
    catch (Exception e) {
      e.printStackTrace();
    }
  }
 
开发者ID:eclipsky,项目名称:HowTomcatWorks,代码行数:30,代码来源:Bootstrap1.java


示例5: main

import org.apache.catalina.Pipeline; //导入依赖的package包/类
public static void main(String[] args) {
  HttpConnector connector = new HttpConnector();
  Wrapper wrapper1 = new SimpleWrapper();
  wrapper1.setName("Primitive");
  wrapper1.setServletClass("PrimitiveServlet");
  Wrapper wrapper2 = new SimpleWrapper();
  wrapper2.setName("Modern");
  wrapper2.setServletClass("ModernServlet");

  Context context = new SimpleContext();
  context.addChild(wrapper1);
  context.addChild(wrapper2);

  Valve valve1 = new HeaderLoggerValve();
  Valve valve2 = new ClientIPLoggerValve();

  ((Pipeline) context).addValve(valve1);
  ((Pipeline) context).addValve(valve2);

  Mapper mapper = new SimpleContextMapper();
  mapper.setProtocol("http");
  context.addMapper(mapper);
  Loader loader = new SimpleLoader();
  context.setLoader(loader);
  // context.addServletMapping(pattern, name);
  context.addServletMapping("/Primitive", "Primitive");
  context.addServletMapping("/Modern", "Modern");
  connector.setContainer(context);
  try {
    connector.initialize();
    connector.start();

    // make the application wait until we press a key.
    System.in.read();
  }
  catch (Exception e) {
    e.printStackTrace();
  }
}
 
开发者ID:eclipsky,项目名称:HowTomcatWorks,代码行数:40,代码来源:Bootstrap2.java


示例6: configureStart

import org.apache.catalina.Pipeline; //导入依赖的package包/类
/**
 * Process a "contextConfig" event for this Context.
 */
protected synchronized void configureStart() {
    // Called from StandardContext.start()

    if (log.isDebugEnabled())
        log.debug(sm.getString("contextConfig.start"));

    if (log.isDebugEnabled()) {
        log.debug(sm.getString("contextConfig.xmlSettings",
                context.getName(),
                Boolean.valueOf(context.getXmlValidation()),
                Boolean.valueOf(context.getXmlNamespaceAware())));
    }

    webConfig();

    if (!context.getIgnoreAnnotations()) {
        applicationAnnotationsConfig();
    }
    if (ok) {
        validateSecurityRoles();
    }

    // Configure an authenticator if we need one
    if (ok)
        authenticatorConfig();

    // Dump the contents of this pipeline if requested
    if ((log.isDebugEnabled()) && (context instanceof ContainerBase)) {
        log.debug("Pipeline Configuration:");
        Pipeline pipeline = ((ContainerBase) context).getPipeline();
        Valve valves[] = null;
        if (pipeline != null)
            valves = pipeline.getValves();
        if (valves != null) {
            for (int i = 0; i < valves.length; i++) {
                log.debug("  " + valves[i].getInfo());
            }
        }
        log.debug("======================");
    }

    // Make our application available if no problems were encountered
    if (ok)
        context.setConfigured(true);
    else {
        log.error(sm.getString("contextConfig.unavailable"));
        context.setConfigured(false);
    }

}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:54,代码来源:ContextConfig.java


示例7: getPipeline

import org.apache.catalina.Pipeline; //导入依赖的package包/类
@Override
public Pipeline getPipeline() { return null; }
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:3,代码来源:FailedContext.java


示例8: getObjectNameKeyProperties

import org.apache.catalina.Pipeline; //导入依赖的package包/类
@Override
public String getObjectNameKeyProperties() {
    StringBuilder name = new StringBuilder("type=Valve");

    Container container = getContainer();

    name.append(MBeanUtils.getContainerKeyProperties(container));

    int seq = 0;

    // Pipeline may not be present in unit testing
    Pipeline p = container.getPipeline();
    if (p != null) {
        for (Valve valve : p.getValves()) {
            // Skip null valves
            if (valve == null) {
                continue;
            }
            // Only compare valves in pipeline until we find this valve
            if (valve == this) {
                break;
            }
            if (valve.getClass() == this.getClass()) {
                // Duplicate valve earlier in pipeline
                // increment sequence number
                seq ++;
            }
        }
    }

    if (seq > 0) {
        name.append(",seq=");
        name.append(seq);
    }

    String className = this.getClass().getName();
    int period = className.lastIndexOf('.');
    if (period >= 0) {
        className = className.substring(period + 1);
    }
    name.append(",name=");
    name.append(className);

    return name.toString();
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:46,代码来源:ValveBase.java


示例9: getPipeline

import org.apache.catalina.Pipeline; //导入依赖的package包/类
@Override
public Pipeline getPipeline() {
    return null;
}
 
开发者ID:liaokailin,项目名称:tomcat7,代码行数:5,代码来源:TesterContext.java


示例10: start

import org.apache.catalina.Pipeline; //导入依赖的package包/类
/**
 * Process a "start" event for this Context.
 */
protected synchronized void start() {
    // Called from StandardContext.start()

    if (log.isDebugEnabled())
        log.debug(sm.getString("contextConfig.start"));

    // Set properties based on DefaultContext
    Container container = context.getParent();
    if( !context.getOverride() ) {
        if( container instanceof Host ) {
            // Reset the value only if the attribute wasn't
            // set on the context.
            xmlValidation = context.getXmlValidation();
            if (!xmlValidation) {
                xmlValidation = ((Host)container).getXmlValidation();
            }
            
            xmlNamespaceAware = context.getXmlNamespaceAware();
            if (!xmlNamespaceAware){
                xmlNamespaceAware 
                            = ((Host)container).getXmlNamespaceAware();
            }

            container = container.getParent();
        }
    }

    // Process the default and application web.xml files
    defaultWebConfig();
    applicationWebConfig();
    if (!context.getIgnoreAnnotations()) {
        applicationAnnotationsConfig();
    }
    if (ok) {
        validateSecurityRoles();
    }

    // Configure an authenticator if we need one
    if (ok)
        authenticatorConfig();

    // Dump the contents of this pipeline if requested
    if ((log.isDebugEnabled()) && (context instanceof ContainerBase)) {
        log.debug("Pipeline Configuration:");
        Pipeline pipeline = ((ContainerBase) context).getPipeline();
        Valve valves[] = null;
        if (pipeline != null)
            valves = pipeline.getValves();
        if (valves != null) {
            for (int i = 0; i < valves.length; i++) {
                log.debug("  " + valves[i].getInfo());
            }
        }
        log.debug("======================");
    }

    // Make our application available if no problems were encountered
    if (ok)
        context.setConfigured(true);
    else {
        log.error(sm.getString("contextConfig.unavailable"));
        context.setConfigured(false);
    }

}
 
开发者ID:lamsfoundation,项目名称:lams,代码行数:69,代码来源:ContextConfig.java


示例11: start

import org.apache.catalina.Pipeline; //导入依赖的package包/类
/**
 * Process a "start" event for this Context.
 */
private synchronized void start() {

    if (debug > 0)
        log(sm.getString("contextConfig.start"));
    context.setConfigured(false);
    ok = true;

    // Set properties based on DefaultContext
    Container container = context.getParent();
    if( !context.getOverride() ) {
        if( container instanceof Host ) {
            ((Host)container).importDefaultContext(context);
            container = container.getParent();
        }
        if( container instanceof Engine ) {
            ((Engine)container).importDefaultContext(context);
        }
    }

    // Process the default and application web.xml files
    defaultConfig();
    applicationConfig();
    if (ok) {
        validateSecurityRoles();
    }

    // Scan tag library descriptor files for additional listener classes
    if (ok) {
        try {
            tldScan();
        } catch (Exception e) {
            log(e.getMessage(), e);
            ok = false;
        }
    }

    // Configure a certificates exposer valve, if required
    if (ok)
        certificatesConfig();

    // Configure an authenticator if we need one
    if (ok)
        authenticatorConfig();

    // Dump the contents of this pipeline if requested
    if ((debug >= 1) && (context instanceof ContainerBase)) {
        log("Pipline Configuration:");
        Pipeline pipeline = ((ContainerBase) context).getPipeline();
        Valve valves[] = null;
        if (pipeline != null)
            valves = pipeline.getValves();
        if (valves != null) {
            for (int i = 0; i < valves.length; i++) {
                log("  " + valves[i].getInfo());
            }
        }
        log("======================");
    }

    // Make our application available if no problems were encountered
    if (ok)
        context.setConfigured(true);
    else {
        log(sm.getString("contextConfig.unavailable"));
        context.setConfigured(false);
    }

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:72,代码来源:ContextConfig.java


示例12: start

import org.apache.catalina.Pipeline; //导入依赖的package包/类
/**
 * Prepare for the beginning of active use of the public methods of this
 * component.  This method should be called after <code>configure()</code>,
 * and before any of the public methods of the component are utilized.
 *
 * @exception LifecycleException if this component detects a fatal error
 *  that prevents this component from being used
 */
public void start() throws LifecycleException {

    // Validate and update our current component state
    if (started)
        throw new LifecycleException
            (sm.getString("authenticator.alreadyStarted"));
    lifecycle.fireLifecycleEvent(START_EVENT, null);
    if ("org.apache.catalina.core.StandardContext".equals
        (context.getClass().getName())) {
        try {
            Class paramTypes[] = new Class[0];
            Object paramValues[] = new Object[0];
            Method method =
                context.getClass().getMethod("getDebug", paramTypes);
            Integer result = (Integer) method.invoke(context, paramValues);
            setDebug(result.intValue());
        } catch (Exception e) {
            log("Exception getting debug value", e);
        }
    }
    started = true;

    // Look up the SingleSignOn implementation in our request processing
    // path, if there is one
    Container parent = context.getParent();
    while ((sso == null) && (parent != null)) {
        if (!(parent instanceof Pipeline)) {
            parent = parent.getParent();
            continue;
        }
        Valve valves[] = ((Pipeline) parent).getValves();
        for (int i = 0; i < valves.length; i++) {
            if (valves[i] instanceof SingleSignOn) {
                sso = (SingleSignOn) valves[i];
                break;
            }
        }
        if (sso == null)
            parent = parent.getParent();
    }
    if (debug >= 1) {
        if (sso != null)
            log("Found SingleSignOn Valve at " + sso);
        else
            log("No SingleSignOn Valve is present");
    }

}
 
开发者ID:c-rainstorm,项目名称:jerrydog,代码行数:57,代码来源:AuthenticatorBase.java


示例13: configureStart

import org.apache.catalina.Pipeline; //导入依赖的package包/类
/**
 * Process a "contextConfig" event for this Context.
 */
protected synchronized void configureStart() {
	// Called from StandardContext.start()

	if (log.isDebugEnabled())
		log.debug(sm.getString("contextConfig.start"));

	if (log.isDebugEnabled()) {
		log.debug(sm.getString("contextConfig.xmlSettings", context.getName(),
				Boolean.valueOf(context.getXmlValidation()), Boolean.valueOf(context.getXmlNamespaceAware())));
	}

	webConfig();

	if (!context.getIgnoreAnnotations()) {
		applicationAnnotationsConfig();
	}
	if (ok) {
		validateSecurityRoles();
	}

	// Configure an authenticator if we need one
	if (ok)
		authenticatorConfig();

	// Dump the contents of this pipeline if requested
	if ((log.isDebugEnabled()) && (context instanceof ContainerBase)) {
		log.debug("Pipeline Configuration:");
		Pipeline pipeline = ((ContainerBase) context).getPipeline();
		Valve valves[] = null;
		if (pipeline != null)
			valves = pipeline.getValves();
		if (valves != null) {
			for (int i = 0; i < valves.length; i++) {
				log.debug("  " + valves[i].getInfo());
			}
		}
		log.debug("======================");
	}

	// Make our application available if no problems were encountered
	if (ok)
		context.setConfigured(true);
	else {
		log.error(sm.getString("contextConfig.unavailable"));
		context.setConfigured(false);
	}

}
 
开发者ID:how2j,项目名称:lazycat,代码行数:52,代码来源:ContextConfig.java


示例14: getPipeline

import org.apache.catalina.Pipeline; //导入依赖的package包/类
@Override
public Pipeline getPipeline() {
	return null;
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:5,代码来源:FailedContext.java


示例15: getObjectNameKeyProperties

import org.apache.catalina.Pipeline; //导入依赖的package包/类
@Override
public String getObjectNameKeyProperties() {
	StringBuilder name = new StringBuilder("type=Valve");

	Container container = getContainer();

	name.append(MBeanUtils.getContainerKeyProperties(container));

	int seq = 0;

	// Pipeline may not be present in unit testing
	Pipeline p = container.getPipeline();
	if (p != null) {
		for (Valve valve : p.getValves()) {
			// Skip null valves
			if (valve == null) {
				continue;
			}
			// Only compare valves in pipeline until we find this valve
			if (valve == this) {
				break;
			}
			if (valve.getClass() == this.getClass()) {
				// Duplicate valve earlier in pipeline
				// increment sequence number
				seq++;
			}
		}
	}

	if (seq > 0) {
		name.append(",seq=");
		name.append(seq);
	}

	String className = this.getClass().getName();
	int period = className.lastIndexOf('.');
	if (period >= 0) {
		className = className.substring(period + 1);
	}
	name.append(",name=");
	name.append(className);

	return name.toString();
}
 
开发者ID:how2j,项目名称:lazycat,代码行数:46,代码来源:ValveBase.java


示例16: configureStart

import org.apache.catalina.Pipeline; //导入依赖的package包/类
/**
 * Process a "contextConfig" event for this Context.
 */
protected synchronized void configureStart() {
    // Called from StandardContext.start()

    if (log.isDebugEnabled())
        log.debug(sm.getString("contextConfig.start"));

    if (log.isDebugEnabled()) {
        log.debug(sm.getString("contextConfig.xmlSettings",
                context.getName(),
                Boolean.valueOf(context.getXmlValidation()),
                Boolean.valueOf(context.getXmlNamespaceAware())));
    }
    
    webConfig();

    if (!context.getIgnoreAnnotations()) {
        applicationAnnotationsConfig();
    }
    if (ok) {
        validateSecurityRoles();
    }

    // Configure an authenticator if we need one
    if (ok)
        authenticatorConfig();

    // Dump the contents of this pipeline if requested
    if ((log.isDebugEnabled()) && (context instanceof ContainerBase)) {
        log.debug("Pipeline Configuration:");
        Pipeline pipeline = ((ContainerBase) context).getPipeline();
        Valve valves[] = null;
        if (pipeline != null)
            valves = pipeline.getValves();
        if (valves != null) {
            for (int i = 0; i < valves.length; i++) {
                log.debug("  " + valves[i].getInfo());
            }
        }
        log.debug("======================");
    }

    // Make our application available if no problems were encountered
    if (ok)
        context.setConfigured(true);
    else {
        log.error(sm.getString("contextConfig.unavailable"));
        context.setConfigured(false);
    }

}
 
开发者ID:WhiteBearSolutions,项目名称:WBSAirback,代码行数:54,代码来源:ContextConfig.java



注:本文中的org.apache.catalina.Pipeline类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java MsgView类代码示例发布时间:2022-05-22
下一篇:
Java Provider类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap