2 * Copyright (c) 2013 Cisco Systems, 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.protocol.concepts;
10 import java.util.EventListener;
12 import javax.annotation.concurrent.ThreadSafe;
14 import com.google.common.base.Preconditions;
17 * An interface representing a listener registration. Objects offering
18 * the ability to register listener should return an implementation of this
19 * interface upon successful registration. The users are required to call
20 * #close() before losing the reference to that object.
22 * @param <T> template reference to associated EventListener implementation
25 public abstract class ListenerRegistration<T extends EventListener> extends AbstractRegistration {
26 protected final T listener;
28 protected ListenerRegistration(final T listener) {
29 this.listener = Preconditions.checkNotNull(listener);
33 * Access the listener object associated with this registration.
35 * @return Associated listener.
37 public final T getListener() {