|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.safs.tools.drivers.DriverConfiguredSTAFInterfaceClass
org.safs.tools.engines.GenericEngine
public class GenericEngine
| Field Summary | |
|---|---|
protected GenericProcessConsole |
console
The Console handling IO streams for the engine process. |
protected java.lang.Process |
process
The Java Process running the engine. |
protected TestRecordHelper |
testRecordData
Stores the data on the input record we are to process. |
| Fields inherited from class org.safs.tools.drivers.DriverConfiguredSTAFInterfaceClass |
|---|
config, customStr, customText, debugStr, debugText, driver, DRIVER_TEMP_PROCESS, failedStr, failedText, genericStr, genericText, launchCount, log, machine, otherStr, otherText, passedStr, passedText, processName, running, SAFS_RESBUN_NAME, servicename, shutdownCount, staf, STAFPROC_EXE, warningStr, warningText, weStartedService, weStartedSTAF |
| Fields inherited from interface org.safs.tools.engines.EngineInterface |
|---|
COMMAND_SHUTDOWN_HOOK |
| Constructor Summary | |
|---|---|
GenericEngine()
Constructor for GenericEngine |
|
| Method Summary | |
|---|---|
java.lang.String |
getEngineName()
Retrieve the name of the Engine. |
boolean |
isToolRunning()
Verifies a STAF tool matching our engine name is running. |
void |
launchInterface(java.lang.Object configInfo)
Typically expects a DriverInterface object for initialization. |
protected void |
logMessage(java.lang.String msg,
java.lang.String msgdescription,
int msgtype)
Convenience routine for building the appropriate MessageInfo and logging a message to our active log. |
protected java.lang.String |
makeQuotedPath(java.lang.String path,
boolean isFile)
Wraps valid file path in double-quotes if necessary. |
protected java.lang.String |
makeQuotedString(java.lang.String text)
Wraps the privided text in double-quotes *if* the text contains a space. |
protected void |
postShutdownServiceDelay()
Called internally by shutdownService(String). |
long |
processRecord(TestRecordHelper testRecordData)
Initiate the event-driven protocol to send the test record to the engine. |
void |
reset()
Reset or clear any cached information in the underlying tool or service. |
protected boolean |
resetShutdownSemaphore()
This method is intended to reset the "shutdown" semaphore post hook when it stops. |
protected java.lang.String |
saveTestRecordScreenToTestDirectory(TestRecordData testRecordData)
Normally called on failure to execute an IBT command. |
protected long |
setTRDStatus(TestRecordHelper trd,
long status)
Sets TRD statuscode to the provided status and returns the same. |
protected void |
shutdownService(java.lang.String aname)
Shutdown the Engine. |
protected void |
waitHookShutdownAndReset(int timeoutInSeconds)
Called internally by shutdownService(String). |
| Methods inherited from class org.safs.tools.drivers.DriverConfiguredSTAFInterfaceClass |
|---|
extendedGenericMessage, finalize, getSTAFHelper, logMessage, setLogUtilities, shutdown, simpleGenericMessage, simpleGenericSuccessMessage, simpleGenericWarningMessage, simpleSuccessMessage, simpleSuccessMessage, simpleSuccessUsingMessage, standardErrorMessage |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.safs.tools.GenericToolsInterface |
|---|
shutdown |
| Field Detail |
|---|
protected java.lang.Process process
protected GenericProcessConsole console
protected TestRecordHelper testRecordData
| Constructor Detail |
|---|
public GenericEngine()
| Method Detail |
|---|
protected void logMessage(java.lang.String msg,
java.lang.String msgdescription,
int msgtype)
AbstractLogFacilitypublic java.lang.String getEngineName()
EngineInterface
getEngineName in interface EngineInterfaceEngineInterface.getEngineName()public long processRecord(TestRecordHelper testRecordData)
processRecord in interface EngineInterfaceEngineInterface#processRecord()public void launchInterface(java.lang.Object configInfo)
launchInterface in interface ConfigurableToolsInterfacelaunchInterface in class DriverConfiguredSTAFInterfaceClassconfigInfo - can be whatever the final implementation needs it to be. This
might be a String with configuration information, the name of a class, or an instance
of some object used to provide configuration assets.DriverConfiguredSTAFInterfaceClass.launchInterface(Object),
DriverInterfacepublic boolean isToolRunning()
isToolRunning in interface GenericToolsInterfaceisToolRunning in class DriverConfiguredSTAFInterfaceClassGenericToolsInterface.isToolRunning()protected java.lang.String makeQuotedString(java.lang.String text)
protected java.lang.String makeQuotedPath(java.lang.String path,
boolean isFile)
path - to file or directory. Can be relative to the project root directory.isFile - true if the path should be a file, instead of a directory.
protected long setTRDStatus(TestRecordHelper trd,
long status)
public void reset()
GenericToolsInterface
reset in interface GenericToolsInterfaceGenericToolsInterface.reset()protected java.lang.String saveTestRecordScreenToTestDirectory(TestRecordData testRecordData)
the - testRecordData containing the test FileID and test LineNumber for unique image naming.
protected void shutdownService(java.lang.String aname)
All official engines conform to the "SHUTDOWN_HOOK" TestRecordData method to initiate shutdown. So, this function rarely needs to be overridden.
Following the confirmation that the service or engine is no longer 'running',
this implementation will call postShutdownServiceDelay() which is intended
to allow subclasses to delay final shutdown of the process by an arbitrary length
of time while internal shutdown activities are completed.
This implementation then resets "running" to false.
Unregistering staf and nulling superclass objects occurs in the finalize() method of the superclass.
shutdownService in class DriverConfiguredSTAFInterfaceClassaname - is not used directly in this implementation.DriverConfiguredSTAFInterfaceClass.shutdownService(String)protected void waitHookShutdownAndReset(int timeoutInSeconds)
shutdownService(String).
This method is intended to wait for the "shutdown" semaphore post by hook when it stops, then try to reset the "shutdown" semaphore. If we don't reset the "shutdown" semaphore, the driver may see this semaphore and consider that the hook is shutdown and return to try other engine/hook. This method can only try its best to reset "shutdown" semaphore, but this is not guaranteed.
timeoutInSeconds, - int, the timeout in seconds to wait for the "shutdown" semaphoreprotected boolean resetShutdownSemaphore()
This method is intended to reset the "shutdown" semaphore post hook when it stops. Before we reset the "shutdown" semaphore, we should test the condition for resetting. The condition is that only "shutdown" is "posted", the others are "reset".
protected void postShutdownServiceDelay()
shutdownService(String).
This method is intended to allow subclasses to delay final shutdown of the process by an arbitrary length of time while internal shutdown activities are completed.
This default implementation provides no delay and immediately returns.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||