|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.mx.util.JBossNotificationFilterSupport
public class JBossNotificationFilterSupport
A replacement for NotificationFilterSupport
that avoids synchronization when reading the enabled notification types
by using copy-on-write semantics.
Reading operation operate on the latest snapshot of the enabledTypes.
Mutating operations synchronize on 'this', only because of the
addIfAbsent logic in enableType(). This could be avoided by
using java.util.concurrent or EDU.oswego.cs.dl.util.concurrent
directly, rather than org.jboss.util.CollectionsFactory.
In any case, mutating operations are rare when dealing with
NotificationFilters. The common usage is to configure it once and
be done with it.
Constructor Summary | |
---|---|
JBossNotificationFilterSupport()
Default CTOR. |
Method Summary | |
---|---|
void |
disableAllTypes()
Disable all notification types. |
void |
disableType(String type)
Disable a notification type. |
void |
enableType(String type)
Enable a notification type. |
Vector |
getEnabledTypes()
Get all the enabled notification types. |
boolean |
isNotificationEnabled(Notification notification)
Test to see whether this notification is enabled |
String |
toString()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JBossNotificationFilterSupport()
Method Detail |
---|
public void disableAllTypes()
public void disableType(String type)
type
- the notification type to disable.public void enableType(String type) throws IllegalArgumentException
type
- the notification type to enable.
IllegalArgumentException
- for a null typepublic Vector getEnabledTypes()
Returns a vector of enabled notification type.
An empty vector means all types disabled.
public String toString()
toString
in class Object
public boolean isNotificationEnabled(Notification notification)
isNotificationEnabled
in interface NotificationFilter
notification
- the notification to filter
IllegalArgumentException
- for null notification.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |