X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=opendaylight%2Fmd-sal%2Fsal-common-api%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Fcontroller%2Fmd%2Fsal%2Fcommon%2Fapi%2Fdata%2FAsyncWriteTransaction.java;h=cc22bb91ad401a20bfdd06bdc6fd753422df546b;hb=a81d98f692b80c45bce3fe6a87e731abfb012a9f;hp=e47b54a0a1e6e138292530994a57b539501fc1bb;hpb=c46e223995956f1f759c551163c212947c1e2fb7;p=controller.git diff --git a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncWriteTransaction.java b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncWriteTransaction.java index e47b54a0a1..cc22bb91ad 100644 --- a/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncWriteTransaction.java +++ b/opendaylight/md-sal/sal-common-api/src/main/java/org/opendaylight/controller/md/sal/common/api/data/AsyncWriteTransaction.java @@ -132,8 +132,6 @@ public interface AsyncWriteTransaction

, D> extends AsyncTransa *

* This call logically seals the transaction, which prevents the client from * further changing data tree using this transaction. Any subsequent calls to - * {@link #put(LogicalDatastoreType, Path, Object)}, - * {@link #merge(LogicalDatastoreType, Path, Object)} or * {@link #delete(LogicalDatastoreType, Path)} will fail with * {@link IllegalStateException}. * @@ -149,24 +147,24 @@ public interface AsyncWriteTransaction

, D> extends AsyncTransa * The effects of a successful commit of data depends on data change listeners * ({@link AsyncDataChangeListener}) and commit participants * ({@link AsyncConfigurationCommitHandler}) that are registered with the data broker. - *

+ * *

Example usage:

*
      *  private void doWrite( final int tries ) {
      *      WriteTransaction writeTx = dataBroker.newWriteOnlyTransaction();
      *
      *      MyDataObject data = ...;
-     *      InstanceIdentifier path = ...;
+     *      InstanceIdentifier<MyDataObject> path = ...;
      *      writeTx.put( LogicalDatastoreType.OPERATIONAL, path, data );
      *
-     *      Futures.addCallback( writeTx.submit(), new FutureCallback() {
+     *      Futures.addCallback( writeTx.submit(), new FutureCallback<Void>() {
      *          public void onSuccess( Void result ) {
      *              // succeeded
      *          }
      *
      *          public void onFailure( Throwable t ) {
      *              if( t instanceof OptimisticLockFailedException ) {
-     *                  if( ( tries - 1 ) > 0 ) {
+     *                  if( ( tries - 1 ) < 0 ) {
      *                      // do retry
      *                      doWrite( tries - 1 );
      *                  } else {
@@ -214,7 +212,7 @@ public interface AsyncWriteTransaction

, D> extends AsyncTransa * which are based on same initial state, Tx 1 completes successfully * before Tx 2 is submitted. * - * + *
* * * @@ -238,7 +236,7 @@ public interface AsyncWriteTransaction

, D> extends AsyncTransa * which are based on same initial state, Tx 1 completes successfully * before Tx 2 is submitted. * - *

Initial stateTx 1Tx 2Result
Emptyput(A,1)put(A,2)Tx 2 will fail, state is A=1
Emptyput(A,1)merge(A,2)A=2
+ *
* * *
Initial stateTx 1Tx 2Result
Emptyput(TOP,[])put(TOP,[])Tx 2 will fail, state is TOP=[]