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


Java ApplicationParameter类代码示例

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


ApplicationParameter类属于org.apache.catalina.deploy包,在下文中一共展示了ApplicationParameter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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: mergeParameters

import org.apache.catalina.deploy.ApplicationParameter; //导入依赖的package包/类
/**
 * Merge the context initialization parameters specified in the application
 * deployment descriptor with the application parameters described in the
 * server configuration, respecting the <code>override</code> property of
 * the application parameters appropriately.
 */
private void mergeParameters() {

    if (parameters != null)
        return;
    Map results = new ConcurrentHashMap();
    String names[] = context.findParameters();
    for (int i = 0; i < names.length; i++)
        results.put(names[i], context.findParameter(names[i]));
    ApplicationParameter params[] =
        context.findApplicationParameters();
    for (int i = 0; i < params.length; i++) {
        if (params[i].getOverride()) {
            if (results.get(params[i].getName()) == null)
                results.put(params[i].getName(), params[i].getValue());
        } else {
            results.put(params[i].getName(), params[i].getValue());
        }
    }
    parameters = results;

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

示例3: addApplicationParameter

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

    synchronized (applicationParameters) {
        String newName = parameter.getName();
        for (int i = 0; i < applicationParameters.length; i++) {
            if (newName.equals(applicationParameters[i].getName()) &&
                !applicationParameters[i].getOverride())
                return;
        }
        ApplicationParameter results[] =
            new ApplicationParameter[applicationParameters.length + 1];
        System.arraycopy(applicationParameters, 0, results, 0,
                         applicationParameters.length);
        results[applicationParameters.length] = parameter;
        applicationParameters = results;
    }
    fireContainerEvent("addApplicationParameter", parameter);

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

示例4: mergeParameters

import org.apache.catalina.deploy.ApplicationParameter; //导入依赖的package包/类
/**
 * Merge the context initialization parameters specified in the application
 * deployment descriptor with the application parameters described in the
 * server configuration, respecting the <code>override</code> property of
 * the application parameters appropriately.
 */
private void mergeParameters() {

    if (parameters != null)
        return;
    HashMap results = new HashMap();
    String names[] = context.findParameters();
    for (int i = 0; i < names.length; i++)
        results.put(names[i], context.findParameter(names[i]));
    ApplicationParameter params[] =
        context.findApplicationParameters();
    for (int i = 0; i < params.length; i++) {
        if (params[i].getOverride()) {
            if (results.get(params[i].getName()) == null)
                results.put(params[i].getName(), params[i].getValue());
        } else {
            results.put(params[i].getName(), params[i].getValue());
        }
    }
    parameters = results;

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

示例5: addApplicationParameter

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

    synchronized (applicationParameters) {
        String newName = parameter.getName();
        for (int i = 0; i < applicationParameters.length; i++) {
            if (name.equals(applicationParameters[i].getName()) &&
                !applicationParameters[i].getOverride())
                return;
        }
        ApplicationParameter results[] =
            new ApplicationParameter[applicationParameters.length + 1];
        System.arraycopy(applicationParameters, 0, results, 0,
                         applicationParameters.length);
        results[applicationParameters.length] = parameter;
        applicationParameters = results;
    }
    fireContainerEvent("addApplicationParameter", parameter);

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

示例6: 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

示例7: mergeParameters

import org.apache.catalina.deploy.ApplicationParameter; //导入依赖的package包/类
/**
 * Merge the context initialization parameters specified in the application
 * deployment descriptor with the application parameters described in the
 * server configuration, respecting the <code>override</code> property of
 * the application parameters appropriately.
 */
private void mergeParameters() {
	Map<String, String> mergedParams = new HashMap<String, String>();

	String names[] = findParameters();
	for (int i = 0; i < names.length; i++) {
		mergedParams.put(names[i], findParameter(names[i]));
	}

	ApplicationParameter params[] = findApplicationParameters();
	for (int i = 0; i < params.length; i++) {
		if (params[i].getOverride()) {
			if (mergedParams.get(params[i].getName()) == null) {
				mergedParams.put(params[i].getName(), params[i].getValue());
			}
		} else {
			mergedParams.put(params[i].getName(), params[i].getValue());
		}
	}

	ServletContext sc = getServletContext();
	for (Map.Entry<String, String> entry : mergedParams.entrySet()) {
		sc.setInitParameter(entry.getKey(), entry.getValue());
	}

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

示例8: findApplicationParameters

import org.apache.catalina.deploy.ApplicationParameter; //导入依赖的package包/类
/**
 * Return the set of application parameters for this application.
 */
@Override
public ApplicationParameter[] findApplicationParameters() {

    synchronized (applicationParametersLock) {
        return (applicationParameters);
    }

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

示例9: removeApplicationParameter

import org.apache.catalina.deploy.ApplicationParameter; //导入依赖的package包/类
/**
 * Remove the application parameter with the specified name from
 * the set for this application.
 *
 * @param name Name of the application parameter to remove
 */
@Override
public void removeApplicationParameter(String name) {

    synchronized (applicationParametersLock) {

        // Make sure this parameter is currently present
        int n = -1;
        for (int i = 0; i < applicationParameters.length; i++) {
            if (name.equals(applicationParameters[i].getName())) {
                n = i;
                break;
            }
        }
        if (n < 0)
            return;

        // Remove the specified parameter
        int j = 0;
        ApplicationParameter results[] =
            new ApplicationParameter[applicationParameters.length - 1];
        for (int i = 0; i < applicationParameters.length; i++) {
            if (i != n)
                results[j++] = applicationParameters[i];
        }
        applicationParameters = results;

    }

    // Inform interested listeners
    fireContainerEvent("removeApplicationParameter", name);

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

示例10: mergeParameters

import org.apache.catalina.deploy.ApplicationParameter; //导入依赖的package包/类
/**
 * Merge the context initialization parameters specified in the application
 * deployment descriptor with the application parameters described in the
 * server configuration, respecting the <code>override</code> property of
 * the application parameters appropriately.
 */
private void mergeParameters() {
    Map<String,String> mergedParams = new HashMap<String,String>();
    
    String names[] = findParameters();
    for (int i = 0; i < names.length; i++) {
        mergedParams.put(names[i], findParameter(names[i]));
    }

    ApplicationParameter params[] = findApplicationParameters();
    for (int i = 0; i < params.length; i++) {
        if (params[i].getOverride()) {
            if (mergedParams.get(params[i].getName()) == null) {
                mergedParams.put(params[i].getName(),
                        params[i].getValue());
            }
        } else {
            mergedParams.put(params[i].getName(), params[i].getValue());
        }
    }
    
    ServletContext sc = getServletContext();
    for (Map.Entry<String,String> entry : mergedParams.entrySet()) {
        sc.setInitParameter(entry.getKey(), entry.getValue());
    }

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

示例11: removeApplicationParameter

import org.apache.catalina.deploy.ApplicationParameter; //导入依赖的package包/类
/**
 * Remove the application parameter with the specified name from
 * the set for this application.
 *
 * @param name Name of the application parameter to remove
 */
public void removeApplicationParameter(String name) {

    synchronized (applicationParameters) {

        // Make sure this parameter is currently present
        int n = -1;
        for (int i = 0; i < applicationParameters.length; i++) {
            if (name.equals(applicationParameters[i].getName())) {
                n = i;
                break;
            }
        }
        if (n < 0)
            return;

        // Remove the specified parameter
        int j = 0;
        ApplicationParameter results[] =
            new ApplicationParameter[applicationParameters.length - 1];
        for (int i = 0; i < applicationParameters.length; i++) {
            if (i != n)
                results[j++] = applicationParameters[i];
        }
        applicationParameters = results;

    }

    // Inform interested listeners
    fireContainerEvent("removeApplicationParameter", name);

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

示例12: addApplicationParameter

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

    synchronized (applicationParameters) {
        ApplicationParameter results[] =
            new ApplicationParameter[applicationParameters.length + 1];
        System.arraycopy(applicationParameters, 0, results, 0,
                         applicationParameters.length);
        results[applicationParameters.length] = parameter;
        applicationParameters = results;
    }

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

示例13: removeApplicationParameter

import org.apache.catalina.deploy.ApplicationParameter; //导入依赖的package包/类
/**
 * Remove the application parameter with the specified name from
 * the set for this application.
 *
 * @param name Name of the application parameter to remove
 */
public void removeApplicationParameter(String name) {

    synchronized (applicationParameters) {

        // Make sure this parameter is currently present
        int n = -1;
        for (int i = 0; i < applicationParameters.length; i++) {
            if (name.equals(applicationParameters[i].getName())) {
                n = i;
                break;
            }
        }
        if (n < 0)
            return;

        // Remove the specified parameter
        int j = 0;
        ApplicationParameter results[] =
            new ApplicationParameter[applicationParameters.length - 1];
        for (int i = 0; i < applicationParameters.length; i++) {
            if (i != n)
                results[j++] = applicationParameters[i];
        }
        applicationParameters = results;

    }

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

示例14: findApplicationParameters

import org.apache.catalina.deploy.ApplicationParameter; //导入依赖的package包/类
/**
 * Return the set of application parameters for this application.
 */
@Override
public ApplicationParameter[] findApplicationParameters() {

	synchronized (applicationParametersLock) {
		return (applicationParameters);
	}

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

示例15: removeApplicationParameter

import org.apache.catalina.deploy.ApplicationParameter; //导入依赖的package包/类
/**
 * Remove the application parameter with the specified name from the set for
 * this application.
 *
 * @param name
 *            Name of the application parameter to remove
 */
@Override
public void removeApplicationParameter(String name) {

	synchronized (applicationParametersLock) {

		// Make sure this parameter is currently present
		int n = -1;
		for (int i = 0; i < applicationParameters.length; i++) {
			if (name.equals(applicationParameters[i].getName())) {
				n = i;
				break;
			}
		}
		if (n < 0)
			return;

		// Remove the specified parameter
		int j = 0;
		ApplicationParameter results[] = new ApplicationParameter[applicationParameters.length - 1];
		for (int i = 0; i < applicationParameters.length; i++) {
			if (i != n)
				results[j++] = applicationParameters[i];
		}
		applicationParameters = results;

	}

	// Inform interested listeners
	fireContainerEvent("removeApplicationParameter", name);

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


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