use of com.axway.ats.agent.core.threading.exceptions.NoSuchLoadQueueException in project ats-framework by Axway.
the class MultiThreadedActionHandler method resumeQueue.
public void resumeQueue(String actionQueueName) throws NoSuchLoadQueueException, ActionExecutionException, ActionTaskLoaderException {
//first cleanup the queues
cleanupFinishedQueues();
QueueLoader queueLoader = queueLoadersMap.get(actionQueueName);
if (queueLoader == null) {
throw new NoSuchLoadQueueException(actionQueueName);
}
//resume the queue
queueLoader.resume();
}
use of com.axway.ats.agent.core.threading.exceptions.NoSuchLoadQueueException in project ats-framework by Axway.
the class MultiThreadedActionHandler method startQueue.
/**
* @param queueName queue name
* @throws NoSuchLoadQueueException
* @throws ActionExecutionException
* @throws ActionTaskLoaderException
*/
public void startQueue(String queueName) throws NoSuchLoadQueueException, ActionExecutionException, ActionTaskLoaderException {
//first cleanup the queues
cleanupFinishedQueues();
QueueLoader queueLoader = queueLoadersMap.get(queueName);
if (queueLoader == null) {
throw new NoSuchLoadQueueException(queueName);
}
log.info("Starting queue '" + queueName + "'");
//start the queue
queueLoader.start();
}
use of com.axway.ats.agent.core.threading.exceptions.NoSuchLoadQueueException in project ats-framework by Axway.
the class LocalLoadExecutor method executeActions.
@Override
public void executeActions(List<ActionRequest> actionRequests) throws AgentException {
log.info("Start executing action queue '" + queueName + "'." + (threadingPattern.isBlockUntilCompletion() ? " And wait to finish." : ""));
// start queue in the database and retrieve its ID
int queueId = retrieveQueueId(queueSequence, HostUtils.getLocalHostIP());
try {
MultiThreadedActionHandler.getInstance(ThreadsPerCaller.getCaller()).executeActions("LOCAL", queueName, queueId, actionRequests, threadingPattern, loaderDataConfig);
if (threadingPattern.isBlockUntilCompletion()) {
log.endLoadQueue(queueName, LoadQueueResult.PASSED);
log.info("Finished executing action queue '" + queueName + "'");
} else {
// wait in another thread until the queue finish
ImportantThread helpThread = new ImportantThread(new Runnable() {
@Override
public void run() {
try {
MultiThreadedActionHandler.getInstance(ThreadsPerCaller.getCaller()).waitUntilQueueFinish(queueName);
log.endLoadQueue(queueName, LoadQueueResult.PASSED);
log.info("Finished executing action queue '" + queueName + "'");
} catch (NoSuchLoadQueueException e) {
log.error("Error waiting for action queue '" + queueName + "' completion", e);
log.endLoadQueue(queueName, LoadQueueResult.FAILED);
}
}
});
helpThread.setDescription(queueName);
helpThread.start();
log.info("Action queue '" + queueName + "' scheduled for asynchronous execution");
}
} catch (Exception e) {
throw new AgentException(e.getMessage(), e);
}
}
Aggregations