public abstract class JavaSocketsHook extends JavaHook implements DebugListener
Modifier and Type | Field and Description |
---|---|
protected int |
remoteConnectionTimeout
Default remote connection timeout is 30 seconds.
|
(package private) int |
remoteLogtype |
protected int |
remoteReadyTimeout
Default remote Ready timeout is 10 seconds.
|
protected int |
remoteRunningTimeout
Default remote Running timeout is 10 seconds.
|
(package private) boolean |
remoteShutdown |
protected SocketTestRecordHelper |
socketdata
The standard data TestRecordHelper simply cast to a SocketTestRecordHelper type for convenience.
|
protected SAFSRemoteControl |
tcpServer
Not instantiated until the call to
createProtocolRunner() . |
data, DEBUG_MESSAGE, errorText, FAILED_MESSAGE, FAILED_OK_MESSAGE, GENERIC_ERROR, GENERIC_MESSAGE, helper, hookconfig, log, PASSED_MESSAGE, PAUSE_EXECUTION, PAUSE_SWITCH_OFF, PAUSE_SWITCH_ON, process_name, processor, REQUEST_PROCEED_TESTING, REQUEST_USER_STOPPED_SCRIPT_REQUEST, RUNNING_EXECUTION, semaphore_name, SHUTDOWN_RECORD, STAF_ERROR, STEP_EXECUTION, STEP_RETRY_EXECUTION, STEPPING_EXECUTION, STEPPING_RETRY_EXECUTION, trd_name, utils, WARNING_MESSAGE, WARNING_OK_MESSAGE
Constructor and Description |
---|
JavaSocketsHook() |
JavaSocketsHook(java.lang.String process_name) |
JavaSocketsHook(java.lang.String process_name,
LogUtilities logs) |
JavaSocketsHook(java.lang.String process_name,
java.lang.String trd_name) |
JavaSocketsHook(java.lang.String process_name,
java.lang.String trd_name,
LogUtilities logs) |
JavaSocketsHook(java.lang.String process_name,
java.lang.String trd_name,
LogUtilities logs,
SocketTestRecordHelper trd_data,
DDGUIUtilities gui_utils,
ProcessRequest aprocessor) |
Modifier and Type | Method and Description |
---|---|
protected boolean |
afterLaunchRemoteEngine()
Invoked during start loop initialization.
|
protected boolean |
beforeLaunchRemoteEngine()
Invoked during start loop initialization.
|
protected abstract boolean |
createProtocolRunner()
Invoked during start loop initialization.
|
protected void |
disconnectSocketServer() |
java.lang.String |
getListenerName()
Default implementation returns our process_name.
|
TestRecordHelper |
getTRDData()
Retrieve the SocketTestRecordHelper used by the subclass.
|
protected boolean |
hook_shutdown()
Sends a shutdown command to the tcpServer if the tcpServer
is NOT the one that initiated the shutdown.
|
protected void |
interpretResultProperties(java.util.Properties remoteResultProperties)
Called by the running loop to extract whatever remoteResultProperties were received.
|
protected abstract boolean |
launchRemoteEngine()
Invoked during start loop initialization.
|
protected abstract void |
logResultsMessage()
Called by the running loop when it is time to log the results of the executed command.
|
void |
onReceiveDebug(java.lang.String message)
Default implementation logs the message to the SAFS Debug Log.
|
void |
setTRDData(TestRecordHelper trd_data)
Force the use of a SocketTestRecordHelper as required by the underlying remote engine hook.
|
void |
start()
Normal JavaHook start loop initialization and looping is augmented with additional requirements to
handle the communications and synchronization with a remote socket-controlled engine as follows:
normal initialization for STAFHelper, GUIUtilities, TestRecordHelper, and RequestProcessor.
|
protected boolean |
startProtocolRunner()
Invoked during start loop initialization.
|
allowSystemExit, checkConfiguration, driverShutdownRequest, evaluateRuntimeException, getGUIUtilities, getHelper, getLogUtilities, getProcessName, getRequestProcessor, getSemaphoreName, getTRDName, initConfigPaths, instantiateHookConfig, setGUIUtilities, setHelper, setLogUtilities, setProcessName, setRequestProcessor, setSemaphoreName, setTRDName
protected SAFSRemoteControl tcpServer
createProtocolRunner()
.protected int remoteConnectionTimeout
protected int remoteReadyTimeout
protected int remoteRunningTimeout
protected SocketTestRecordHelper socketdata
boolean remoteShutdown
int remoteLogtype
public JavaSocketsHook()
public JavaSocketsHook(java.lang.String process_name)
process_name
- public JavaSocketsHook(java.lang.String process_name, LogUtilities logs)
process_name
- logs
- public JavaSocketsHook(java.lang.String process_name, java.lang.String trd_name)
process_name
- trd_name
- public JavaSocketsHook(java.lang.String process_name, java.lang.String trd_name, LogUtilities logs)
process_name
- trd_name
- logs
- public JavaSocketsHook(java.lang.String process_name, java.lang.String trd_name, LogUtilities logs, SocketTestRecordHelper trd_data, DDGUIUtilities gui_utils, ProcessRequest aprocessor)
process_name
- trd_name
- logs
- trd_data
- gui_utils
- aprocessor
- protected boolean beforeLaunchRemoteEngine()
launchRemoteEngine()
. The default implementation does
nothing and returns true to allow execution to proceed.protected abstract boolean launchRemoteEngine()
protected boolean afterLaunchRemoteEngine()
launchRemoteEngine()
but prior to the entry to the main start loop.
The default implementation does nothing and returns true to allow execution to proceed.protected abstract boolean createProtocolRunner()
protected boolean startProtocolRunner()
public TestRecordHelper getTRDData()
getTRDData
in class JavaHook
SAFSRuntimeException
- if the instance is NOT a SocketTestRecordHelper subclass.public void setTRDData(TestRecordHelper trd_data)
setTRDData
in class JavaHook
SAFSRuntimeException
- if the instance is NOT a SocketTestRecordHelper subclass.protected void interpretResultProperties(java.util.Properties remoteResultProperties)
protected abstract void logResultsMessage()
LogUtilities.logMessage(String, String, int, String)
public void start()
createProtocolRunner()
beforeLaunchRemoteEngine()
launchRemoteEngine()
afterLaunchRemoteEngine()
startProtocolRunner()
SoloRemoteControl.waitForRemoteConnected(int)
start
in class JavaHook
JavaHook.start()
protected boolean hook_shutdown()
hook_shutdown
in class JavaHook
JavaHook.hook_shutdown()
protected void disconnectSocketServer()
public java.lang.String getListenerName()
getListenerName
in interface NamedListener
public void onReceiveDebug(java.lang.String message)
onReceiveDebug
in interface DebugListener
Copyright © SAS Institute. All Rights Reserved.