org.eclipse.ease.modules.platform

## Class Future

- java.lang.Object
- - org.eclipse.ease.modules.platform.Future

    public class Future
    extends Object

Future object tracking an asynchronous execution result.

### Constructor Summary

Constructors
Constructor and Description
`Future(Exception exception)` Constructor for exceptions.
`Future(Process process)` Constructor for a process.

### Method Summary

All Methods Instance Methods Concrete Methods
`String` `getError()` Get the error text of the process as string.
`int` `getExitCode()` Get exit code of external process.
`String` `getOutput()` Get the output of the process as string.
`boolean` `isFinished()` Query external process for finished state.
`boolean` `join()` Wait for external process to finish

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### Future

    public Future(Process process)

Constructor for a process.

Parameters:
  `process` - running process

#### Future

    public Future(Exception exception)

Constructor for exceptions.

Parameters:
  `exception` - exception to provide for user

### Method Detail

#### isFinished

    public boolean isFinished()

Query external process for finished state.

Returns:
  `true` when finished

#### join

    public boolean join()

Wait for external process to finish

Returns:
  `true` when finished

#### getExitCode

    public int getExitCode()

Get exit code of external process. In case of an exception -1 is returned.

Returns:
  exit code

#### getOutput

    public String getOutput()

Get the output of the process as string. This method works only once as it consumes a stream.

Returns:
  process output

#### getError

    public String getError()

Get the error text of the process as string. This method works only once as it consumes a stream.

Returns:
  process error text (or exception message)