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.controller.md.sal.trace.closetracker.impl;
10 import org.eclipse.jdt.annotation.Nullable;
13 * Convenience abstract base class for {@link CloseTracked} implementors.
15 * @author Michael Vorburger.ch
18 public abstract class AbstractCloseTracked<T extends AbstractCloseTracked<T>> implements CloseTracked<T> {
20 private final CloseTrackedTrait<T> closeTracker;
22 protected AbstractCloseTracked(CloseTrackedRegistry<T> transactionChainRegistry) {
23 this.closeTracker = new CloseTrackedTrait<>(transactionChainRegistry, this);
26 protected void removeFromTrackedRegistry() {
27 closeTracker.removeFromTrackedRegistry();
31 public @Nullable StackTraceElement[] getAllocationContextStackTrace() {
32 return closeTracker.getAllocationContextStackTrace();
36 public final CloseTracked<T> getRealCloseTracked() {