com.ibm.retail.AEF.thread
Class ObjectDetectorLock

java.lang.Object
  |
  +--com.ibm.retail.AEF.thread.ConditionLock
        |
        +--com.ibm.retail.AEF.thread.ObjectDetectorLock
All Implemented Interfaces:
com.ibm.retail.AEF.automation.ObjectDetectorListener

public class ObjectDetectorLock
extends ConditionLock
implements com.ibm.retail.AEF.automation.ObjectDetectorListener

An synchronization mechanism for use with ObjectDetectors.


Field Summary
protected  com.ibm.retail.AEF.automation.ObjectDetector detector
           
protected  com.ibm.retail.AEF.util.AEFMessage msg
           
protected  boolean objectDetected
           
protected  com.ibm.retail.AEF.session.AEFSession session
           
protected  com.ibm.retail.si.util.AEFException unblockException
           
 
Fields inherited from class com.ibm.retail.AEF.thread.ConditionLock
action, lock, name, returnIndex, timeout, unblockRuntimeException
 
Constructor Summary
ObjectDetectorLock()
          Constructs a ObjectDetectorLock.
 
Method Summary
(package private) static java.lang.String copyright()
           
 void exceptionDetected(com.ibm.retail.si.util.AEFException e)
          Called by the ObjectDetector when it throws an AEFException.
 void objectDetected()
          Called by the ObjectDetector when an object has been created.
 java.lang.Object waitForNewObject(java.lang.String name, com.ibm.retail.AEF.automation.ObjectDetector detector, int oldInstanceNumber, int timeout)
          Blocks the calling thread on the condition variable or a timeout
 java.lang.Object waitForNewObject(java.lang.String name, com.ibm.retail.AEF.automation.ObjectDetector detector, int oldInstanceNumber, int timeout, boolean ignoreTimeout)
          Blocks the calling thread on the condition variable or a timeout
 java.lang.Object waitForNewObjectOrError(java.lang.String name, com.ibm.retail.AEF.automation.ObjectDetector detector, int oldInstanceNumber, com.ibm.retail.AEF.automation.Condition[] errorConditions, boolean immediateEval, int timeout)
          Blocks the calling thread on the condition variable or a timeout
 java.lang.Object waitForNewObjectOrError(java.lang.String name, com.ibm.retail.AEF.automation.ObjectDetector detector, int oldInstanceNumber, com.ibm.retail.AEF.automation.Condition[] errorConditions, boolean immediateEval, int timeout, boolean ignoreTimeout)
          Blocks the calling thread on the condition variable or a timeout
 
Methods inherited from class com.ibm.retail.AEF.thread.ConditionLock
getLock, getLockOwner, notify, notify, notify, performActionAndWait, performActionAndWait, performActionAndWait, performActionAndWait, wait, wait, wait, wait, wait, wait, wait, wait
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

objectDetected

protected boolean objectDetected

detector

protected com.ibm.retail.AEF.automation.ObjectDetector detector

unblockException

protected com.ibm.retail.si.util.AEFException unblockException

msg

protected com.ibm.retail.AEF.util.AEFMessage msg

session

protected com.ibm.retail.AEF.session.AEFSession session
Constructor Detail

ObjectDetectorLock

public ObjectDetectorLock()
Constructs a ObjectDetectorLock.

Method Detail

copyright

static java.lang.String copyright()

waitForNewObject

public java.lang.Object waitForNewObject(java.lang.String name,
                                         com.ibm.retail.AEF.automation.ObjectDetector detector,
                                         int oldInstanceNumber,
                                         int timeout)
                                  throws AEFException
Blocks the calling thread on the condition variable or a timeout

Parameters:
name - A debug aid. Give a unique name to the detector lock such as "wait-for-operator".
detector - If this detector senses an object, the calling thread will be unblocked.
oldInstanceNumber - Each object detected by the detector has an instance number. The caller should pass in the prior instance number from the detector so that if the new object has been detected prior to entry into this routine, it can be returned without waiting.
timeout - The number of milliseconds to wait for the object.
Throws:
AEFException - Because of the nature of this method, just about any error code could be returned.
Among the possible AEFException error codes are:
Common Errors

waitForNewObject

public java.lang.Object waitForNewObject(java.lang.String name,
                                         com.ibm.retail.AEF.automation.ObjectDetector detector,
                                         int oldInstanceNumber,
                                         int timeout,
                                         boolean ignoreTimeout)
                                  throws AEFException
