本文整理汇总了Java中org.apache.catalina.deploy.ApplicationParameter类的典型用法代码示例。如果您正苦于以下问题:Java ApplicationParameter类的具体用法?Java ApplicationParameter怎么用?Java ApplicationParameter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ApplicationParameter类属于org.apache.catalina.deploy包,在下文中一共展示了ApplicationParameter类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
示例16: applicationInitParams
import org.apache.catalina.deploy.ApplicationParameter; //导入依赖的package包/类
/**
* Application init params.
*/
@Test
public void applicationInitParams() {
Assert.assertNotNull(new Expectations() {
{
context.findApplicationParameters();
result = new ApplicationParameter();
}
});
final Tomcat70ContainerAdapter adapter = new Tomcat70ContainerAdapter();
assertEquals(0, adapter.getApplicationInitParams(context).size());
}
开发者ID:psi-probe,项目名称:psi-probe,代码行数:15,代码来源:Tomcat70ContainerAdapterTest.java
示例17: getApplicationInitParams
import org.apache.catalina.deploy.ApplicationParameter; //导入依赖的package包/类
public List 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 ovevridden in a deployment descriptor.
Set nonOverridableParams = new HashSet();
ApplicationParameter[] appParams = context.findApplicationParameters();
for (int i = 0; i < appParams.length; i++) {
if (appParams[i] != null && ! appParams[i].getOverride()) {
nonOverridableParams.add(appParams[i].getName());
}
}
List initParams = new ArrayList();
ServletContext servletCtx = context.getServletContext();
for (Enumeration e = servletCtx.getInitParameterNames(); e.hasMoreElements(); ) {
String paramName = (String) e.nextElement();
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:andresol,项目名称:psi-probe-plus,代码行数:37,代码来源:Tomcat55ContainerAdaptor.java
注:本文中的org.apache.catalina.deploy.ApplicationParameter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论