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
17 public abstract class AbstractCloseTracked<T extends AbstractCloseTracked<T>> implements CloseTracked<T> {
19 private final CloseTrackedTrait<T> closeTracker;
21 protected AbstractCloseTracked(CloseTrackedRegistry<T> transactionChainRegistry) {
22 this.closeTracker = new CloseTrackedTrait<>(transactionChainRegistry, this);
25 protected void removeFromTrackedRegistry() {
26 closeTracker.removeFromTrackedRegistry();
30 public @Nullable StackTraceElement[] getAllocationContextStackTrace() {
31 return closeTracker.getAllocationContextStackTrace();
35 public final CloseTracked<T> getRealCloseTracked() {