Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.openide.execution 1.8.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.openide.execution
Class ExecutionEngine

    java.lang.Object
      org.openide.execution.ExecutionEngine

    public abstract class ExecutionEngine

extends Object

Engine providing the environment necessary to run long-lived processes. May perform tasks such as setting up thread groups, etc. Modules should not implement this class.

Constructor Summary
`ExecutionEngine()`

Method Summary
`protected abstract NbClassPath` | `createLibraryPath()` Deprecated. 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.
`protected abstract PermissionCollection` | `createPermissions(CodeSource cs, InputOutput io)` Trap accesses to Users that want to link their classes with the IDE should do this through internal execution.
`abstract ExecutorTask` | `execute(String name, Runnable run, InputOutput io)` Run some task in the execution engine.
`static ExecutionEngine` | `getDefault()` Obtains default instance of the execution engine.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ExecutionEngine

    public ExecutionEngine()

Method Detail

### execute

    public abstract ExecutorTask execute(String name,
                                         Runnable run,
                                         InputOutput io)

  Run some task in the execution engine.

  Parameters:
    `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 null if no such redirection is required
  Returns:
    an executor task that can control the execution

### createPermissions

    protected abstract PermissionCollection createPermissions(CodeSource cs,
                                                              InputOutput io)

  Trap accesses to Users that want to link their classes with the IDE should do this through internal execution. The `NbClassLoader` used 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.out` etc., it is possible to find the appropriate tab for redirection.

  Parameters:
    `cs` - code source to construct the permission collection for
    `io` - an I/O tab
  Returns:
    a permission collection

### createLibraryPath

    protected abstract NbClassPath createLibraryPath()

  Deprecated. 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.

  Method that allows implementor of the execution engine to provide class path to all libraries that one could find useful for development in the system.

  Returns:
    class path to libraries

### getDefault

    public static ExecutionEngine getDefault()

  Obtains default instance of the execution engine. If default `Lookup` contains an instance of `ExecutionEngine`, that is used. Otherwise, a trivial basic implementation is returned with the following behavior:
  - `execute(java.lang.String, java.lang.Runnable, org.openide.windows.InputOutput)` just runs the runnable immediately and pretends to be done.
  - `createPermissions(java.security.CodeSource, org.openide.windows.InputOutput)` just uses `AllPermission`. No I/O redirection or `System.exit(int)` trapping is done.
  - `createLibraryPath()` produces an empty path.
  This basic implementation is helpful in unit tests and perhaps in standalone usage of other libraries.

  Returns:
    some execution engine implementation (never null)
  Since:
    2.16

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
| org.openide.execution 1.8.22
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Built on December 7 2006. | Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.