- @Override
- public ShardTransactionChain create() throws Exception {
- return new ShardTransactionChain(chain);
- }
- });
- }
+ private void createTransaction(CreateTransaction createTransaction) {
+ DOMStoreReadWriteTransaction transaction =
+ chain.newReadWriteTransaction();
+ ActorRef transactionActor = getContext().actorOf(ShardTransaction
+ .props(chain, transaction, getContext().parent(), schemaContext), "shard-" + createTransaction.getTransactionId());
+ getSender()
+ .tell(ShardTransactionMessages.CreateTransactionReply.newBuilder()
+ .setTransactionActorPath(transactionActor.path().toString())
+ .setTransactionId(createTransaction.getTransactionId())
+ .build(),
+ getSelf());
+ }
+
+ public static Props props(final DOMStoreTransactionChain chain, final SchemaContext schemaContext) {
+ return Props.create(new Creator<ShardTransactionChain>() {
+
+ @Override
+ public ShardTransactionChain create() throws Exception {
+ return new ShardTransactionChain(chain, schemaContext);
+ }
+ });
+ }