use of com.axway.ats.agent.core.threading.data.ParameterDataProvider in project ats-framework by Axway.
the class MultiThreadedActionHandler method scheduleActions.
/**
* @param caller
* @param queueName
* @param actionRequests
* @param threadingPattern
* @throws NoSuchComponentException
* @throws NoSuchActionException
* @throws NoCompatibleMethodFoundException
* @throws ThreadingPatternNotSupportedException
* @throws ActionExecutionException
* @throws ActionTaskLoaderException
* @throws LoadQueueAlreadyExistsException
* @throws ParameterDataProviderNotSupportedException
* @throws ParameterDataProviderInitalizationException
*/
public void scheduleActions(String caller, String queueName, int queueId, List<ActionRequest> actionRequests, ThreadingPattern threadingPattern, LoaderDataConfig loaderDataConfig, boolean isUseSynchronizedIterations) throws NoSuchComponentException, NoSuchActionException, NoCompatibleMethodFoundException, ThreadingPatternNotSupportedException, ActionExecutionException, ActionTaskLoaderException, LoadQueueAlreadyExistsException, ParameterDataProviderNotSupportedException, ParameterDataProviderInitalizationException {
//first cleanup the queues
cleanupFinishedQueues();
//check if we already have this queue and it has not finished yet
//if the queue has finished, we can simply discard it
QueueLoader queueLoader = queueLoadersMap.get(queueName);
if (queueLoader != null) {
throw new LoadQueueAlreadyExistsException(queueName, queueLoader.getState());
}
//create the data providers
List<ParameterDataProvider> parameterDataProviders = new ArrayList<ParameterDataProvider>();
for (ParameterDataConfig paramDataConfigs : loaderDataConfig.getParameterConfigurations()) {
parameterDataProviders.add(ParameterDataProviderFactory.createDataProvider(paramDataConfigs));
}
//create the loader
queueLoader = LoadQueueFactory.createLoadQueue(queueName, actionRequests, threadingPattern, parameterDataProviders, listeners);
log.rememberLoadQueueState(queueName, queueId, threadingPattern.getPatternDescription(), threadingPattern.getThreadCount());
//start the queue
queueLoader.scheduleThreads(caller, isUseSynchronizedIterations);
queueLoadersMap.put(queueName, queueLoader);
log.info("Scheduled queue '" + queueName + "'");
}
use of com.axway.ats.agent.core.threading.data.ParameterDataProvider in project ats-framework by Axway.
the class Test_ActionTaskFactory method createActionTaskFixedDuration.
@Test
public void createActionTaskFixedDuration() throws ActionExecutionException, NoSuchComponentException, NoSuchActionException, NoCompatibleMethodFoundException, ThreadingPatternNotSupportedException {
FixedDurationAllAtOncePattern pattern = new FixedDurationAllAtOncePattern(10, true, 20, 1400);
Runnable actionTask = ActionTaskFactory.createTask("IP", "Action_Queue", pattern, pattern.getExecutionsPerTimeFrame(), new ThreadsManager(), null, new ArrayList<ActionRequest>(), new ArrayList<ParameterDataProvider>(), null, false);
assertEquals(FixedDurationActionTask.class, actionTask.getClass());
}
use of com.axway.ats.agent.core.threading.data.ParameterDataProvider in project ats-framework by Axway.
the class Test_ActionTaskFactory method createActionTaskMultipleInvocations.
@Test
public void createActionTaskMultipleInvocations() throws ActionExecutionException, NoSuchComponentException, NoSuchActionException, NoCompatibleMethodFoundException, ThreadingPatternNotSupportedException {
AllAtOncePattern pattern = new AllAtOncePattern(10, true, 20, 1400);
Runnable actionTask = ActionTaskFactory.createTask("IP", "Action_Queue", pattern, pattern.getExecutionsPerTimeFrame(), new ThreadsManager(), null, new ArrayList<ActionRequest>(), new ArrayList<ParameterDataProvider>(), null, false);
assertEquals(MultipleInvocationsActionTask.class, actionTask.getClass());
}
Aggregations