compbio.engine.local
Class ExecutableWrapper

java.lang.Object
  extended by compbio.engine.local.ExecutableWrapper
All Implemented Interfaces:
Callable<ConfiguredExecutable<?>>

@Immutable
public final class ExecutableWrapper
extends Object
implements Callable<ConfiguredExecutable<?>>


Field Summary
static String PROC_ERR_FILE
           
static String PROC_OUT_FILE
           
 
Constructor Summary
ExecutableWrapper(ConfiguredExecutable<?> executable, String workDirectory)
           
 
Method Summary
 ConfiguredExecutable<?> call()
          It is vital that output and error streams are captured immediately for this call() to succeed.
static void shutdownService()
          Stops internal executor service which captures streams of native executables.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROC_OUT_FILE

public static final String PROC_OUT_FILE
See Also:
Constant Field Values

PROC_ERR_FILE

public static final String PROC_ERR_FILE
See Also:
Constant Field Values
Constructor Detail

ExecutableWrapper

public ExecutableWrapper(ConfiguredExecutable<?> executable,
                         String workDirectory)
                  throws JobSubmissionException
Throws:
JobSubmissionException
Method Detail

shutdownService

public static final void shutdownService()
Stops internal executor service which captures streams of native executables. This method is intended for stopping service if deployed in the web application content. There is NO NEED of using this method otherwise as the executor service is taken care of internally.


call

public ConfiguredExecutable<?> call()
                             throws IOException
It is vital that output and error streams are captured immediately for this call() to succeed. Thus each instance if ExecutableWrapper has 2 its own thread ready to capture the output. If executor could not execute capture immediately this could lead to the call method to stale, as execution could not proceed without output being captured. Every call to call() method will use 2 threads

Specified by:
call in interface Callable<ConfiguredExecutable<?>>
Throws:
IOException