- if (message instanceof CanCommitTransaction) {
- canCommit((CanCommitTransaction) message);
- } else if (message instanceof PreCommitTransaction) {
- preCommit((PreCommitTransaction) message);
- } else if (message instanceof CommitTransaction) {
- commit((CommitTransaction) message);
- } else if (message instanceof AbortTransaction) {
- abort((AbortTransaction) message);
+ if (message.getClass().equals(CanCommitTransaction.SERIALIZABLE_CLASS)) {
+ canCommit(new CanCommitTransaction());
+ } else if (message.getClass().equals(PreCommitTransaction.SERIALIZABLE_CLASS)) {
+ preCommit(new PreCommitTransaction());
+ } else if (message.getClass().equals(CommitTransaction.SERIALIZABLE_CLASS)) {
+ commit(new CommitTransaction());
+ } else if (message.getClass().equals(AbortTransaction.SERIALIZABLE_CLASS)) {
+ abort(new AbortTransaction());
+ } else {
+ throw new Exception ("Not recognized message received,message="+message);