public interface ScriptEngineService
The Grinder discovers script engine implementations from the META-INF/net.grinder.scriptengines
resource files. Each engine should
register its class name as a line in such a resource file. The order of the
search engines is important, since it determines priority. The engines are
ordered first by the class path search order used to load the resource files,
and then the order of lines in the resource files. Earlier engines have
higher priority.
Each script engine is injected with framework services using PicoContainer. The use of PicoContainer should be transparent; implementations simply need to declare the services they require as constructor parameters.
Available services include:
net.grinder.common.Logger
net.grinder.common.GrinderProperties
net.grinder.script.ScriptContext
net.grinder.scriptengine.DCRContext
A DCRContext
will be provided only if DCR is available. Engines that
use DCR should have two constructors, one of them requiring a DCRContext
, and one of them not. The latter constructor will be used if DCR
is unavailable.
Modifier and Type | Interface and Description |
---|---|
static interface |
ScriptEngineService.ScriptEngine
Handler for a particular type of script.
|
static interface |
ScriptEngineService.WorkerRunnable
Interface to the runnable script object for a particular worker thread.
|
Modifier and Type | Field and Description |
---|---|
static String |
RESOURCE_NAME
All resources with this name are loaded to discover implementations.
|
Modifier and Type | Method and Description |
---|---|
List<? extends Instrumenter> |
createInstrumenters()
Initialises script engine instrumentation.
|
ScriptEngineService.ScriptEngine |
createScriptEngine(ScriptLocation script)
If the script engine service can handle the given script, it should return
a suitable implementation.
|
static final String RESOURCE_NAME
ScriptEngineService.ScriptEngine createScriptEngine(ScriptLocation script) throws EngineException
Implementations typically will execute the script and perform any process level initialisation.
script
- The script.null
.EngineException
- If an implementation could not be created.List<? extends Instrumenter> createInstrumenters() throws EngineException
Each script engine can provide instrumenters, irrespective of the engine used to execute the script. The instrumenters provided by each engine are consulted according to service registration order in the META-INF file.
EngineException
- If a problem occurred creating instrumenters.Copyright © 2000-2014. All Rights Reserved.