public interface CodeRunner extends HandlerPlugin<Object>
RunService
's execution handling. A
CodeRunner
knows how to execute code of a certain form, such as the
main
method of a Java Class
, or an Identifiable
SciJava module.
Code runner plugins discoverable at runtime must implement this interface
and be annotated with @Plugin
with attribute Plugin.type()
=
CodeRunner
.class. While it possible to create a class runner plugin
merely by implementing this interface, it is encouraged to instead extend
AbstractCodeRunner
, for convenience.
Modifier and Type | Method and Description |
---|---|
default Class<Object> |
getType()
Gets the type associated with the object.
|
void |
run(Object code,
Map<String,Object> inputMap)
Executes the code identified by the given object, passing the arguments in
the specified map as inputs.
|
void |
run(Object code,
Object... args)
Executes the code identified by the given object, passing the
specified arguments as inputs.
|
getIdentifier, log
context, getContext, setContext
compareTo, getPriority, setPriority
getInfo, setInfo
getLocation
getVersion
void run(Object code, Object... args) throws InvocationTargetException
InvocationTargetException
void run(Object code, Map<String,Object> inputMap) throws InvocationTargetException
InvocationTargetException
Copyright © 2015–2022 SciJava. All rights reserved.