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.STAFMonitor
RemoteRoot.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, stafshutdown
remoteType
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, shutdown
rebindLocalRMIRegistry
clone, exportObject, exportObject, exportObject, unexportObject
public 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.RemoteException
public int getTopLevelCount() throws java.rmi.RemoteException, java.lang.Exception
getTopLevelCount
in interface Agent
getTopLevelCount
in class AgentImpl
java.rmi.RemoteException
java.lang.Exception
Agent.getTopLevelCount()
public java.lang.Object[] getTopLevelWindows() throws java.rmi.RemoteException, java.lang.Exception
getTopLevelWindows
in interface Agent
getTopLevelWindows
in class AgentImpl
java.rmi.RemoteException
java.lang.Exception
Agent.getTopLevelWindows()
public int getChildCount(java.lang.Object parent) throws java.rmi.RemoteException, java.lang.Exception
getChildCount
in interface Agent
getChildCount
in class AgentImpl
Integer
- 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.RemoteException
java.lang.Exception
Agent.getChildCount(Object)
public java.lang.Object[] getChildren(java.lang.Object parent) throws java.rmi.RemoteException, java.lang.Exception
getChildren
in interface Agent
getChildren
in class AgentImpl
Integer
- 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.RemoteException
java.lang.Exception
Agent.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 Agent
setActiveWindow
in class AgentImpl
object
- 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.RemoteException
java.lang.Exception
protected 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 Agent
getClassName
in class AgentImpl
object
- 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.RemoteException
java.lang.Exception
Agent.getClassName(Object)
public java.lang.String[] getSuperClassNames(java.lang.Object object) throws java.rmi.RemoteException, java.lang.Exception
getSuperClassNames
in interface Agent
getSuperClassNames
in class AgentImpl
object
- 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.RemoteException
java.lang.Exception
Agent.getSuperClassNames(Object)
public java.lang.String[] getPropertyNames(java.lang.Object object) throws java.rmi.RemoteException, java.lang.Exception
getPropertyNames
in interface Agent
getPropertyNames
in class AgentImpl
object
- 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.RemoteException
java.lang.Exception
Agent.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 Agent
getProperty
in class AgentImpl
object
- -- 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.RemoteException
java.lang.Exception
Agent.getProperty(Object, String)
public java.lang.String getCaption(java.lang.Object object) throws java.rmi.RemoteException, java.lang.Exception
getCaption
in interface Agent
getCaption
in class AgentImpl
object
- 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.RemoteException
java.lang.Exception
Agent.getCaption(Object)
public java.lang.String getName(java.lang.Object object) throws java.rmi.RemoteException, java.lang.Exception
getName
in interface Agent
getName
in class AgentImpl
object
- 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.RemoteException
java.lang.Exception
Agent.getName(Object)
public java.lang.String getID(java.lang.Object object) throws java.rmi.RemoteException, java.lang.Exception
getID
in interface Agent
getID
in class AgentImpl
object
- 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.RemoteException
java.lang.Exception
Agent.getID(Object)
public java.lang.String getText(java.lang.Object object) throws java.rmi.RemoteException, java.lang.Exception
getText
in interface Agent
getText
in class AgentImpl
object
- 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.RemoteException
java.lang.Exception
Agent.getText(Object)
public int getLevel(java.lang.Object object) throws java.rmi.RemoteException, java.lang.Exception
getLevel
in interface Agent
getLevel
in class AgentImpl
object
- 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.RemoteException
java.lang.Exception
Agent.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 Agent
isShowing
in class AgentImpl
object
- 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.RemoteException
java.lang.Exception
Agent.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 Agent
isValid
in class AgentImpl
object
- An object from getTopLevelWindows or from a previous call to getChildren.SAFSActionErrorRuntimeException
- if an unexpected (design?) problem occurs.java.rmi.RemoteException
java.lang.Exception
public java.lang.String[][] getStringData(java.lang.Object object, java.lang.Object dataInfo) throws java.rmi.RemoteException, java.lang.Exception
getStringData
in interface Agent
getStringData
in class AgentImpl
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.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.RemoteException
java.lang.Exception
Agent.getStringData(Object, Object)
public TestRecordData process(java.lang.Object object, TestRecordData testRecordData) throws java.rmi.RemoteException, java.lang.Exception
process
in interface Agent
process
in class AgentImpl
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.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.RemoteException
java.lang.Exception
Agent.process(Object,TestRecordData)
public java.lang.Object getSubItemAtIndex(java.lang.Object object, int index) throws java.rmi.RemoteException, java.lang.Exception
AgentImpl
getSubItemAtIndex
in interface SubItemsAgent
getSubItemAtIndex
in class AgentImpl
object
- 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.RemoteException
java.lang.Exception
SubItemsAgent.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 Agent
getMatchingPathObject
in interface SubItemsAgent
getMatchingPathObject
in class AgentImpl
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.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.RemoteException
java.lang.Exception
Agent.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 Agent
isMatchingPath
in interface SubItemsAgent
isMatchingPath
in class AgentImpl
object--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.RemoteException
java.lang.Exception
org.safs.rmi.engine.Agent#getMatchingPath(Object, String)