Package org.jboss.mx.remote.dispatcher

Source Code of org.jboss.mx.remote.dispatcher.HighPriorityNotificationDispatcher

package org.jboss.mx.remote.dispatcher;

import EDU.oswego.cs.dl.util.concurrent.Channel;
import EDU.oswego.cs.dl.util.concurrent.LinkedQueue;

import javax.management.Notification;
import javax.management.NotificationFilter;
import javax.management.NotificationListener;

/**
* High priority based notification dispatcher
*
* @author <a href="mailto:jhaynie@vocalocity.net">Jeff Haynie</a>
* @version $Revision: 1.2 $
*/
public class HighPriorityNotificationDispatcher
        extends AbstractNotificationDispatcher
{
    public HighPriorityNotificationDispatcher()
    {
        super();
    }

    /**
     * subclasses override to provide their own queue implementation
     */
    protected Channel createQueue()
    {
        // use an unbound buffer
        return new LinkedQueue();
    }

    /**
     * dispatch a specific event to a listener
     */
    protected void dispatch(
            final NotificationListener listener,
            final NotificationFilter filter,
            final Object handback,
            final Notification event)
    {
        if (filter == null || filter.isNotificationEnabled(event))
        {
            listener.handleNotification(event, handback);
        }
    }

}
TOP

Related Classes of org.jboss.mx.remote.dispatcher.HighPriorityNotificationDispatcher

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.