org.arm4.arm40.transaction

Class ArmInterface

public class ArmInterface extends Object implements ArmInterface

ArmInterface implementation provides a common way to handle errors. If a method invocation on any ARM object causes an error, the error code returned by the objects getErrorCode() will be negative. If no error occurs, the error code is zero. Several methods also return the error code as an int return value. If an error occurs in a factory method (e.g., a method in ArmTransactionFactory), the error code is set in both the factory object and the newly created object. The error code may change any time a method of the object is executed. Executing a method overrides the previous error code value. The only methods that will never change the error code are getErrorCode() and getErrorMessage(). If multiple threads are processing the same object simultaneously, the results are unpredictable. For any non-zero error code returned by an object, the application can request from the same object a string message describing the error using getErrorMessage(). If the object does not support the function or does not recognize the error code, it returns null.

Version: $Revision$ $Date$

Author: dcarter

Field Summary
protected intm_errorCode
protected ArmFactorym_factory
Method Summary
intgetErrorCode()
StringgetErrorMessage(int errorCode)
ArmFactorygetFactory()
Return the Arm Factory that created this ARM Object.
intsetErrorCode(int errorCode)
voidsetFactory(ArmFactory factory)
Set the Arm Factory that created this ARM Object.

Field Detail

m_errorCode

protected int m_errorCode

m_factory

protected ArmFactory m_factory

Method Detail

getErrorCode

public int getErrorCode()

getErrorMessage

public String getErrorMessage(int errorCode)

getFactory

public ArmFactory getFactory()
Return the Arm Factory that created this ARM Object.

Returns: the the Arm Factory that created this ARM Object. If NULL is returned, then this object is a factory itself.

setErrorCode

public int setErrorCode(int errorCode)

setFactory

public void setFactory(ArmFactory factory)
Set the Arm Factory that created this ARM Object.

Parameters: factory the Arm Factory that created this ARM Object.