controller.addIterationListener(new IterationListener());
threadContext.setSamplingStarted(true);
threadStarted();
while (running)
{
Sampler sam;
while (running && (sam=controller.next())!=null)
{
try
{
threadContext.setCurrentSampler(sam);
SamplePackage pack = compiler.configureSampler(sam);
//Hack: save the package for any transaction controllers
threadContext.getVariables().putObject(PACKAGE_OBJECT,pack);
delay(pack.getTimers());
Sampler sampler= pack.getSampler();
sampler.setThreadContext(threadContext);
sampler.setThreadName(threadName);
if (sampler instanceof TestBean) ((TestBean)sampler).prepare();
SampleResult result = sampler.sample(null); // TODO: remove this useless Entry parameter
result.setThreadName(threadName);
threadContext.setPreviousResult(result);
runPostProcessors(pack.getPostProcessors());
checkAssertions(pack.getAssertions(), result);
notifyListeners(pack.getSampleListeners(), result);