protected String getInitFileProperty() {
return INIT_FILE;
}
public void sampleOccurred(SampleEvent se) {
final BeanShellInterpreter bshInterpreter = getBeanShellInterpreter();
if (bshInterpreter == null) {
log.error("BeanShell not found");
return;
}
JMeterContext jmctx = JMeterContextService.getContext();
JMeterVariables vars = jmctx.getVariables();
SampleResult samp=se.getResult();
try {
// Add variables for access to context and variables
bshInterpreter.set("ctx", jmctx);//$NON-NLS-1$
bshInterpreter.set("vars", vars);//$NON-NLS-1$
bshInterpreter.set("sampleEvent", se);//$NON-NLS-1$
bshInterpreter.set("sampleResult", samp);//$NON-NLS-1$
processFileOrScript(bshInterpreter);
} catch (JMeterException e) {
log.warn("Problem in BeanShell script "+e);
}
}