com.ibm.retail.AEF.util
Interface ErrorHelper


public interface ErrorHelper

ErrorHelper is an interface which defines the methods needed for the AEF Error Handler to handle application errors.


Field Summary
static int ERROR_HANDLED
           
static int ERROR_IS_FATAL
           
 
Method Summary
 java.lang.String getCurrentState()
          Gets the current state.
 com.ibm.retail.si.util.AEFError getError()
          Gets the error that we are working on.
 com.ibm.retail.AEF.util.AEFErrorHandler getErrorHandler()
          Gets the Error Handler that created this Error Helper.
 com.ibm.retail.si.util.AEFException getOuterException()
          Returns the outer most Exception (if any) that was thrown while handling this error.
 int getSleepInterval()
          Returns the number of milliseconds to wait before continuing with the next operation while handling errors.
 int handleError(com.ibm.retail.AEF.thread.ConditionLock lock, com.ibm.retail.AEF.action.AEFAction keySequenceAction, com.ibm.retail.AEF.automation.Condition[] goodConditions, com.ibm.retail.AEF.automation.Condition[] badConditions, int timeout, int satisfiedCondition)
          Tries to resolve the error condition if possible.
 boolean isEmulatedDevice(com.ibm.retail.AEF.io.DeviceRegistry deviceRegistry, java.lang.String logicalName)
          IsEmulatedDevice Used to determine if a device is real or emulated.
 boolean isEmulatedDevice(java.lang.String logicalName)
          IsEmulatedDevice Used to determine if a device is real or emulated.
 void resetInputDevices()
          Reset the input devices
 void setError(com.ibm.retail.si.util.AEFError theError)
          Sets the error that we are working on.
 void setErrorHandler(com.ibm.retail.AEF.util.AEFErrorHandler theErrorHandler)
          Sets the Error Handler that created this Error Helper.
 void setInputDevicesLocked(boolean flag)
          Lock the input devices
 void setOuterException(com.ibm.retail.si.util.AEFException theException)
          Sets the outer most Exception that was thrown while handling this error.
 void sleep()
          Causes the Error Helper to wait before continuing with the next operation.
 void sleep(int userInterval)
          Causes the Error Helper to wait before continuing with the next operation.
 

Field Detail

ERROR_HANDLED

public static final int ERROR_HANDLED
See Also:
Constant Field Values

ERROR_IS_FATAL

public static final int ERROR_IS_FATAL
See Also:
Constant Field Values
Method Detail

getError

public com.ibm.retail.si.util.AEFError getError()
Gets the error that we are working on.

Returns:
theError The AEFError object that contains the information about the error we are trying to handle.

setError

public void setError(com.ibm.retail.si.util.AEFError theError)
Sets the error that we are working on.

Parameters:
theError - The AEFError object that contains the information about the error we are trying to handle.

handleError

public int handleError(com.ibm.retail.AEF.thread.ConditionLock lock,
                       com.ibm.retail.AEF.action.AEFAction keySequenceAction,
                       com.ibm.retail.AEF.automation.Condition[] goodConditions,
                       com.ibm.retail.AEF.automation.Condition[] badConditions,
                       int timeout,
                       int satisfiedCondition)
Tries to resolve the error condition if possible.

Parameters:
lock - The ConditionLock that returned the error.
keySequenceAction - The key sequence that generated the error.
goodConditions - An array of the conditions that would indicate success after the key sequence is sent.
badConditions - An array of the conditions that would indicate a failure after the key sequence is sent.
timeout - An integer used to determine how long to wait for one of the listed conditions before a timeout exception is thrown.
satisfiedCondition - The index of the condition in the badConditions array that was satisfied on the last wait(needs to be adjusted as it is a negative number).
Returns:
int Returns ErrorHelper.ERROR_HANDLED if the error was cleared or dealt with. Returns ErrorHelper.ERROR_IS_FATAL if the error was not cleared or dealt with.

getOuterException

public com.ibm.retail.si.util.AEFException getOuterException()
Returns the outer most Exception (if any) that was thrown while handling this error.

Returns:
AEFException The outer most Exception that was thrown while handling this error or null.

setOuterException

public void setOuterException(com.ibm.retail.si.util.AEFException theException)
Sets the outer most Exception that was thrown while handling this error.


getSleepInterval

public int getSleepInterval()
Returns the number of milliseconds to wait before continuing with the next operation while handling errors. During testing, we found that differences in hardware, and software configuration could lead to timing issues. In many cases, invalid key sequence errors were erroneously generated. In order to compensate for this, JAVA sleep calls were added to the AEFErrorHandler and ErrorHelper classes. The Sleep Interval is configured in config.properties.

Returns:
int The Sleep Interval in milliseconds.

sleep

public void sleep()
Causes the Error Helper to wait before continuing with the next operation. During testing, we found that differences in hardware, and software configuration could lead to timing issues. In many cases, invalid key sequence errors were erroneously generated. In order to compensate for this, sleep calls (using this method) were added to the AEFErrorHandler and ErrorHelper classes. The default Sleep Interval is configured in config.properties.


sleep

public void sleep(int userInterval)
Causes the Error Helper to wait before continuing with the next operation. During testing, we found that differences in hardware, and software configuration could lead to timing issues. In many cases, invalid key sequence errors were erroneously generated. In order to compensate for this, sleep calls (using this method) were added to the AEFErrorHandler and ErrorHelper classes. The default Sleep Interval is configured in config.properties.

Parameters:
userInterval - A user specified interval to be used instead of the default sleep value.

isEmulatedDevice

public boolean isEmulatedDevice(java.lang.String logicalName)
                         throws AEFException
IsEmulatedDevice Used to determine if a device is real or emulated.

Parameters:
logicalName - The JPOS logical name for the device.
Returns:
boolean True if the device is emulated otherwise False.
Throws:
AEFException - Among the possible AEFException error codes are:
Common Errors

isEmulatedDevice

public boolean isEmulatedDevice(com.ibm.retail.AEF.io.DeviceRegistry deviceRegistry,
                                java.lang.String logicalName)
                         throws jpos.JposException
IsEmulatedDevice Used to determine if a device is real or emulated.

Parameters:
deviceRegistry - The device registry for this session.
logicalName - The JPOS logical name for the device.
Returns:
boolean True if the device is emulated otherwise False.
Throws:
JposException

getCurrentState

public java.lang.String getCurrentState()
Gets the current state.

Returns:
String The current application state.

setInputDevicesLocked

public void setInputDevicesLocked(boolean flag)
                           throws AEFException
Lock the input devices

Parameters:
flag - A boolean that indicates if the are locking or unlocking the input devices.
Throws:
AEFException - Among the possible AEFException error codes are:
Common Errors

resetInputDevices

public void resetInputDevices()
                       throws AEFException
Reset the input devices

Throws:
AEFException - Among the possible AEFException error codes are:
Common Errors

getErrorHandler

public com.ibm.retail.AEF.util.AEFErrorHandler getErrorHandler()
Gets the Error Handler that created this Error Helper.

Returns:
AEFErrorHandler The Error Handler that created this Error Helper.

setErrorHandler

public void setErrorHandler(com.ibm.retail.AEF.util.AEFErrorHandler theErrorHandler)
Sets the Error Handler that created this Error Helper.

Parameters:
theErrorHandler - The Error Handler that created this Error Helper.


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