2 * Copyright (c) 2015 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.mdsal.common.api;
11 import com.google.common.annotations.Beta;
12 import com.google.common.util.concurrent.Futures;
13 import com.google.common.util.concurrent.ListenableFuture;
14 import javax.annotation.Nonnull;
17 * Common interface for implementing three-phase commit steps.
18 * Actual steps to be implemented are: {@link PostCanCommitStep} and {@link PostPreCommitStep} which
19 * allows to customize pre-commit, commit and abort actions.
23 public interface ThreePhaseCommitStep {
25 ListenableFuture<?> NOOP_ABORT_FUTURE = Futures.immediateFuture(null);
28 * Invoked on transaction aborted.
29 * This callback is invoked by three-phase commit coordinator if associated data transaction
30 * will not be commited and is being aborted.
31 * Implementation MUST rollback any changes, which were introduced by implementation based on
34 * @return ListenableFuture which will complete once abort is completed.
37 ListenableFuture<?> abort();