public abstract class ExecutionEngine extends Object
Note for implementors: it is highly advised that the value
Lookup#getDefault is saved,
and established in the forked thread before the executed
Runnable is called. This is
done by OpenIDE libraries If the ExecutionEngine implementation uses
planning the tasks.
|Constructor and Description|
|Modifier and Type||Method and Description|
There are generally no excuses to be using this method as part of a normal module; its exact meaning is vague, and probably not what you want.
Users that want to link their classes with NetBeans module classes should do this through internal execution.
Run some task in the execution engine.
Obtains default instance of the execution engine.
public abstract ExecutorTask execute(String name, Runnable run, InputOutput io)
name- a name of the new process
run- a runnable to execute
io- an I/O handle to automatically redirect system I/O streams in the dynamic scope of the task to, or InputOutput.NULL if no such redirection is required
protected abstract PermissionCollection createPermissions(CodeSource cs, InputOutput io)
NbClassLoaderused in internal execution will assume that calling this method and giving the permission collection to the class being defined will trigger automatic redirection of system output, input, and error streams into the given I/O tab. Implementations of the engine should bind the tab and returned permissions. Since the permission collection is on the stack when calling methods on
System.outetc., it is possible to find the appropriate tab for redirection.
cs- code source to construct the permission collection for
io- an I/O tab
@Deprecated protected abstract NbClassPath createLibraryPath()
public static ExecutionEngine getDefault()
Lookupcontains an instance of
ExecutionEngine, that is used. Otherwise, a trivial basic implementation is returned with the following behavior:
ExecutionEngine.execute(java.lang.String, java.lang.Runnable, org.openide.windows.InputOutput)just runs the runnable immediately and pretends to be done.
ExecutionEngine.createPermissions(java.security.CodeSource, org.openide.windows.InputOutput)just uses
AllPermission. No I/O redirection or
System.exit(int)trapping is done.
ExecutionEngine.createLibraryPath()produces an empty path.