public class CommandSender extends AbstractSender
AbstractSender.target
property)
in a separate process to send the message payload (if message is specified) passed to the standard input of
the process or as the command argument.Modifier and Type | Class and Description |
---|---|
static class |
CommandSender.MessageFrom
The origin where the messages are taken from..
|
Constructor and Description |
---|
CommandSender() |
Modifier and Type | Method and Description |
---|---|
void |
doClose() |
void |
doInit(Properties messageAttributes) |
Serializable |
doSend(Message message,
MeasurementUnit measurementUnit)
Actually performs the send operation.
|
String[] |
getEnvironmentVariables()
Gets an array of environment variables.
|
CommandSender.MessageFrom |
getMessageFrom()
Gets the value of messageFrom property.
|
void |
postSend(Message message)
Performs any action that needs to be done to complete the sending of the message but is not directly related to the sending operation and thus not measured.
|
void |
preSend(Message message,
Properties messageAttributes)
Performs any action that needs to be done to send the message but is not directly related to the sending operation and thus not measured.
|
CommandSender |
setEnvironmentVariables(String[] environmentVariables)
Sets the environment variables from an array.
|
CommandSender |
setMessageFrom(CommandSender.MessageFrom messageFrom)
Sets the value of messageFrom property.
|
close, getTarget, getTarget, init, isKeepConnection, safeGetTarget, send, setKeepConnection, setTarget
public void doInit(Properties messageAttributes) throws PerfCakeException
doInit
in class AbstractSender
PerfCakeException
public void doClose()
doClose
in class AbstractSender
public void preSend(Message message, Properties messageAttributes) throws Exception
MessageSender
preSend
in interface MessageSender
preSend
in class AbstractSender
message
- Message to be sent.messageAttributes
- Attributes that can be used to replace placeholders in message and or target.Exception
- In case anything fails during the preparation.public Serializable doSend(Message message, MeasurementUnit measurementUnit) throws Exception
AbstractSender
doSend
in class AbstractSender
message
- Message to be sent.measurementUnit
- Measurement unit carrying the current stop-watch.Exception
- When the sending operation failed.MessageSender.send(org.perfcake.message.Message, org.perfcake.reporting.MeasurementUnit)
public void postSend(Message message) throws Exception
MessageSender
postSend
in interface MessageSender
postSend
in class AbstractSender
message
- Message that was sent.Exception
- In case anything fails during the finalization.public CommandSender.MessageFrom getMessageFrom()
public CommandSender setMessageFrom(CommandSender.MessageFrom messageFrom)
messageFrom
- The messageFrom value.public String[] getEnvironmentVariables()
public CommandSender setEnvironmentVariables(String[] environmentVariables)
environmentVariables
- The environment variables array.Copyright © 2010–2017 PerfCake Community. All rights reserved.