public interface Agent
extends java.rmi.Remote
A SAFS Engine RMI Server is the centralized controller that will talk with each RMI Agent embedded within each enabled JVM. This provides an RMI alternative to STAF for multi-JVM communications between the very visible SAFS Engine and the invisible Agents in each JVM.
The typical scenario here would be that a SAFS Engine like SAFS/Abbot would still present a single STAF-based event-driven interface for the TID and any other Driver wishing to use it, but underneath the engine will be communicating with multiple JVMs over localhost RMI.
The RMI Agent is normally automatically loaded into each enabled JVM as a Java Extension exploiting the Accessibility hooks in the JVM. This will be done through the SAFS Bootstrap AgentClassLoader.
This is somewhat analogous to how other tools like RobotJ, Robot, and WinRunner communicate with all running JVMs through a single script engine or controller.
Note: For consistent operation the safs.server.hostname
needs to be set in code or
on the command line before launching an Agent connecting to a SAFS RMI Server:
System.setProperty("safs.server.hostname", "<rmi server ip>");
System.setProperty("safs.server.hostname", "hostname.company.internal.net");
-Dsafs.server.hostname=<rmi server ip>
-Dsafs.server.hostname=hostname.company.internal.net
Bootstrap
,
AgentClassLoader
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
SERVER_HOSTNAME_SYSTEM_PROPERTY
'safs.server.hostname' Name of the System Property signifying a remote SAFS RMI Server
hostname to seek for a SAFS RMI Server.
|
Modifier and Type | Method and Description |
---|---|
java.rmi.server.ObjID |
getAgentID()
Returns an ObjID to uniquely identify the JVM Agent.
|
java.lang.String |
getAgentName()
Returns the name or remoteType of the JVM Agent.
|
java.lang.String |
getCaption(java.lang.Object object)
Retrieve the Caption of the object if one exits.
|
int |
getChildCount(java.lang.Object parent)
Return the number of children available in the provided parent.
|
java.lang.Object[] |
getChildren(java.lang.Object parent)
Return an array representing the children of the provided parent object.
|
java.lang.String |
getClassName(java.lang.Object object)
Return the Class name of the object.
|
java.lang.String |
getID(java.lang.Object object)
Retrieve the ID of the object if the object has an ID.
|
int |
getLevel(java.lang.Object object)
Return the Z-Order level of the object (generally for a top level window).
|
java.lang.Object |
getMatchingPathObject(java.lang.Object theObject,
java.lang.String thePath)
Mechanism to retrieve a subitem/object identified
by the provided Path.
|
java.lang.String |
getName(java.lang.Object object)
Retrieve the name of the object if the object is named.
|
java.lang.String |
getProperty(java.lang.Object object,
java.lang.String property)
Retrieve the property value of the object if the object has the property.
|
java.lang.String[] |
getPropertyNames(java.lang.Object object)
Retrieve the list of available properties for the object.
|
java.lang.String[][] |
getStringData(java.lang.Object object,
java.lang.Object dataInfo)
Return whatever data is extractable (normally visible) from the object.
|
java.lang.String[] |
getSuperClassNames(java.lang.Object object)
Return the array of all superclass names for the object.
|
java.lang.String |
getText(java.lang.Object object)
Retrieve the displayed text value of the object if the object has a text value.
|
int |
getTopLevelCount()
Return the number of currently active Top Level Windows.
|
java.lang.Object[] |
getTopLevelWindows()
Return an array representing the TopLevel windows in the Agent JVM.
|
boolean |
isMatchingPath(java.lang.Object theObject,
java.lang.String thePath)
Mechanism to determine if the object contains a subitem/object identified
by the provided Path.
|
boolean |
isShowing(java.lang.Object object)
Return true if the specified object is showing/visible.
|
boolean |
isValid(java.lang.Object object)
Return true if the object is still valid/finadable in the JVM.
|
void |
ping()
A simple RUThere call.
|
TestRecordData |
process(java.lang.Object object,
TestRecordData testRecordData)
Process the action provided in the testRecordData.
|
java.lang.Object |
runCommand(java.lang.Object command)
This is a "do anything" function that the Server and Clients have a private contract
to implement.
|
void |
setActiveWindow(java.lang.Object theObject)
Attempts to set theObject as the active (topmost?) Window or Component in the JVM.
|
void |
shutdown()
The RMI Server will instruct the Agent to shutdown when the Server itself is being
shutdown or finalized.
|
static final java.lang.String SERVER_HOSTNAME_SYSTEM_PROPERTY
void ping() throws java.rmi.RemoteException
java.rmi.RemoteException
java.rmi.server.ObjID getAgentID() throws java.rmi.RemoteException
java.rmi.RemoteException
java.lang.String getAgentName() throws java.rmi.RemoteException
java.rmi.RemoteException
TestRecordData process(java.lang.Object object, TestRecordData testRecordData) throws java.rmi.RemoteException, java.lang.Exception
The Agent is not intended to be logging to STAF. Each Agent is intended to be strictly an RMI client that will attempt actions and return success or failure information to the controlling SAFS Engine RMI Server.
testRecordData
- provides all the information needed by the Agent to perform an action.
The RMI version of TestRecordData is likely going to be much sparser than the
typical TestRecordHelper. It will also be pretty specific to the concrete
implementations for the Server and Agent.java.rmi.RemoteException
java.lang.Exception
void shutdown() throws java.rmi.RemoteException
The Agent should accept the shutdown request and initiate a new shutdown Thread so that the call to shutdown from the Server can immediately return.
The Agent will normally reset itself to an idle state where it is polling once again for the existence of another RMI Server object in the RMI Registry.
java.rmi.RemoteException
int getTopLevelCount() throws java.rmi.RemoteException, java.lang.Exception
java.rmi.RemoteException
java.lang.Exception
java.lang.Object[] getTopLevelWindows() throws java.rmi.RemoteException, java.lang.Exception
java.rmi.RemoteException
java.lang.Exception
int getChildCount(java.lang.Object parent) throws java.rmi.RemoteException, java.lang.Exception
java.rmi.RemoteException
java.lang.Exception
java.lang.Object[] getChildren(java.lang.Object parent) throws java.rmi.RemoteException, java.lang.Exception
parent
- An object from getTopLevelWindows or from a previous call to getChildren.
The parent is often one of the elements of the TopLevelWindow array or somewhere
lower in that same hierarchy.java.rmi.RemoteException
java.lang.Exception
java.lang.String getCaption(java.lang.Object object) throws java.rmi.RemoteException, java.lang.NoSuchFieldException, java.lang.Exception
object
- An object from getTopLevelWindows or from a previous call to getChildren.java.lang.NoSuchFieldException
- if the object does not provide a caption.java.rmi.RemoteException
java.lang.Exception
java.lang.String getName(java.lang.Object object) throws java.rmi.RemoteException, java.lang.NoSuchFieldException, java.lang.Exception
object
- An object from getTopLevelWindows or from a previous call to getChildren.java.lang.NoSuchFieldException
- if the object does not provide a name.java.rmi.RemoteException
java.lang.Exception
java.lang.String getID(java.lang.Object object) throws java.rmi.RemoteException, java.lang.NoSuchFieldException, java.lang.Exception
object
- An object from getTopLevelWindows or from a previous call to getChildren.java.lang.NoSuchFieldException
- if the object does not provide an ID.java.rmi.RemoteException
java.lang.Exception
java.lang.String getText(java.lang.Object object) throws java.rmi.RemoteException, java.lang.Exception
object
- An object from getTopLevelWindows or from a previous call to getChildren.java.rmi.RemoteException
java.lang.Exception
java.lang.String[] getPropertyNames(java.lang.Object object) throws java.rmi.RemoteException, java.lang.Exception
object
- An object from getTopLevelWindows or from a previous call to getChildren.java.rmi.RemoteException
java.lang.Exception
java.lang.String getProperty(java.lang.Object object, java.lang.String property) throws java.rmi.RemoteException, java.lang.NoSuchFieldException, java.lang.Exception
object
- -- An object from getTopLevelWindows or from a previous call to getChildren.property
- -- the case-sensitive name of the property to seek.java.rmi.RemoteException
java.lang.NoSuchFieldException
java.lang.Exception
java.lang.String getClassName(java.lang.Object object) throws java.rmi.RemoteException, java.lang.Exception
object
- An object from getTopLevelWindows or from a previous call to getChildren.java.rmi.RemoteException
java.lang.Exception
int getLevel(java.lang.Object object) throws java.rmi.RemoteException, java.lang.NoSuchFieldException, java.lang.Exception
object
- An object from getTopLevelWindows or from a previous call to getChildren.java.rmi.RemoteException
java.lang.NoSuchFieldException
java.lang.Exception
java.lang.String[] getSuperClassNames(java.lang.Object object) throws java.rmi.RemoteException, java.lang.Exception
object
- An object from getTopLevelWindows or from a previous call to getChildren.java.rmi.RemoteException
java.lang.Exception
java.lang.String[][] getStringData(java.lang.Object object, java.lang.Object dataInfo) throws java.rmi.RemoteException, java.lang.NoSuchMethodException, java.lang.Exception
object
- An object from getTopLevelWindows or from a previous call to getChildren.dataInfo
- Allows us to specify what type of data we want returned. This will be
specific to the types of objects from which we extract data. For example, Tables might
provide "Contents" or "Headers" or other different types of data.java.lang.NoSuchMethodException
- if the object type does not support the extraction of data
or the specific type of data requested.java.rmi.RemoteException
java.lang.Exception
boolean isShowing(java.lang.Object object) throws java.rmi.RemoteException, java.lang.Exception
object
- An object from getTopLevelWindows or from a previous call to getChildren.java.rmi.RemoteException
java.lang.Exception
boolean isValid(java.lang.Object object) throws java.rmi.RemoteException, java.lang.Exception
object
- An object from getTopLevelWindows or from a previous call to getChildren.java.rmi.RemoteException
java.lang.Exception
java.lang.Object getMatchingPathObject(java.lang.Object theObject, java.lang.String thePath) throws java.rmi.RemoteException, java.lang.Exception
Ex:
File->Exit
Root->Branch->Leaf
theObject--Object
- proxy for the object to be evaluated.thePath
- information to locate another object or subitem relative to theObject.
this is usually something like a menuitem or tree node where supported.java.rmi.RemoteException
java.lang.Exception
boolean isMatchingPath(java.lang.Object theObject, java.lang.String thePath) throws java.rmi.RemoteException, java.lang.Exception
Ex:
File->Exit
Root->Branch->Leaf
theObject--Object
- proxy for the object to be evaluated.thePath
- information to locate another object or subitem relative to theObject.
this is usually something like a menuitem or tree node where supported.java.rmi.RemoteException
java.lang.Exception
java.lang.Object runCommand(java.lang.Object command) throws java.rmi.RemoteException, java.lang.Exception
For example, the Client and Server may have been coded to pass string commands back and forth and the string commands can be parsed to provide an unlimited number of command possibilities.
command
- Object of a type expected by the Client implementation for this method.java.rmi.RemoteException
java.lang.Exception
void setActiveWindow(java.lang.Object theObject) throws java.rmi.RemoteException, java.lang.Exception
theObject
- Object of a type expected by the Client implementation for this method.java.rmi.RemoteException
java.lang.Exception
Copyright © SAS Institute. All Rights Reserved.