本文整理汇总了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);
}
示例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;
}
示例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);
}
示例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;
}
示例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);
}
示例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);
}
示例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());
}
}
示例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);
}
}
示例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);
}
示例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());
}
}
示例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);
}
示例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;
}
}
示例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;
}
}
示例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);
}
}
示例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);
}