2 * Copyright (c) 2017 Red Hat, 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
8 package org.opendaylight.mdsal.trace.impl;
10 import org.eclipse.jdt.annotation.Nullable;
13 * Convenience abstract base class for {@link CloseTracked} implementors.
15 * @author Michael Vorburger.ch
17 abstract class AbstractCloseTracked<T extends AbstractCloseTracked<T>> implements CloseTracked<T> {
18 private final CloseTrackedTrait<T> closeTracker;
20 AbstractCloseTracked(CloseTrackedRegistry<T> transactionChainRegistry) {
21 this.closeTracker = new CloseTrackedTrait<>(transactionChainRegistry, this);
24 protected void removeFromTrackedRegistry() {
25 closeTracker.removeFromTrackedRegistry();
29 public @Nullable StackTraceElement[] getAllocationContextStackTrace() {
30 return closeTracker.getAllocationContextStackTrace();
34 public final CloseTracked<T> getRealCloseTracked() {