Files
Brainstorm/Foundation/src/com/foundation/controller/ReflectionTransactionError.java
2014-05-30 10:31:51 -07:00

53 lines
1.9 KiB
Java

package com.foundation.controller;
import java.io.IOException;
import com.common.io.IObjectInputStream;
import com.common.io.IObjectOutputStream;
import com.foundation.transaction.Transaction;
/**
* A reflection operation result indicating a problem in the transactional system (not including detected constraint errors).
*/
public class ReflectionTransactionError extends ReflectionResult {
/** The transaction error code identifier (Transaction.ERROR_xxx). */
private int transactionErrorCode = Transaction.ERROR_NONE;
/**
* ReflectionTransactionError constructor.
*/
public ReflectionTransactionError() {
}//ReflectionTransactionError()//
/**
* ReflectionTransactionError constructor.
* @param transactionErrorCode The transaction error code identifier (Transaction.ERROR_xxx).
*/
public ReflectionTransactionError(int transactionErrorCode) {
this.transactionErrorCode = transactionErrorCode;
}//ReflectionTransactionError()//
/**
* Gets the transaction system error code detailing the problem.
* @return The transaction error code identifier (Transaction.ERROR_xxx).
*/
public int getTransactionErrorCode() {
return transactionErrorCode;
}//getTransactionErrorCode()//
/* (non-Javadoc)
* @see com.foundation.controller.ReflectionResult#getResultType()
*/
public int getResultType() {
return RESULT_TYPE_TRANSACTIONAL_ERROR;
}//getResultType()//
/* (non-Javadoc)
* @see com.common.io.IExternalizable#readExternal(com.common.io.IObjectInputStream)
*/
public Object readExternal(IObjectInputStream in) throws IOException, ClassNotFoundException {
transactionErrorCode = in.readInt();
return null;
}//readExternal()//
/* (non-Javadoc)
* @see com.common.io.IExternalizable#writeExternal(com.common.io.IObjectOutputStream)
*/
public void writeExternal(IObjectOutputStream out) throws IOException {
out.writeInt(transactionErrorCode);
}//writeExternal()//
}//ReflectionTransactionError//