import java.util.EventListener;
import org.eclipse.jdt.annotation.NonNull;
+@Deprecated(since = "12.0.0", forRemoval = true)
public abstract class AbstractListenerRegistration<T extends EventListener> extends AbstractObjectRegistration<T>
implements ListenerRegistration<T> {
-
protected AbstractListenerRegistration(final @NonNull T listener) {
super(listener);
}
* guarantee that the process of unregistration cannot fail for predictable reasons.
*
* @param <T> Type of registered listener
+ * @deprecated Use {@link ObjectRegistration} instead
*/
+@Deprecated(since = "12.0.0", forRemoval = true)
public interface ListenerRegistration<T extends EventListener> extends ObjectRegistration<T> {
/**
* Unregister the listener. Note that invocations enqueued to the listener are not subject to synchronization
* Implementation of {@link ListenerRegistration} which does nothing in its {@link #close()} method.
*
* @param <T> Type of registered listener
+ * @deprecated Use {@link NoOpObjectRegistration} instead
*/
@NonNullByDefault
+@Deprecated(since = "12.0.0", forRemoval = true)
public final class NoOpListenerRegistration<T extends EventListener> extends NoOpObjectRegistration<T>
implements ListenerRegistration<T> {
private NoOpListenerRegistration(final T instance) {
* Unregisters the object. This operation is required not to invoke blocking operations. Implementations which
* require interaction with outside world must provide guarantees that any work is done behind the scenes and
* the unregistration process looks as if it has already succeeded once this method returns.
+ *
+ * <p>
+ * The above requirement does not necessarily mean that all interactions with the registered entity seize before
+ * this method returns, but they should complete within a reasonable time frame.
+ *
+ * <p>
+ * While the interface contract allows an implementation to ignore the occurrence of RuntimeExceptions,
+ * implementations are strongly encouraged to deal with such exceptions internally and to ensure invocations of
+ * this method do not fail in such circumstances.
*/
@Override
void close();