- public void handleReceive(Object message) throws Exception {
- if (ReadData.SERIALIZABLE_CLASS.equals(message.getClass())) {
- readData(ReadData.fromSerializable(message));
- } else if (WriteData.SERIALIZABLE_CLASS.equals(message.getClass())) {
- writeData(WriteData.fromSerializable(message, schemaContext));
- } else if (MergeData.SERIALIZABLE_CLASS.equals(message.getClass())) {
- mergeData(MergeData.fromSerializable(message, schemaContext));
- } else if (DeleteData.SERIALIZABLE_CLASS.equals(message.getClass())) {
- deleteData(DeleteData.fromSerizalizable(message));
- } else if (message instanceof ReadyTransaction) {
- readyTransaction((ReadyTransaction) message);
- } else if (message instanceof CloseTransaction) {
- closeTransaction((CloseTransaction) message);
- } else if (message instanceof GetCompositedModification) {
- // This is here for testing only
- getSender().tell(new GetCompositeModificationReply(
- new ImmutableCompositeModification(modification)), getSelf());
- }else{
- throw new Exception ("handleRecieve received an unknown mesages"+message);
+ public void handleReceive(Object message) {
+ if (CloseTransaction.isSerializedType(message)) {
+ closeTransaction(true);
+ } else if (message instanceof ReceiveTimeout) {
+ LOG.debug("Got ReceiveTimeout for inactivity - closing transaction {}", transactionID);
+ closeTransaction(false);
+ } else {
+ unknownMessage(message);