use of org.apache.catalina.deploy.NamingResources in project Payara by payara.
the class StandardContext method addEnvironment.
// ------------------------------------------------------------- Operations
/**
* Add an environment entry for this web application.
*
* @param envName New environment entry name
*/
public String addEnvironment(String envName, String type) throws MalformedObjectNameException {
NamingResources nresources = getNamingResources();
if (nresources == null) {
return null;
}
ContextEnvironment env = nresources.findEnvironment(envName);
if (env != null) {
throw new IllegalArgumentException("Invalid environment name - already exists '" + envName + "'");
}
env = new ContextEnvironment();
env.setName(envName);
env.setType(type);
nresources.addEnvironment(env);
// Return the corresponding MBean name
return createObjectName(env).toString();
}
use of org.apache.catalina.deploy.NamingResources in project Payara by payara.
the class StandardContext method addResourceLink.
/**
* Add a resource link for this web application.
*
* @param resourceLinkName New resource link name
*/
public String addResourceLink(String resourceLinkName, String global, String name, String type) throws MalformedObjectNameException {
NamingResources nresources = getNamingResources();
if (nresources == null) {
return null;
}
ContextResourceLink resourceLink = nresources.findResourceLink(resourceLinkName);
if (resourceLink != null) {
throw new IllegalArgumentException("Invalid resource link name - already exists'" + resourceLinkName + "'");
}
resourceLink = new ContextResourceLink();
resourceLink.setGlobal(global);
resourceLink.setName(resourceLinkName);
resourceLink.setType(type);
nresources.addResourceLink(resourceLink);
// Return the corresponding MBean name
return createObjectName(resourceLink).toString();
}
Aggregations