javax.slee.usage
Class UsageThresholdFilter

java.lang.Object
  extended by javax.slee.usage.UsageThresholdFilter
All Implemented Interfaces:
java.io.Serializable, javax.management.NotificationFilter

public class UsageThresholdFilter
extends java.lang.Object
implements javax.management.NotificationFilter

A notification filter that only allows through UsageNotifications where the notification source usage parameter name match specified values, and the value of the usage parameter has crossed a specified threshold (in either the positive or negative direction).

Each time a usage notification is seen for the specified usage parameter, the current value of the usage parameter is stored. If the previous value and the current value lie on opposite sides of the threshold, the notification is passed to notification listeners. If the previous value was equal to the threshold value, the notification is only passed to notification listeners if the direction on the real axis from the previous value to the current value is the same as the approach made to the threshold value.

For example, if the threshold value is set to 10, and three usage notifications with the values 9, 10, and 9 respectively are generated by the SLEE, this notification filter would not pass any of the usage notifications to notification listeners as the threshold has not been crossed. However if three usage notifications with the values 9, 10, and 11 respectively are generated by the SLEE, this notification filter would pass only the last usage notification to notification listeners, as this represents the point when the threshold has been crossed.

In any other situation where the threshold value is not crossed, the notification is suppressed.

If the notification contains usage information for some other notification source or usage parameter, it is also suppressed.

Notifications that are not instances of UsageNotification are also suppressed by this filter.

See Also:
Serialized Form

Constructor Summary
UsageThresholdFilter(NotificationSource notificationSource, java.lang.String paramName, long threshold)
          Create a UsageThresholdFilter.
UsageThresholdFilter(ServiceID service, SbbID sbb, java.lang.String paramName, long threshold)
          Deprecated. Replaced with UsageThresholdFilter(NotificationSource, String, long) as usage collecting has been expanded to include SLEE components other than SBBs.
 
Method Summary
 boolean isNotificationEnabled(javax.management.Notification notification)
          Determine whether the specified notification should be delivered to notification listeners using this notification filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UsageThresholdFilter

public UsageThresholdFilter(ServiceID service,
                            SbbID sbb,
                            java.lang.String paramName,
                            long threshold)
                     throws java.lang.NullPointerException
Deprecated. Replaced with UsageThresholdFilter(NotificationSource, String, long) as usage collecting has been expanded to include SLEE components other than SBBs.

Create a UsageThresholdFilter. A filter created using this constructor will only allow SLEE 1.0-compliant usage notifications to pass through where they otherwise satisfy the filtering criteria.

Parameters:
service - the component identifier of the Service whose usage parameter should be monitored.
sbb - the component identifier of the SBB whose usage parameter should be monitored.
paramName - the name of a usage parameter defined by the SBB.
threshold - the threshold value.
Throws:
java.lang.NullPointerException - if service, sbb, or paramName is null.

UsageThresholdFilter

public UsageThresholdFilter(NotificationSource notificationSource,
                            java.lang.String paramName,
                            long threshold)
                     throws java.lang.NullPointerException
Create a UsageThresholdFilter. A filter created using this constructor will only allow SLEE 1.1-compliant usage notifications to pass through where they otherwise satisfy the filtering criteria.

Parameters:
notificationSource - the notification source whose usage parameter should be monitored.
paramName - the name of a usage parameter defined by the SBB.
threshold - the threshold value.
Throws:
java.lang.NullPointerException - if notificationSource or paramName is null.
Method Detail

isNotificationEnabled

public boolean isNotificationEnabled(javax.management.Notification notification)
Determine whether the specified notification should be delivered to notification listeners using this notification filter.

Specified by:
isNotificationEnabled in interface javax.management.NotificationFilter
Parameters:
notification - the notification to be sent.
Returns:
true if the notification should be delivered to notification listeners, false otherwise. This method always returns false if notification is not an instance of UsageNotification.


Copyright © 2009. All Rights Reserved.