Example usage for java.util.concurrent ConcurrentLinkedQueue contains

List of usage examples for java.util.concurrent ConcurrentLinkedQueue contains

Introduction

In this page you can find the example usage for java.util.concurrent ConcurrentLinkedQueue contains.

Prototype

public boolean contains(Object o) 

Source Link

Document

Returns true if this queue contains the specified element.

Usage

From source file:com.clican.pluto.cluster.base.BaseMessageDispatcher.java

public synchronized void unbind(String msgName, IMessageHandler handler) {
    if (StringUtils.isEmpty(msgName) || handler == null) {
        throw new IllegalArgumentException("The message name and message handler can't be null");
    }/*from   ww w.j av a 2  s .co  m*/
    ConcurrentLinkedQueue<IMessageHandler> handlerQueue = messageHandlerMapping.get(msgName);
    if (handlerQueue == null || !handlerQueue.contains(handler)) {
        log.warn("The message handler [" + handler + "] is not binded by [" + msgName + "]");
    }
    handlerQueue.remove(handler);
}