Bug 1073: Added support to DOMBrokerImpl for Transaction Chaining
[controller.git] / opendaylight / md-sal / sal-dom-broker / src / main / java / org / opendaylight / controller / md / sal / dom / broker / impl / DOMDataCommitErrorListener.java
1 /*
2  * Copyright (c) 2014 Cisco Systems, Inc. and others.  All rights reserved.
3  *
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
7  */
8 package org.opendaylight.controller.md.sal.dom.broker.impl;
9
10 import java.util.EventListener;
11
12 import org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener;
13 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
14
15 /**
16  *
17  * Listener on transaction failure which may be passed to
18  * {@link DOMDataCommitExecutor}. This listener is notified during transaction
19  * processing, before result is delivered to other client code outside MD-SAL.
20  * This allows implementors to update their internal state before transaction
21  * failure is visible to client code.
22  *
23  * This is internal API for MD-SAL implementations, for consumer facing error
24  * listeners see {@link TransactionChainListener}.
25  *
26  */
27 interface DOMDataCommitErrorListener extends EventListener {
28
29     /**
30      *
31      * Callback which is invoked on transaction failure during three phase
32      * commit in {@link DOMDataCommitExecutor}.
33      *
34      *
35      * Implementation of this callback MUST NOT do any blocking calls or any
36      * calls to MD-SAL, since this callback is invoked synchronously on MD-SAL
37      * Broker coordination thread.
38      *
39      * @param tx
40      *            Transaction which failed
41      * @param cause
42      *            Failure reason
43      */
44     void onCommitFailed(DOMDataWriteTransaction tx, Throwable cause);
45
46 }