User: juhalindfors
Date: 01/12/10 09:23:27
Added: src/main/javax/management
AttributeChangeNotificationFilter.java
Log:
part of javax.management
Revision Changes Path
1.1
jmx/src/main/javax/management/AttributeChangeNotificationFilter.java
Index: AttributeChangeNotificationFilter.java
===================================================================
/*
* JBoss, the OpenSource J2EE webOS
*
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
package javax.management;
import java.util.Map;
import java.util.HashMap;
import java.util.Vector;
import javax.management.AttributeChangeNotificationFilter;
import javax.management.NotificationFilter;
/**
* Notification filter support for attribute change notifications.
*
* @see javax.management.AttributeChangeNotification
* @see javax.management.NotificationFilter
*
* @author <a href="mailto:[EMAIL PROTECTED]">Juha Lindfors</a>.
* @version $Revision: 1.1 $
*
*/
public class AttributeChangeNotificationFilter
implements NotificationFilter, java.io.Serializable
{
// Attributes ----------------------------------------------------
private Map attributes = new HashMap();
// Constructors --------------------------------------------------
public AttributeChangeNotificationFilter()
{
}
// Public --------------------------------------------------------
public void enableAttribute(String name)
{
attributes.put(name, "true");
}
public void disableAttribute(String name)
{
attributes.remove(name);
}
public void disableAllAttributes()
{
attributes.clear();
}
public Vector getEnabledAttributes()
{
return new Vector(attributes.keySet());
}
// NotificationFilter implementation -----------------------------
public boolean isNotificationEnabled(Notification notification)
{
AttributeChangeNotification notif = (AttributeChangeNotification)notification;
if (attributes.containsKey(notif.getAttributeName()))
return true;
return false;
}
}
_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development