"Thread Pool named {0} does not exist.", threadpool_id));
report.setActionExitCode(ExitCode.FAILURE);
return;
}
ThreadPool pool = null;
for (ThreadPool tp : config.getThreadPools().getThreadPool()) {
if (tp.getName().equals(threadpool_id)) {
pool = tp;
}
}
List<NetworkListener> nwlsnrList = pool.findNetworkListeners();
for (NetworkListener nwlsnr : nwlsnrList) {
if (pool.getName().equals(nwlsnr.getThreadPool())) {
report.setMessage(localStrings.getLocalString(
"delete.threadpool.beingused",
"{0} threadpool is being used in the network listener {1}",
threadpool_id, nwlsnr.getName()));
report.setActionExitCode(ActionReport.ExitCode.FAILURE);
return;
}
}
try {
ConfigSupport.apply(new SingleConfigCode<ThreadPools>() {
public Object run(ThreadPools param) throws PropertyVetoException,
TransactionFailure {
List<ThreadPool> poolList = param.getThreadPool();
for (ThreadPool pool : poolList) {
String currPoolId = pool.getName();
if (currPoolId != null && currPoolId.equals
(threadpool_id)) {
poolList.remove(pool);
break;
}