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);
}
}
}