public class MessengerRunner extends java.lang.Object implements MessengerListener, java.lang.Runnable
AbstractTestRunner
,
RobotiumTestRunner
Modifier and Type | Field and Description |
---|---|
(package private) CommandListener |
commandListener |
(package private) DebugListener |
debugListener |
(package private) int |
iNotification |
static java.lang.String |
listenerName |
(package private) boolean |
messageHandled |
(package private) MessengerHandler |
messageHandler
messageHandler is used to handle the received message from 'TCP Messenger'
|
(package private) android.os.Messenger |
mMessenger
mMessenger is used to receive message from message-service server
|
(package private) android.os.Messenger |
mService
mService is the messenger to be used to send out message to 'TCP Messenger'
|
(package private) java.lang.String |
trd_message |
(package private) java.util.Properties |
trd_props |
Constructor and Description |
---|
MessengerRunner(android.os.Messenger mService) |
MessengerRunner(android.os.Messenger mService,
CommandListener commandListener) |
Modifier and Type | Method and Description |
---|---|
void |
debug(java.lang.String message) |
CommandListener |
getCommandListener() |
DebugListener |
getDebugListener() |
java.lang.String |
getListenerName()
Unique name to identify the listener.
|
android.os.Messenger |
getmService() |
void |
onAllParcelsHaveBeenHandled(java.lang.String messageID) |
void |
onParcelHasBeenHandled(java.lang.String messageID,
int index) |
void |
onReceiveDebug(java.lang.String message)
A remote client has sent a Debug message to be logged by the listener.
|
void |
onRemoteConnected() |
void |
onRemoteDisconnected() |
void |
onRemoteDispatchFile(java.lang.String message) |
void |
onRemoteDispatchProps(java.util.Properties props) |
void |
onRemoteEngineShutdown()
Remote request/command to tell the engine to perform a normal shutdown.
|
void |
onRemoteMessage(java.lang.String message) |
void |
onRemoteShutdown()
Notification that the Remote Controller has shutdown and is no longer available.
|
void |
onServiceShutdown()
Notification that the Messenger Service has shutdown and is no longer available.
|
void |
prepareNotification(int what)
MessengerHandler preparing information for Thread switching.
|
void |
run()
Primary looping test thread remains active for as long as we are bound to a TCP Messenger Service.
|
boolean |
sendDebug(java.lang.String message)
Create and send a MSG_ENGINE_DEBUG message.
|
boolean |
sendException(java.lang.String message)
Create and send a MSG_ENGINE_EXCEPTION signaling the engine has detected and caught an Exception and
is reporting that to the remote test controller.
|
boolean |
sendMessage(java.lang.String message)
Create and send a MSG_SERVER_MESSAGE signaling the engine has sent a custom/arbitrary message or response
to the remote test controller.
|
boolean |
sendReady()
Create and send a MSG_ENGINE_READY signaling the engine is ready to process remote commands.
|
boolean |
sendRegisterEngine()
Create and send a ID_REGISTER_ENGINE signaling the engine is registered.
|
boolean |
sendRunning()
Create and send a MSG_ENGINE_RUNNING signaling the engine is processing the remote command.
|
(package private) boolean |
sendServiceMessage(int what,
java.lang.String message)
Note: NEVER call debug() in this method or in the method it will call!!! It causes StackOverFlow.
|
boolean |
sendServiceParcelAcknowledge(java.lang.String messageID,
int index) |
boolean |
sendServiceProperties(int what,
java.util.Properties props) |
boolean |
sendServiceResult(int statuscode,
java.lang.String statusinfo)
Create and send a MSG_ENGINE_RESULT message with the int statuscode and String statusinfo
result from processing a previous command/dispatch.
|
boolean |
sendServiceResult(MessageResult result) |
boolean |
sendServiceResult(java.util.Properties props)
Create and send a MSG_ENGINE_RESULTPROPS message with the Properties
result from processing a previous command/dispatch.
|
boolean |
sendShutdown()
Create and send a MSG_ENGINE_SHUTDOWN signaling the engine has or is in the process of shutting down.
|
boolean |
sendUnRegisterEngine()
Create and send a ID_UNREGISTER_ENGINE signaling the engine is un-registered.
|
void |
setCommandListener(CommandListener commandListener) |
void |
setDebugListener(DebugListener debugListener) |
void |
setmService(android.os.Messenger mService) |
boolean |
start() |
void |
stop() |
public static final java.lang.String listenerName
boolean messageHandled
java.util.Properties trd_props
java.lang.String trd_message
int iNotification
MessengerHandler messageHandler
final android.os.Messenger mMessenger
android.os.Messenger mService
CommandListener commandListener
DebugListener debugListener
public MessengerRunner(android.os.Messenger mService)
public MessengerRunner(android.os.Messenger mService, CommandListener commandListener)
public java.lang.String getListenerName()
NamedListener
getListenerName
in interface NamedListener
public android.os.Messenger getmService()
public void setmService(android.os.Messenger mService)
public CommandListener getCommandListener()
public void setCommandListener(CommandListener commandListener)
public DebugListener getDebugListener()
public void setDebugListener(DebugListener debugListener)
public void debug(java.lang.String message)
public void onReceiveDebug(java.lang.String message)
DebugListener
onReceiveDebug
in interface DebugListener
public void prepareNotification(int what)
prepareNotification
in interface MessengerListener
public void onRemoteDispatchProps(java.util.Properties props)
onRemoteDispatchProps
in interface MessengerListener
public void onRemoteDispatchFile(java.lang.String message)
onRemoteDispatchFile
in interface MessengerListener
public void onRemoteMessage(java.lang.String message)
onRemoteMessage
in interface MessengerListener
public void onRemoteConnected()
onRemoteConnected
in interface MessengerListener
public void onRemoteDisconnected()
onRemoteDisconnected
in interface MessengerListener
public void onRemoteShutdown()
onRemoteShutdown
in interface MessengerListener
public void onServiceShutdown()
onServiceShutdown
in interface MessengerListener
public void onRemoteEngineShutdown()
onRemoteEngineShutdown
in interface MessengerListener
public void run()
run
in interface java.lang.Runnable
public boolean start()
public void stop()
boolean sendServiceMessage(int what, java.lang.String message)
what,
- the message int flagging what kind of message we are sending.message,
- the actual message--which can be null.public boolean sendServiceResult(MessageResult result)
public boolean sendServiceResult(int statuscode, java.lang.String statusinfo)
sendServiceResult(Properties)
public boolean sendServiceParcelAcknowledge(java.lang.String messageID, int index)
public boolean sendServiceResult(java.util.Properties props)
sendServiceResult(int,String)
public boolean sendServiceProperties(int what, java.util.Properties props)
public boolean sendShutdown()
sendServiceMessage(int, String)
public boolean sendReady()
sendServiceMessage(int, String)
public boolean sendRunning()
sendServiceMessage(int, String)
public boolean sendDebug(java.lang.String message)
sendServiceMessage(int, String)
public boolean sendMessage(java.lang.String message)
sendServiceMessage(int, String)
public boolean sendException(java.lang.String message)
sendServiceMessage(int, String)
public boolean sendRegisterEngine()
sendServiceMessage(int, String)
public boolean sendUnRegisterEngine()
sendServiceMessage(int, String)
public void onAllParcelsHaveBeenHandled(java.lang.String messageID)
onAllParcelsHaveBeenHandled
in interface MultipleParcelListener
public void onParcelHasBeenHandled(java.lang.String messageID, int index)
onParcelHasBeenHandled
in interface MultipleParcelListener
Copyright © SAS Institute. All Rights Reserved.