Example usage for org.springframework.context ApplicationListener equals

List of usage examples for org.springframework.context ApplicationListener equals

Introduction

In this page you can find the example usage for org.springframework.context ApplicationListener equals.

Prototype

public boolean equals(Object obj) 

Source Link

Document

Indicates whether some other object is "equal to" this one.

Usage

From source file:org.mule.module.spring.events.MuleEventMulticaster.java

/**
 * Removes a listener from the multicaster
 *
 * @param listener the listener to remove
 *//*from w w w.ja  v a 2  s  .c om*/
public void removeApplicationListener(ApplicationListener listener) {
    for (Iterator iterator = listeners.iterator(); iterator.hasNext();) {
        ApplicationListener applicationListener = (ApplicationListener) iterator.next();
        if (applicationListener instanceof AsynchronousEventListener) {
            if (((AsynchronousEventListener) applicationListener).getListener().equals(listener)) {
                listeners.remove(applicationListener);
                return;
            }
        } else {
            if (applicationListener.equals(listener)) {
                listeners.remove(applicationListener);
                return;
            }
        }
    }
    listeners.remove(listener);
}