compbio.engine.client
Class ConfExecutable<T>

java.lang.Object
  extended by compbio.engine.client.ConfExecutable<T>
All Implemented Interfaces:
ConfiguredExecutable<T>, Executable<T>, PipedExecutable<T>

public class ConfExecutable<T>
extends Object
implements ConfiguredExecutable<T>


Nested Class Summary
 
Nested classes/interfaces inherited from interface compbio.engine.client.Executable
Executable.ExecProvider
 
Field Summary
static String CLUSTER_TASK_ID_PREFIX
           
 
Constructor Summary
ConfExecutable(Executable<T> executable, String taskDirectory)
           
 
Method Summary
 Executable<T> addParameters(List<String> parameters)
          Adds parameter to the list of parameters for a native executable
 String getClusterJobSettings()
           
 String getCommand(Executable.ExecProvider provider)
           
 List<String> getCreatedFiles()
           
 Map<String,String> getEnvironment()
           
 String getError()
           
 Executable.ExecProvider getExecProvider()
           
 Executable<T> getExecutable()
           
 String getInput()
          Not all input paths are relative! Input path could be absolute!
 Limit<T> getLimit(String presetName)
           
 LimitsManager<T> getLimits()
           
 String getOutput()
           
 CommandBuilder<T> getParameters()
           
 CommandBuilder<T> getParameters(Executable.ExecProvider provider)
           
<V> V
getResults()
           
<V> V
getResults(String directory)
           
 RunConfiguration getRunConfiguration()
           
static
<V> LimitsManager<V>
getRunnerLimits(Class<V> clazz)
          This method should be executed once and result of its execution reused.
static
<V> RunnerConfig<V>
getRunnerOptions(Class<? extends Executable<V>> clazz)
           
static
<V> PresetManager<V>
getRunnerPresets(Class<? extends Executable<V>> clazz)
           
 Executable.ExecProvider getSupportedRuntimes()
           
 String getTaskId()
           
 String getWorkDirectory()
           
 ConfiguredExecutable<?> loadRunConfiguration(InputStream input)
           
 ConfiguredExecutable<?> loadRunConfiguration(RunConfiguration rconf)
           
static ConfiguredExecutable<?> newConfExecutable(RunConfiguration rconf)
           
 boolean saveRunConfiguration()
           
 void setExecProvider(Executable.ExecProvider provider)
           
 void setWorkDirectory(String workDirectory)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLUSTER_TASK_ID_PREFIX

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

ConfExecutable

public ConfExecutable(Executable<T> executable,
                      String taskDirectory)
Method Detail

getExecProvider

public Executable.ExecProvider getExecProvider()
Specified by:
getExecProvider in interface ConfiguredExecutable<T>

setExecProvider

public void setExecProvider(Executable.ExecProvider provider)

getCommand

public String getCommand(Executable.ExecProvider provider)
                  throws UnsupportedRuntimeException
Specified by:
getCommand in interface ConfiguredExecutable<T>
Throws:
UnsupportedRuntimeException

getSupportedRuntimes

public Executable.ExecProvider getSupportedRuntimes()
Specified by:
getSupportedRuntimes in interface ConfiguredExecutable<T>

getLimit

public Limit<T> getLimit(String presetName)
Specified by:
getLimit in interface Executable<T>

getLimits

public LimitsManager<T> getLimits()
Specified by:
getLimits in interface Executable<T>

getTaskId

public String getTaskId()
Specified by:
getTaskId in interface ConfiguredExecutable<T>

setWorkDirectory

public void setWorkDirectory(String workDirectory)
Specified by:
setWorkDirectory in interface ConfiguredExecutable<T>

getWorkDirectory

public String getWorkDirectory()
Specified by:
getWorkDirectory in interface ConfiguredExecutable<T>

addParameters

public Executable<T> addParameters(List<String> parameters)
Description copied from interface: Executable
Adds parameter to the list of parameters for a native executable

Specified by:
addParameters in interface Executable<T>
Returns:
this Executable

getOutput

public String getOutput()
Specified by:
getOutput in interface Executable<T>

getError

public String getError()
Specified by:
getError in interface Executable<T>

getCreatedFiles

public List<String> getCreatedFiles()
Specified by:
getCreatedFiles in interface Executable<T>

getInput

public String getInput()
Not all input paths are relative! Input path could be absolute!

Specified by:
getInput in interface Executable<T>
See Also:
compbio.engine.client.Executable#getInputFiles()

getParameters

public CommandBuilder<T> getParameters()
Specified by:
getParameters in interface ConfiguredExecutable<T>

getParameters

public CommandBuilder<T> getParameters(Executable.ExecProvider provider)
Specified by:
getParameters in interface Executable<T>

getExecutable

public Executable<T> getExecutable()
Specified by:
getExecutable in interface ConfiguredExecutable<T>

getResults

public <V> V getResults()
             throws ResultNotAvailableException
Specified by:
getResults in interface ConfiguredExecutable<T>
Throws:
ResultNotAvailableException

getResults

public <V> V getResults(String directory)
             throws ResultNotAvailableException
Specified by:
getResults in interface Executable<T>
Throws:
ResultNotAvailableException

getRunnerOptions

public static <V> RunnerConfig<V> getRunnerOptions(Class<? extends Executable<V>> clazz)
                                        throws IOException
Throws:
IOException

getRunnerPresets

public static <V> PresetManager<V> getRunnerPresets(Class<? extends Executable<V>> clazz)
                                         throws IOException
Throws:
IOException

getRunnerLimits

public static <V> LimitsManager<V> getRunnerLimits(Class<V> clazz)
                                        throws IOException
This method should be executed once and result of its execution reused. If not used carefully it could slow down the system!

Type Parameters:
V -
Parameters:
clazz -
Returns:
LimitsManager instance
Throws:
IOException

getEnvironment

public Map<String,String> getEnvironment()
Specified by:
getEnvironment in interface ConfiguredExecutable<T>

loadRunConfiguration

public ConfiguredExecutable<?> loadRunConfiguration(RunConfiguration rconf)
Specified by:
loadRunConfiguration in interface Executable<T>

newConfExecutable

public static ConfiguredExecutable<?> newConfExecutable(RunConfiguration rconf)

saveRunConfiguration

public boolean saveRunConfiguration()
                             throws IOException
Specified by:
saveRunConfiguration in interface ConfiguredExecutable<T>
Throws:
IOException

getRunConfiguration

public RunConfiguration getRunConfiguration()

loadRunConfiguration

public ConfiguredExecutable<?> loadRunConfiguration(InputStream input)
                                             throws IOException
Specified by:
loadRunConfiguration in interface ConfiguredExecutable<T>
Throws:
IOException

toString

public String toString()
Overrides:
toString in class Object

getClusterJobSettings

public String getClusterJobSettings()
Specified by:
getClusterJobSettings in interface Executable<T>