* @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
ManagedBean managed = Registry.getRegistry().findManagedBean("ContextResourceLink");
ObjectName oname =
MBeanUtils.createObjectName(managed.getDomain(), resourceLink);