主要两部分
1.序列号
2.Transaction对象的存储
主要关注接口部分即可
public interface TransactionRepository {
int create(Transaction transaction);
int update(Transaction transaction);
int delete(Transaction transaction);
Transaction findByXid(TransactionXid xid);
List<Transaction> findAllUnmodifiedSince(Date date);
}
public interface ObjectSerializer<T> {
/**
* Serialize the given object to binary data.
*
* @param t object to serialize
* @return the equivalent binary data
*/
byte[] serialize(T t);
/**
* Deserialize an object from the given binary data.
*
* @param bytes object binary representation
* @return the equivalent object instance
*/
T deserialize(byte[] bytes);
T clone(T object);
}
网友评论