Blocks the calling thread on the condition variable or a timeout

Parameters:
name - A debug aid. Give a unique name to the detector lock such as "wait-for-operator".
detector - If this detector senses an object, the calling thread will be unblocked.
oldInstanceNumber - Each object detected by the detector has an instance number. The caller should pass in the prior instance number from the detector so that if the new object has been detected prior to entry into this routine, it can be returned without waiting.
timeout - The number of milliseconds to wait for the object.
ignoreTimeout - If true, do not log error message if timeout situation occurs. In some conditions (e.g., in the ACEApplyDelayedCoupons.wait ForCoupons() method), the timeout is a nominal value since there may or may not be any object created
Throws:
AEFException - Because of the nature of this method, just about any error code could be returned.
Among the possible AEFException error codes are:
Common Errors

waitForNewObjectOrError

public java.lang.Object waitForNewObjectOrError(java.lang.String name,
                                                com.ibm.retail.AEF.automation.ObjectDetector detector,
                                                int oldInstanceNumber,
                                                com.ibm.retail.AEF.automation.Condition[] errorConditions,
                                                boolean immediateEval,
                                                int timeout)
                                         throws AEFException
Blocks the calling thread on the condition variable or a timeout

Parameters:
name - A debug aid. Give a unique name to the detector lock such as "wait-for-operator".
detector - If this detector senses an object, the calling thread will be unblocked.
oldInstanceNumber - Each object detected by the detector has an instance number. The caller should pass in the prior instance number from the detector so that if the new object has been detected prior to entry into this routine, it can be returned without waiting.
errorConditions - An array of conditions which will cause the calling thread to unblock if one of the conditions evaluates to true. These conditions are considered "error" conditions.
immediateEval - If true, the conditions are evaluated immediately without first waiting for a property change.
timeout - The number of milliseconds to wait for the object.
Returns:
Object If the object is an Integer, it is the index of the condition that ocurred. Otherwise, the object is the object which was detected.
Throws:
AEFException - Because of the nature of this method, just about any error code could be returned.
Among the possible AEFException error codes are:
Common Errors

waitForNewObjectOrError

public java.lang.Object waitForNewObjectOrError(java.lang.String name,
                                                com.ibm.retail.AEF.automation.ObjectDetector detector,
                                                int oldInstanceNumber,
                                                com.ibm.retail.AEF.automation.Condition[] errorConditions,
                                                boolean immediateEval,
                                                int timeout,
                                                boolean ignoreTimeout)
                                         throws AEFException
Blocks the calling thread on the condition variable or a timeout

Parameters:
name - A debug aid. Give a unique name to the detector lock such as "wait-for-operator".
detector - If this detector senses an object, the calling thread will be unblocked.
oldInstanceNumber - Each object detected by the detector has an instance number. The caller should pass in the prior instance number from the detector so that if the new object has been detected prior to entry into this routine, it can be returned without waiting.
errorConditions - An array of conditions which will cause the calling thread to unblock if one of the conditions evaluates to true. These conditions are considered "error" conditions.
immediateEval - If true, the conditions are evaluated immediately without first waiting for a property change.
timeout - The number of milliseconds to wait for the object.
ignoreTimeout - If true, do not log error message if timeout situation occurs. In some conditions (e.g., in the ACEApplyDelayedCoupons.wait ForCoupons() method), the timeout is a nominal value since there may or may not be any object created
Returns:
Object If the object is an Integer, it is the index of the condition that ocurred. Otherwise, the object is the object which was detected.
Throws:
AEFException - Because of the nature of this method, just about any error code could be returned.
Among the possible AEFException error codes are:
Common Errors

objectDetected

public void objectDetected()
Called by the ObjectDetector when an object has been created.

Specified by:
objectDetected in interface com.ibm.retail.AEF.automation.ObjectDetectorListener

exceptionDetected

public void exceptionDetected(com.ibm.retail.si.util.AEFException e)
Called by the ObjectDetector when it throws an AEFException.

Specified by:
exceptionDetected in interface com.ibm.retail.AEF.automation.ObjectDetectorListener
Parameters:
e - The AEFException that was detected.


Copyright © 2004 IBM. All Rights Reserved.
Generated: July 19 2004