tracelevelfilter.java
来自「jainslee1.0 源代码」· Java 代码 · 共 44 行
JAVA
44 行
package javax.slee.management;import javax.slee.facilities.Level;import javax.management.Notification;import javax.management.NotificationFilter;/** * A notification filter that filters {@link TraceNotification}s based on their * trace level. Only trace notifications of the specified level or greater are * be allowed through this filter. * <p> * Notifications that are not instances of {@link TraceNotification} are suppressed * by this filter. */public class TraceLevelFilter implements NotificationFilter { /** * Create a <code>TraceLevelFilter</code>. * @param minLevel this minimum trace level of trace notifications allowed * through this filter. */ public TraceLevelFilter(Level minLevel) { this.minLevel = minLevel; } /** * Determine whether the specified notification should be delivered to notification * listeners using this notification filter. * @param notification the notification to be sent. * @return <code>true</code> if the notification should be delivered to notification * listeners, <code>false</code> otherwise. This method always returns * <code>false</code> if <code>notification</code> is not an instance of * {@link TraceNotification}. */ public boolean isNotificationEnabled(Notification notification) { if (!(notification instanceof TraceNotification)) return false; return !minLevel.isHigherLevel(((TraceNotification)notification).getLevel()); } private final Level minLevel;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?