jndiNameForConnectionPool = jndiName + JNDINAME_APPENDER;
ActionReport subReport = report.addSubActionsReport();
ConnectorResource cresource = null;
Resource res = ConnectorsUtil.getResourceByName(domain.getResources(), ConnectorResource.class, jndiName);
if (res instanceof ConnectorResource) {
cresource = (ConnectorResource) res;
}
/* for (ConnectorResource cr : connResources) {
if (cr.getJndiName().equals(jndiName))
cresource = cr;
} */
if (cresource == null) {
ParameterMap params = new ParameterMap();
params.set("jndi_name", jndiName);
params.set("DEFAULT", jndiName);
params.set("target", target);
commandRunner.getCommandInvocation("delete-admin-object", subReport, context.getSubject()).parameters(params).execute();
if (ActionReport.ExitCode.FAILURE.equals(subReport.getActionExitCode())) {
report.setMessage(localStrings.getLocalString("delete.jms.resource.cannotDeleteJMSAdminObject",
"Unable to Delete Admin Object."));
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
return;
}
} else {
// Delete the connector resource and connector connection pool
String defPoolName = jndiNameForConnectionPool;
String poolName = cresource.getPoolName();
if (poolName != null && poolName.equals(defPoolName)) {
ParameterMap params = new ParameterMap();
params.set("DEFAULT", jndiName);
params.set("connector_resource_name", jndiName);
params.set("target", target);