2 * Copyright (c) 2014 Cisco Systems, Inc. and others. All rights reserved.
4 * This program and the accompanying materials are made available under the
5 * terms of the Eclipse Public License v1.0 which accompanies this distribution,
6 * and is available at http://www.eclipse.org/legal/epl-v10.html
9 package org.opendaylight.controller.cluster.datastore;
11 import akka.actor.Props;
12 import akka.actor.UntypedActor;
13 import akka.japi.Creator;
14 import org.opendaylight.controller.sal.core.spi.data.DOMStoreReadWriteTransaction;
17 * The ShardTransaction Actor represents a remote transaction
19 * The ShardTransaction Actor delegates all actions to DOMDataReadWriteTransaction
21 * Even though the DOMStore and the DOMStoreTransactionChain implement multiple types of transactions
22 * the ShardTransaction Actor only works with read-write transactions. This is just to keep the logic simple. At this
23 * time there are no known advantages for creating a read-only or write-only transaction which may change over time
24 * at which point we can optimize things in the distributed store as well.
26 public class ShardTransaction extends UntypedActor {
28 private final DOMStoreReadWriteTransaction transaction;
30 public ShardTransaction(DOMStoreReadWriteTransaction transaction) {
31 this.transaction = transaction;
35 public static Props props(final DOMStoreReadWriteTransaction transaction){
36 return Props.create(new Creator<ShardTransaction>(){
39 public ShardTransaction create() throws Exception {
40 return new ShardTransaction(transaction);
46 public void onReceive(Object message) throws Exception {
47 throw new UnsupportedOperationException("onReceive");