+ getSender().tell(CloseTransactionChainReply.INSTANCE.toSerializable(), getSelf());
+ }else{
+ unknownMessage(message);
+ }
+ }
+
+ private ActorRef getShardActor(){
+ return getContext().parent();
+ }
+
+ private ActorRef createTypedTransactionActor(CreateTransaction createTransaction) {
+ String transactionName = "shard-" + createTransaction.getTransactionId();
+ if(createTransaction.getTransactionType() ==
+ TransactionProxy.TransactionType.READ_ONLY.ordinal()) {
+ return getContext().actorOf(
+ ShardTransaction.props( chain.newReadOnlyTransaction(), getShardActor(),
+ schemaContext, datastoreContext, shardStats,
+ createTransaction.getTransactionId(),
+ createTransaction.getVersion()), transactionName);
+ } else if (createTransaction.getTransactionType() ==
+ TransactionProxy.TransactionType.READ_WRITE.ordinal()) {
+ return getContext().actorOf(
+ ShardTransaction.props( chain.newReadWriteTransaction(), getShardActor(),
+ schemaContext, datastoreContext, shardStats,
+ createTransaction.getTransactionId(),
+ createTransaction.getVersion()), transactionName);
+ } else if (createTransaction.getTransactionType() ==
+ TransactionProxy.TransactionType.WRITE_ONLY.ordinal()) {
+ return getContext().actorOf(
+ ShardTransaction.props( chain.newWriteOnlyTransaction(), getShardActor(),
+ schemaContext, datastoreContext, shardStats,
+ createTransaction.getTransactionId(),
+ createTransaction.getVersion()), transactionName);
+ } else {
+ throw new IllegalArgumentException (
+ "CreateTransaction message has unidentified transaction type=" +
+ createTransaction.getTransactionType());