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).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 = jndiName;
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);
commandRunner.getCommandInvocation("delete-connector-resource", subReport).parameters(params).execute();
if (ActionReport.ExitCode.FAILURE.equals(subReport.getActionExitCode())){
report.setMessage(localStrings.getLocalString("delete.jms.resource.cannotDeleteJMSResource",
"Unable to Delete Connector Resource."));
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
return;
}
params = new ParameterMap();
params.set("poolname", jndiName);
params.set("DEFAULT", jndiName);
commandRunner.getCommandInvocation("delete-connector-connection-pool", subReport).parameters(params).execute();
if (ActionReport.ExitCode.FAILURE.equals(subReport.getActionExitCode())){
report.setMessage(localStrings.getLocalString("delete.jms.resource.cannotDeleteJMSPool",
"Unable to Delete Connector Connection Pool."));
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
return;
}
//clear the message set by the delete-connector-connection-pool command this is to prevent the 'connection pool deleted' message from displaying
subReport.setMessage("");
}
else
{
// There is no connector pool with the default poolName.
// However, no need to throw exception as the connector
// resource might still be there. Try to delete the
// connector-resource without touching the ref. as
// ref. might have been deleted while deleting connector-connection-pool
// as the ref. is the same.
ParameterMap params = new ParameterMap();
params.set("DEFAULT", jndiName);
params.set("connector_resource_name", jndiName);
params.set("target", target);
commandRunner.getCommandInvocation("delete-connector-resource", subReport).parameters(params).execute();
if (ActionReport.ExitCode.FAILURE.equals(subReport.getActionExitCode())){
report.setMessage(localStrings.getLocalString("delete.jms.resource.cannotDeleteJMSResource",
"Unable to Delete Connector Resource."));