use of org.glassfish.resourcebase.resources.admin.cli.ResourceUtil in project Payara by payara.
the class JNDIConfigSource method deleteValue.
public void deleteValue(final String propertyName, String target) throws TransactionFailure {
// remove the resource reference
ResourceUtil resourceUtil = Globals.getDefaultHabitat().getService(ResourceUtil.class);
resourceUtil.deleteResourceRef(propertyName, target);
ConfigSupport.apply(new SingleConfigCode<Resources>() {
public Object run(Resources param) throws PropertyVetoException, TransactionFailure {
CustomResource resource = (CustomResource) domainConfiguration.getResources().getResourceByName(CustomResource.class, propertyName);
if (resource != null && resource.getJndiName().equals(propertyName)) {
return param.getResources().remove(resource);
}
return null;
}
}, domainConfiguration.getResources());
}
Aggregations