BUG-272: Fixed last checkstyle offenders & activate checkstyle enforcement
[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.dom.api.DOMDataWriteTransaction;
13
14 /**
15  *
16  * Listener on transaction failure which may be passed to
17  * {@link DOMDataCommitExecutor}. This listener is notified during transaction
18  * processing, before result is delivered to other client code outside MD-SAL.
19  * This allows implementors to update their internal state before transaction
20  * failure is visible to client code.
21  *
22  * This is internal API for MD-SAL implementations, for consumer facing error
23  * listeners see {@link org.opendaylight.controller.md.sal.common.api.data.TransactionChainListener}.
24  *
25  */
26 interface DOMDataCommitErrorListener extends EventListener {
27
28     /**
29      *
30      * Callback which is invoked on transaction failure during three phase
31      * commit in {@link DOMDataCommitExecutor}.
32      *
33      *
34      * Implementation of this callback MUST NOT do any blocking calls or any
35      * calls to MD-SAL, since this callback is invoked synchronously on MD-SAL
36      * Broker coordination thread.
37      *
38      * @param tx
39      *            Transaction which failed
40      * @param cause
41      *            Failure reason
42      */
43     void onCommitFailed(DOMDataWriteTransaction tx, Throwable cause);
44
45 }