Brooklyn

brooklyn.util.internal.ssh.process
[Java] Class ProcessTool

java.lang.Object
  brooklyn.util.internal.ssh.ShellAbstractTool
      brooklyn.util.internal.ssh.process.ProcessTool
All Implemented Interfaces:
ShellTool

public class ProcessTool
extends ShellAbstractTool

Implementation of ShellTool which runs locally.


Field Summary
static ConfigKey PROP_LOGIN_SHELL

 
Fields inherited from class ShellAbstractTool
localTempDir
 
Constructor Summary
ProcessTool()

ProcessTool(java.util.Map flags)

 
Method Summary
int execCommands(java.util.Map props, java.util.List commands, java.util.Map env)

static int execProcesses(java.util.List cmds, java.util.Map env, java.io.OutputStream out, java.io.OutputStream err, java.lang.String separator, java.lang.Object contextForLogging)

as execProcesses(List, Map, OutputStream, OutputStream, String, boolean, Object) but not using a login shell

static int execProcesses(java.util.List cmds, java.util.Map env, java.io.OutputStream out, java.io.OutputStream err, java.lang.String separator, boolean asLoginShell, java.lang.Object contextForLogging)

executes a set of commands by sending them as a single process to `bash -c` (single command argument of all the commands, joined with separator)

int execScript(java.util.Map props, java.util.List commands, java.util.Map env)

static int execSingleProcess(java.util.List cmdWords, java.util.Map env, java.io.OutputStream out, java.io.OutputStream err, java.lang.Object contextForLogging)

executes a single process made up of the given command words (*not* bash escaped); should be portable across OS's

 
Methods inherited from class ShellAbstractTool
asInt, buildRunScriptCommand, closeWhispering, closeWhispering, execCommands, execScript, getMandatoryVal, getMandatoryVal, getOptionalVal, getOptionalVal, getOptionalVal, hasVal, toCommandSequence, toScript, warnOnDeprecated, writeTempFile, writeTempFile, writeTempFile
 

Field Detail

PROP_LOGIN_SHELL

public static final ConfigKey PROP_LOGIN_SHELL


 
Constructor Detail

ProcessTool

public ProcessTool()


ProcessTool

public ProcessTool(java.util.Map flags)


 
Method Detail

execCommands

if (props.containsKey("blocks") && props.get("blocks") == Boolean.FALSE) {
public int execCommands(java.util.Map props, java.util.List commands, java.util.Map env)


execProcesses

public static int execProcesses(java.util.List cmds, java.util.Map env, java.io.OutputStream out, java.io.OutputStream err, java.lang.String separator, java.lang.Object contextForLogging)
as execProcesses(List, Map, OutputStream, OutputStream, String, boolean, Object) but not using a login shell


execProcesses

public static int execProcesses(java.util.List cmds, java.util.Map env, java.io.OutputStream out, java.io.OutputStream err, java.lang.String separator, boolean asLoginShell, java.lang.Object contextForLogging)
executes a set of commands by sending them as a single process to `bash -c` (single command argument of all the commands, joined with separator)

consequence of this is that you should not normally need to escape things oddly in your commands, type them just as you would into a bash shell (if you find exceptions please note them here!)


execScript

try {
public int execScript(java.util.Map props, java.util.List commands, java.util.Map env)


execSingleProcess

public static int execSingleProcess(java.util.List cmdWords, java.util.Map env, java.io.OutputStream out, java.io.OutputStream err, java.lang.Object contextForLogging)
executes a single process made up of the given command words (*not* bash escaped); should be portable across OS's


 

Brooklyn Multi-Cloud Application Management Platform
brooklyncentral.github.com. Apache License. © 2012.