当前位置: 首页>>代码示例>>Java>>正文


Java ApplicationParameter.getOverride方法代码示例

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


在下文中一共展示了ApplicationParameter.getOverride方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addApplicationParameter

import org.apache.catalina.deploy.ApplicationParameter; //导入方法依赖的package包/类
/**
 * Add a new application parameter for this application.
 *
 * @param parameter The new application parameter
 */
@Override
public void addApplicationParameter(ApplicationParameter parameter) {

    synchronized (applicationParametersLock) {
        String newName = parameter.getName();
        for (ApplicationParameter p : applicationParameters) {
            if (newName.equals(p.getName()) && !p.getOverride())
                return;
        }
        ApplicationParameter results[] = Arrays.copyOf(
                applicationParameters, applicationParameters.length + 1);
        results[applicationParameters.length] = parameter;
        applicationParameters = results;
    }
    fireContainerEvent("addApplicationParameter", parameter);

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

示例2: addApplicationParameter

import org.apache.catalina.deploy.ApplicationParameter; //导入方法依赖的package包/类
/**
 * Add a new application parameter for this application.
 *
 * @param parameter
 *            The new application parameter
 */
@Override
public void addApplicationParameter(ApplicationParameter parameter) {

	synchronized (applicationParametersLock) {
		String newName = parameter.getName();
		for (ApplicationParameter p : applicationParameters) {
			if (newName.equals(p.getName()) && !p.getOverride())
				return;
		}
		ApplicationParameter results[] = Arrays.copyOf(applicationParameters, applicationParameters.length + 1);
		results[applicationParameters.length] = parameter;
		applicationParameters = results;
	}
	fireContainerEvent("addApplicationParameter", parameter);

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

示例3: getApplicationInitParams

import org.apache.catalina.deploy.ApplicationParameter; //导入方法依赖的package包/类
@Override
public List<ApplicationParam> getApplicationInitParams(Context context) {
  /*
   * We'll try to determine if a parameter value comes from a deployment descriptor or a context
   * descriptor.
   *
   * Assumption: context.findParameter() returns only values of parameters that are declared in a
   * deployment descriptor.
   *
   * If a parameter is declared in a context descriptor with override=false and redeclared in a
   * deployment descriptor, context.findParameter() still returns its value, even though the value
   * is taken from a context descriptor.
   *
   * context.findApplicationParameters() returns all parameters that are declared in a context
   * descriptor regardless of whether they are overridden in a deployment descriptor or not or
   * not.
   */
  /*
   * creating a set of parameter names that are declared in a context descriptor and can not be
   * overridden in a deployment descriptor.
   */
  Set<String> nonOverridableParams = new HashSet<>();
  for (ApplicationParameter appParam : context.findApplicationParameters()) {
    if (appParam != null && !appParam.getOverride()) {
      nonOverridableParams.add(appParam.getName());
    }
  }
  List<ApplicationParam> initParams = new ArrayList<>(20);
  ServletContext servletCtx = context.getServletContext();
  for (String paramName : Collections.list(servletCtx.getInitParameterNames())) {
    ApplicationParam param = new ApplicationParam();
    param.setName(paramName);
    param.setValue(servletCtx.getInitParameter(paramName));
    /*
     * if the parameter is declared in a deployment descriptor and it is not declared in a context
     * descriptor with override=false, the value comes from the deployment descriptor
     */
    param.setFromDeplDescr(
        context.findParameter(paramName) != null && !nonOverridableParams.contains(paramName));
    initParams.add(param);
  }
  return initParams;
}
 
开发者ID:psi-probe,项目名称:psi-probe,代码行数:44,代码来源:Tomcat70ContainerAdapter.java


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