Bug 9060: Remove un-used Instant getObjectCreated() from CloseTracked
[controller.git] / opendaylight / md-sal / mdsal-trace / dom-impl / src / main / java / org / opendaylight / controller / md / sal / trace / dom / impl / TracingWriteTransaction.java
1 /*
2  * Copyright (c) 2017 Red Hat, 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.trace.dom.impl;
9
10 import com.google.common.util.concurrent.CheckedFuture;
11 import com.google.common.util.concurrent.ListenableFuture;
12 import org.opendaylight.controller.md.sal.common.api.TransactionStatus;
13 import org.opendaylight.controller.md.sal.common.api.data.TransactionCommitFailedException;
14 import org.opendaylight.controller.md.sal.dom.api.DOMDataWriteTransaction;
15 import org.opendaylight.controller.md.sal.trace.closetracker.impl.CloseTracked;
16 import org.opendaylight.controller.md.sal.trace.closetracker.impl.CloseTrackedRegistry;
17 import org.opendaylight.controller.md.sal.trace.closetracker.impl.CloseTrackedTrait;
18 import org.opendaylight.yangtools.yang.common.RpcResult;
19
20 class TracingWriteTransaction extends AbstractTracingWriteTransaction
21         implements CloseTracked<TracingWriteTransaction> {
22
23     private final CloseTrackedTrait<TracingWriteTransaction> closeTracker;
24
25     TracingWriteTransaction(DOMDataWriteTransaction delegate, TracingBroker tracingBroker,
26             CloseTrackedRegistry<TracingWriteTransaction> writeTransactionsRegistry) {
27         super(delegate, tracingBroker);
28         this.closeTracker = new CloseTrackedTrait<>(writeTransactionsRegistry);
29     }
30
31     @Override
32     public CheckedFuture<Void, TransactionCommitFailedException> submit() {
33         closeTracker.removeFromTrackedRegistry();
34         return super.submit();
35     }
36
37     @Override
38     public ListenableFuture<RpcResult<TransactionStatus>> commit() {
39         closeTracker.removeFromTrackedRegistry();
40         return super.commit();
41     }
42
43     @Override
44     public boolean cancel() {
45         closeTracker.removeFromTrackedRegistry();
46         return super.cancel();
47     }
48
49     @Override
50     public StackTraceElement[] getAllocationContextStackTrace() {
51         return closeTracker.getAllocationContextStackTrace();
52     }
53
54 }

©2013 OpenDaylight, A Linux Foundation Collaborative Project. All Rights Reserved.
OpenDaylight is a registered trademark of The OpenDaylight Project, Inc.
Linux Foundation and OpenDaylight are registered trademarks of the Linux Foundation.
Linux is a registered trademark of Linus Torvalds.