public class JVMAgent extends AgentImpl
To insert this class via the AgentClassLoader the following minimum settings must appear in the safsjvmagent.properties file:
safsjvmagent.properties:
AgentImpl,
ServerImpl,
AServerImpl,
Serialized FormAgentImpl.ServerMonitor, AgentImpl.STAFMonitorRemoteRoot.ShutdownHook| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_ABBOT_AGENT
'SAFSAbbotJVMAgent': Unique Agent remoteType.
|
static java.lang.String |
ROOT_JVMAGENT_PACKAGE
"org.safs.abbot.jvmagent.agents"
The root package for embedded SAFS JVM Agents for Abbot.
|
DEFAULT_RMI_AGENT, DEFAULT_RMI_SERVER, monitor, objID, server, serverName, shutdown, stafHelper, stafmonitor, stafshutdownremoteType| Constructor and Description |
|---|
JVMAgent()
Constructor for JVMAgent.
|
| Modifier and Type | Method and Description |
|---|---|
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 local parent (Integer ID).
|
java.lang.Object[] |
getChildren(java.lang.Object parent)
Return the children available in the local parent (Integer ID).
|
java.lang.String |
getClassName(java.lang.Object object)
Return the class name of the provided object represented as an Integer hashcode
previously sent over to the Server object.
|
protected java.awt.Component |
getComponent(java.lang.Integer hashcode)
Used internally to find the Component matching the stored Integer hashcode.
|
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 object,
java.lang.String path)
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.Object |
getSubItemAtIndex(java.lang.Object object,
int index)
Default no-op simply throws SAFSSubItemsAgentUnsupportedRuntimeException("SubItemAtIndex Unsupported").
|
java.lang.String[] |
getSuperClassNames(java.lang.Object object)
Return an Array of the complete superclass hierarchy of the provided object
represented as an Integer hashcode previously sent over to the Server 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()
Returns the number of Root Windows known to the Abbot WindowTracker or
0 if there are no known Root Windows in this JVM.
|
java.lang.Object[] |
getTopLevelWindows()
Return array of Integer IDs representing keys to stored ComponentItems.
|
boolean |
isMatchingPath(java.lang.Object object,
java.lang.String path)
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.
|
TestRecordData |
process(java.lang.Object object,
TestRecordData testRecordData)
An Agent may throw various types of Agent-specific RuntimeExceptions depending upon failure modes.
|
void |
setActiveWindow(java.lang.Object object)
Make the Window/Component active.
|
debugLogSystemProperties, finalize, getAgentID, getAgentName, initialize, ping, runCommand, shutdownrebindLocalRMIRegistryclone, exportObject, exportObject, exportObject, unexportObjectpublic static final java.lang.String DEFAULT_ABBOT_AGENT
org.safs.STAFHelper#isToolAvailable(),
Constant Field Valuespublic static final java.lang.String ROOT_JVMAGENT_PACKAGE
org.safs.jvmagent.LocalAgentFactory#LocalAgentFactory(String),
Constant Field Valuespublic JVMAgent()
throws java.rmi.RemoteException
java.rmi.RemoteExceptionpublic int getTopLevelCount()
throws java.rmi.RemoteException,
java.lang.Exception
getTopLevelCount in interface AgentgetTopLevelCount in class AgentImpljava.rmi.RemoteExceptionjava.lang.ExceptionAgent.getTopLevelCount()public java.lang.Object[] getTopLevelWindows()
throws java.rmi.RemoteException,
java.lang.Exception
getTopLevelWindows in interface AgentgetTopLevelWindows in class AgentImpljava.rmi.RemoteExceptionjava.lang.ExceptionAgent.getTopLevelWindows()public int getChildCount(java.lang.Object parent)
throws java.rmi.RemoteException,
java.lang.Exception
getChildCount in interface AgentgetChildCount in class AgentImplInteger - ID of parent component.SAFSObjectNotFoundRuntimeException("Invalid - parent") if the provided parent cannot be located.SAFSActionErrorRuntimeException(x.getMessage(), - x) if an unexpected Exception is thrown from
a LocalAgentFactory derived Agent.java.rmi.RemoteExceptionjava.lang.ExceptionAgent.getChildCount(Object)public java.lang.Object[] getChildren(java.lang.Object parent)
throws java.rmi.RemoteException,
java.lang.Exception
getChildren in interface AgentgetChildren in class AgentImplInteger - ID of parent component.SAFSObjectNotFoundRuntimeException("Invalid - parent") if the provided parent cannot be located.SAFSActionErrorRuntimeException(x.getMessage(), - x) if an unexpected Exception is thrown fromjava.rmi.RemoteExceptionjava.lang.ExceptionAgent.getChildren(Object)public void setActiveWindow(java.lang.Object object)
throws java.rmi.RemoteException,
java.lang.Exception
The object should have been found to be a valid Component object via waitForObject and isValid function calls.
setActiveWindow in interface AgentsetActiveWindow in class AgentImplobject - An object from getTopLevelWindows or from a previous call to getChildren.SAFSActionErrorRuntimeException - if an unexpected (design?) problem occurs.SAFSObjectNotFoundRuntimeException("Invalid - object") if the provided object cannot be located.java.rmi.RemoteExceptionjava.lang.Exceptionprotected java.awt.Component getComponent(java.lang.Integer hashcode)
public java.lang.String getClassName(java.lang.Object object)
throws java.rmi.RemoteException,
java.lang.Exception
getClassName in interface AgentgetClassName in class AgentImplobject - An object from getTopLevelWindows or from a previous call to getChildren.SAFSActionErrorRuntimeException - if an unexpected (design?) problem occurs.SAFSObjectNotFoundRuntimeException("Invalid - object") if the provided object cannot be located.java.rmi.RemoteExceptionjava.lang.ExceptionAgent.getClassName(Object)public java.lang.String[] getSuperClassNames(java.lang.Object object)
throws java.rmi.RemoteException,
java.lang.Exception
getSuperClassNames in interface AgentgetSuperClassNames in class AgentImplobject - An object from getTopLevelWindows or from a previous call to getChildren.SAFSActionErrorRuntimeException - if an unexpected (design?) problem occurs.SAFSObjectNotFoundRuntimeException("Invalid - object") if the provided object cannot be located.java.rmi.RemoteExceptionjava.lang.ExceptionAgent.getSuperClassNames(Object)public java.lang.String[] getPropertyNames(java.lang.Object object)
throws java.rmi.RemoteException,
java.lang.Exception
getPropertyNames in interface AgentgetPropertyNames in class AgentImplobject - An object from getTopLevelWindows or from a previous call to getChildren.SAFSActionErrorRuntimeException - if an unexpected (design?) problem occurs.SAFSObjectNotFoundRuntimeException("Invalid - object") if the provided object cannot be located.java.rmi.RemoteExceptionjava.lang.ExceptionAgent.getProperty(Object, String)public java.lang.String getProperty(java.lang.Object object,
java.lang.String property)
throws java.rmi.RemoteException,
java.lang.Exception
getProperty in interface AgentgetProperty in class AgentImplobject - -- An object from getTopLevelWindows or from a previous call to getChildren.property - -- the case-sensitive name of the property to seek.SAFSObjectNotFoundRuntimeException("Invalid - object") if the provided parent cannot be located.SAFSInvalidActionArgumentRuntimeException(property)SAFSActionErrorRuntimeException(x.getMessage(), - x) if an unexpected Exception is thrown fromjava.rmi.RemoteExceptionjava.lang.ExceptionAgent.getProperty(Object, String)public java.lang.String getCaption(java.lang.Object object)
throws java.rmi.RemoteException,
java.lang.Exception
getCaption in interface AgentgetCaption in class AgentImplobject - An object from getTopLevelWindows or from a previous call to getChildren.SAFSObjectNotFoundRuntimeException("Invalid - object") if the provided parent cannot be located.SAFSActionUnsupportedRuntimeException("Caption - Unsupported") if the action is unsupported.SAFSActionErrorRuntimeException(x.getMessage(), - x) if an unexpected Exception is thrown fromjava.lang.NoSuchFieldException - if the object does not provide a caption.java.rmi.RemoteExceptionjava.lang.ExceptionAgent.getCaption(Object)public java.lang.String getName(java.lang.Object object)
throws java.rmi.RemoteException,
java.lang.Exception
getName in interface AgentgetName in class AgentImplobject - An object from getTopLevelWindows or from a previous call to getChildren.SAFSObjectNotFoundRuntimeException("Invalid - object") if the provided parent cannot be located.SAFSActionUnsupportedRuntimeException("Name - Unsupported") if the action is unsupported.SAFSActionErrorRuntimeException(x.getMessage(), - x) if an unexpected Exception is thrown fromjava.lang.NoSuchFieldException - if the object does not provide a name.java.rmi.RemoteExceptionjava.lang.ExceptionAgent.getName(Object)public java.lang.String getID(java.lang.Object object)
throws java.rmi.RemoteException,
java.lang.Exception
getID in interface AgentgetID in class AgentImplobject - An object from getTopLevelWindows or from a previous call to getChildren.SAFSObjectNotFoundRuntimeException("Invalid - object") if the provided parent cannot be located.SAFSActionUnsupportedRuntimeException("ID - Unsupported") if the action is unsupported.SAFSActionErrorRuntimeException(x.getMessage(), - x) if an unexpected Exception is thrown fromjava.lang.NoSuchFieldException - if the object does not provide an ID.java.rmi.RemoteExceptionjava.lang.ExceptionAgent.getID(Object)public java.lang.String getText(java.lang.Object object)
throws java.rmi.RemoteException,
java.lang.Exception
getText in interface AgentgetText in class AgentImplobject - An object from getTopLevelWindows or from a previous call to getChildren.SAFSObjectNotFoundRuntimeException("Invalid - object") if the provided parent cannot be located.SAFSActionUnsupportedRuntimeException("Text - Unsupported") if the action is unsupported.SAFSActionErrorRuntimeException(x.getMessage(), - x) if an unexpected Exception is thrown fromjava.rmi.RemoteExceptionjava.lang.ExceptionAgent.getText(Object)public int getLevel(java.lang.Object object)
throws java.rmi.RemoteException,
java.lang.Exception
getLevel in interface AgentgetLevel in class AgentImplobject - An object from getTopLevelWindows or from a previous call to getChildren.SAFSObjectNotFoundRuntimeException("Invalid - object") if the provided parent cannot be located.SAFSActionUnsupportedRuntimeException("Level - Unsupported") if the level cannot be determined.SAFSActionErrorRuntimeException - if an unexpected (design?) problem occurs.java.rmi.RemoteExceptionjava.lang.ExceptionAgent.getLevel(Object)public boolean isShowing(java.lang.Object object)
throws java.rmi.RemoteException,
java.lang.Exception
The object has already been found to be a valid Component object via waitForObject and possibly isValid function calls.
isShowing in interface AgentisShowing in class AgentImplobject - An object from getTopLevelWindows or from a previous call to getChildren.SAFSObjectNotFoundRuntimeException("Invalid - object") if the provided parent cannot be located.SAFSActionUnsupportedRuntimeException("Showing - Unsupported") if the action is unsupported.SAFSActionErrorRuntimeException - if an unexpected (design?) problem occurs.java.rmi.RemoteExceptionjava.lang.ExceptionAgent.isShowing(Object)public boolean isValid(java.lang.Object object)
throws java.rmi.RemoteException,
java.lang.Exception
The object has usually been found to be a valid Component object via waitForObject.
isValid in interface AgentisValid in class AgentImplobject - An object from getTopLevelWindows or from a previous call to getChildren.SAFSActionErrorRuntimeException - if an unexpected (design?) problem occurs.java.rmi.RemoteExceptionjava.lang.Exceptionpublic java.lang.String[][] getStringData(java.lang.Object object,
java.lang.Object dataInfo)
throws java.rmi.RemoteException,
java.lang.Exception
getStringData in interface AgentgetStringData in class AgentImplobject - 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.SAFSObjectNotFoundRuntimeException("Invalid - object") if the provided parent cannot be located.SAFSActionUnsupportedRuntimeException("StringData - Unsupported") if action is not supported.SAFSInvalidActionArgumentRuntimeException(dataInfo) - if specified dataInfo is not supported.SAFSActionErrorRuntimeException - if an unexpected (design?) problem occurs.java.lang.NoSuchMethodException - if the object type does not support the extraction of data
or the specific type of data requested.java.rmi.RemoteExceptionjava.lang.ExceptionAgent.getStringData(Object, Object)public TestRecordData process(java.lang.Object object, TestRecordData testRecordData) throws java.rmi.RemoteException, java.lang.Exception
process in interface Agentprocess in class AgentImpltestRecordData - 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.SAFSObjectNotFoundRuntimeException("Invalid - object") if the provided parent cannot be located.SAFSInvalidActionArgumentRuntimeException("Invalid - testRecordData") if the provided testRecordData is null.SAFSRuntimeException - subclasses from the various Agents.SAFSActionErrorRuntimeException - if an unexpected (design?) problem occurs.java.rmi.RemoteExceptionjava.lang.ExceptionAgent.process(Object,TestRecordData)public java.lang.Object getSubItemAtIndex(java.lang.Object object,
int index)
throws java.rmi.RemoteException,
java.lang.Exception
AgentImplgetSubItemAtIndex in interface SubItemsAgentgetSubItemAtIndex in class AgentImplobject - reference (Integer) from which to locate the subitem.index - of the subitem to retrieve.SAFSObjectNotFoundRuntimeException("Invalid - object") if the provided parent cannot be located.SAFSSubItemsAgentUnsupportedRuntimeException - as necessay.java.lang.IndexOutOfBoundsException - if index is invalidSAFSObjectNotFoundException("Invalid - SubItem") if subitem at index cannot be retrieved.SAFSActionErrorRuntimeException - if an unexpected (design?) problem occurs.java.rmi.RemoteExceptionjava.lang.ExceptionSubItemsAgent.getSubItemAtIndex(Object,int)public java.lang.Object getMatchingPathObject(java.lang.Object object,
java.lang.String path)
throws java.rmi.RemoteException,
java.lang.Exception
Ex:
File->Exit
Root->Branch->Leaf
getMatchingPathObject in interface AgentgetMatchingPathObject in interface SubItemsAgentgetMatchingPathObject in class AgentImpltheObject--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.SAFSObjectNotFoundRuntimeException("Invalid - object") if the provided parent cannot be located.SAFSSubItemsAgentUnsupportedRuntimeException - as necessay.SAFSObjectNotFoundException("Invalid - SubItem") if subitem at index cannot be retrieved.SAFSActionErrorRuntimeException - if an unexpected (design?) problem occurs.java.rmi.RemoteExceptionjava.lang.ExceptionAgent.getMatchingPathObject(Object, String)public boolean isMatchingPath(java.lang.Object object,
java.lang.String path)
throws java.rmi.RemoteException,
java.lang.Exception
Ex:
File->Exit
Root->Branch->Leaf
isMatchingPath in interface AgentisMatchingPath in interface SubItemsAgentisMatchingPath in class AgentImplobject--Object - proxy for the object to be evaluated.path - information to locate another object or subitem relative to theObject.
this is usually something like a menuitem or tree node where supported.SAFSObjectNotFoundRuntimeException("Invalid - object") if the provided parent cannot be located.SAFSSubItemsAgentUnsupportedRuntimeException - as necessay.SAFSActionErrorRuntimeException - if an unexpected (design?) problem occurs.java.rmi.RemoteExceptionjava.lang.Exceptionorg.safs.rmi.engine.Agent#getMatchingPath(Object, String)