类javax.management.AttributeChangeNotification源码实例Demo

下面列出了怎么用javax.management.AttributeChangeNotification的API类实例代码及写法,或者点击链接到github查看源代码。

源代码1 项目: Tomcat8-Source-Read   文件: BaseModelMBean.java
/**
 * Send an <code>AttributeChangeNotification</code> to all registered
 * listeners.
 *
 * @param notification The <code>AttributeChangeNotification</code>
 *  that will be passed
 *
 * @exception MBeanException if an object initializer throws an
 *  exception
 * @exception RuntimeOperationsException wraps IllegalArgumentException
 *  when the specified notification is <code>null</code> or invalid
 */
@Override
public void sendAttributeChangeNotification
    (AttributeChangeNotification notification)
    throws MBeanException, RuntimeOperationsException {

    if (notification == null)
        throw new RuntimeOperationsException
            (new IllegalArgumentException("Notification is null"),
             "Notification is null");
    if (attributeBroadcaster == null)
        return; // This means there are no registered listeners
    if( log.isDebugEnabled() )
        log.debug( "AttributeChangeNotification " + notification );
    attributeBroadcaster.sendNotification(notification);

}
 
源代码2 项目: openjdk-jdk9   文件: SimpleStandard.java
/**
 * Operation: reset to their initial values the "State" and "NbChanges"
 * attributes of the "SimpleStandard" standard MBean.
 */
public void reset() {
    AttributeChangeNotification acn =
        new AttributeChangeNotification(this,
                                        0,
                                        0,
                                        "NbChanges reset",
                                        "NbChanges",
                                        "Integer",
                                        new Integer(nbChanges),
                                        new Integer(0));
    state = "initial state";
    nbChanges = 0;
    nbResets++;
    sendNotification(acn);
}
 
源代码3 项目: Tomcat8-Source-Read   文件: TestSlowQueryReport.java
@Override
public void handleNotification(Notification notification,
                               Object handback) {
    notificationCount.incrementAndGet();
    System.out.println("\nReceived notification:");
    System.out.println("\tClassName: " + notification.getClass().getName());
    System.out.println("\tSource: " + notification.getSource());
    System.out.println("\tType: " + notification.getType());
    System.out.println("\tMessage: " + notification.getMessage());
    if (notification instanceof AttributeChangeNotification) {
        AttributeChangeNotification acn =
            (AttributeChangeNotification) notification;
        System.out.println("\tAttributeName: " + acn.getAttributeName());
        System.out.println("\tAttributeType: " + acn.getAttributeType());
        System.out.println("\tNewValue: " + acn.getNewValue());
        System.out.println("\tOldValue: " + acn.getOldValue());
    }
}
 
/**
 * Send the supplied {@link Notification} using the wrapped
 * {@link ModelMBean} instance.
 * @param notification the {@link Notification} to be sent
 * @throws IllegalArgumentException if the supplied {@code notification} is {@code null}
 * @throws UnableToSendNotificationException if the supplied {@code notification} could not be sent
 */
@Override
public void sendNotification(Notification notification) {
	Assert.notNull(notification, "Notification must not be null");
	replaceNotificationSourceIfNecessary(notification);
	try {
		if (notification instanceof AttributeChangeNotification) {
			this.modelMBean.sendAttributeChangeNotification((AttributeChangeNotification) notification);
		}
		else {
			this.modelMBean.sendNotification(notification);
		}
	}
	catch (MBeanException ex) {
		throw new UnableToSendNotificationException("Unable to send notification [" + notification + "]", ex);
	}
}
 
@Override
public void handleNotification(Notification notification, Object handback) {
	if (notification instanceof AttributeChangeNotification) {
		AttributeChangeNotification attNotification = (AttributeChangeNotification) notification;
		String attributeName = attNotification.getAttributeName();

		Integer currentCount = (Integer) this.attributeCounts.get(attributeName);

		if (currentCount != null) {
			int count = currentCount.intValue() + 1;
			this.attributeCounts.put(attributeName, new Integer(count));
		}
		else {
			this.attributeCounts.put(attributeName, new Integer(1));
		}

		this.attributeHandbacks.put(attributeName, handback);
	}
}
 
源代码6 项目: jdk8u_jdk   文件: SimpleStandard.java
/**
 * Operation: reset to their initial values the "State" and "NbChanges"
 * attributes of the "SimpleStandard" standard MBean.
 */
public void reset() {
    checkSubject("reset");
    AttributeChangeNotification acn =
        new AttributeChangeNotification(this,
                                        0,
                                        0,
                                        "NbChanges reset",
                                        "NbChanges",
                                        "Integer",
                                        new Integer(nbChanges),
                                        new Integer(0));
    state = "initial state";
    nbChanges = 0;
    nbResets++;
    sendNotification(acn);
}
 
源代码7 项目: jdk8u-jdk   文件: SimpleStandard.java
/**
 * Operation: reset to their initial values the "State" and "NbChanges"
 * attributes of the "SimpleStandard" standard MBean.
 */
public void reset() {
    checkSubject("reset");
    AttributeChangeNotification acn =
        new AttributeChangeNotification(this,
                                        0,
                                        0,
                                        "NbChanges reset",
                                        "NbChanges",
                                        "Integer",
                                        new Integer(nbChanges),
                                        new Integer(0));
    state = "initial state";
    nbChanges = 0;
    nbResets++;
    sendNotification(acn);
}
 
源代码8 项目: jdk8u-jdk   文件: CommunicatorServer.java
/**
 * Returns an array of MBeanNotificationInfo objects describing
 * the notification types sent by this CommunicatorServer.
 * There is only one type of notifications sent by the CommunicatorServer:
 * it is <tt>{@link javax.management.AttributeChangeNotification}</tt>,
 * sent when the <tt>State</tt> attribute of this CommunicatorServer
 * changes.
 */
@Override
public MBeanNotificationInfo[] getNotificationInfo() {

    // Initialize notifInfos on first call to getNotificationInfo()
    //
    if (notifInfos == null) {
        notifInfos = new MBeanNotificationInfo[1];
        String[] notifTypes = {
            AttributeChangeNotification.ATTRIBUTE_CHANGE};
        notifInfos[0] = new MBeanNotificationInfo( notifTypes,
                 AttributeChangeNotification.class.getName(),
                 "Sent to notify that the value of the State attribute "+
                 "of this CommunicatorServer instance has changed.");
    }

    return notifInfos.clone();
}
 
源代码9 项目: jdk8u_jdk   文件: SimpleStandard.java
/**
 * Operation: reset to their initial values the "State" and "NbChanges"
 * attributes of the "SimpleStandard" standard MBean.
 */
public void reset() {
    checkSubject();
    AttributeChangeNotification acn =
        new AttributeChangeNotification(this,
                                        0,
                                        0,
                                        "NbChanges reset",
                                        "NbChanges",
                                        "Integer",
                                        new Integer(nbChanges),
                                        new Integer(0));
    state = "initial state";
    nbChanges = 0;
    nbResets++;
    sendNotification(acn);
}
 
源代码10 项目: tomcatsrc   文件: BaseAttributeFilter.java
/**
 * <p>Test whether notification enabled for this event.
 * Return true if:</p>
 * <ul>
 * <li>This is an attribute change notification</li>
 * <li>Either the set of accepted names is empty (implying that all
 *     attribute names are of interest) or the set of accepted names
 *     includes the name of the attribute in this notification</li>
 * </ul>
 */
@Override
public boolean isNotificationEnabled(Notification notification) {

    if (notification == null)
        return (false);
    if (!(notification instanceof AttributeChangeNotification))
        return (false);
    AttributeChangeNotification acn =
        (AttributeChangeNotification) notification;
    if (!AttributeChangeNotification.ATTRIBUTE_CHANGE.equals(acn.getType()))
        return (false);
    synchronized (names) {
        if (names.size() < 1)
            return (true);
        else
            return (names.contains(acn.getAttributeName()));
    }

}
 
源代码11 项目: dragonwell8_jdk   文件: FlightRecorderMXBeanImpl.java
private Notification createNotication(Recording recording) {
    try {
        Long id = recording.getId();
        Object oldValue = changes.get(recording.getId());
        Object newValue = getAttribute(ATTRIBUTE_RECORDINGS);
        if (recording.getState() != RecordingState.CLOSED) {
            changes.put(id, newValue);
        } else {
            changes.remove(id);
        }
        return new AttributeChangeNotification(getObjectName(), sequenceNumber.incrementAndGet(), System.currentTimeMillis(), "Recording " + recording.getName() + " is "
                + recording.getState(), ATTRIBUTE_RECORDINGS, newValue.getClass().getName(), oldValue, newValue);
    } catch (AttributeNotFoundException | MBeanException | ReflectionException e) {
        throw new RuntimeException("Could not create notifcation for FlightRecorderMXBean. " + e.getMessage(), e);
    }
}
 
源代码12 项目: openjdk-8-source   文件: CommunicatorServer.java
/**
 * Returns an array of MBeanNotificationInfo objects describing
 * the notification types sent by this CommunicatorServer.
 * There is only one type of notifications sent by the CommunicatorServer:
 * it is <tt>{@link javax.management.AttributeChangeNotification}</tt>,
 * sent when the <tt>State</tt> attribute of this CommunicatorServer
 * changes.
 */
@Override
public MBeanNotificationInfo[] getNotificationInfo() {

    // Initialize notifInfos on first call to getNotificationInfo()
    //
    if (notifInfos == null) {
        notifInfos = new MBeanNotificationInfo[1];
        String[] notifTypes = {
            AttributeChangeNotification.ATTRIBUTE_CHANGE};
        notifInfos[0] = new MBeanNotificationInfo( notifTypes,
                 AttributeChangeNotification.class.getName(),
                 "Sent to notify that the value of the State attribute "+
                 "of this CommunicatorServer instance has changed.");
    }

    return notifInfos.clone();
}
 
源代码13 项目: openjdk-8   文件: ScanManager.java
/**
 * Enqueue a state changed notification for the given states.
 **/
private void queueStateChangedNotification(
                long sequence,
                long time,
                ScanState old,
                ScanState current) {
    final AttributeChangeNotification n =
            new AttributeChangeNotification(SCAN_MANAGER_NAME,sequence,time,
            "ScanManager State changed to "+current,"State",
            ScanState.class.getName(),old.toString(),current.toString());
    // Queue the notification. We have created an unlimited queue, so
    // this method should always succeed.
    try {
        if (!pendingNotifs.offer(n,2,TimeUnit.SECONDS)) {
            LOG.fine("Can't queue Notification: "+n);
        }
    } catch (InterruptedException x) {
            LOG.fine("Can't queue Notification: "+x);
    }
}
 
@Override
public void handleNotification(Notification notification, Object handback) {
	if (notification instanceof AttributeChangeNotification) {
		AttributeChangeNotification attNotification = (AttributeChangeNotification) notification;
		String attributeName = attNotification.getAttributeName();

		Integer currentCount = (Integer) this.attributeCounts.get(attributeName);

		if (currentCount != null) {
			int count = currentCount.intValue() + 1;
			this.attributeCounts.put(attributeName, new Integer(count));
		} else {
			this.attributeCounts.put(attributeName, new Integer(1));
		}

		this.attributeHandbacks.put(attributeName, handback);
	}
}
 
源代码15 项目: openjdk-jdk8u-backup   文件: CommunicatorServer.java
/**
 * Returns an array of MBeanNotificationInfo objects describing
 * the notification types sent by this CommunicatorServer.
 * There is only one type of notifications sent by the CommunicatorServer:
 * it is <tt>{@link javax.management.AttributeChangeNotification}</tt>,
 * sent when the <tt>State</tt> attribute of this CommunicatorServer
 * changes.
 */
@Override
public MBeanNotificationInfo[] getNotificationInfo() {

    // Initialize notifInfos on first call to getNotificationInfo()
    //
    if (notifInfos == null) {
        notifInfos = new MBeanNotificationInfo[1];
        String[] notifTypes = {
            AttributeChangeNotification.ATTRIBUTE_CHANGE};
        notifInfos[0] = new MBeanNotificationInfo( notifTypes,
                 AttributeChangeNotification.class.getName(),
                 "Sent to notify that the value of the State attribute "+
                 "of this CommunicatorServer instance has changed.");
    }

    return notifInfos.clone();
}
 
源代码16 项目: openjdk-8-source   文件: SimpleStandard.java
/**
 * Operation: reset to their initial values the "State" and "NbChanges"
 * attributes of the "SimpleStandard" standard MBean.
 */
public void reset() {
    checkSubject();
    AttributeChangeNotification acn =
        new AttributeChangeNotification(this,
                                        0,
                                        0,
                                        "NbChanges reset",
                                        "NbChanges",
                                        "Integer",
                                        new Integer(nbChanges),
                                        new Integer(0));
    state = "initial state";
    nbChanges = 0;
    nbResets++;
    sendNotification(acn);
}
 
源代码17 项目: jdk8u-jdk   文件: ScanManager.java
/**
 * Enqueue a state changed notification for the given states.
 **/
private void queueStateChangedNotification(
                long sequence,
                long time,
                ScanState old,
                ScanState current) {
    final AttributeChangeNotification n =
            new AttributeChangeNotification(SCAN_MANAGER_NAME,sequence,time,
            "ScanManager State changed to "+current,"State",
            ScanState.class.getName(),old.toString(),current.toString());
    // Queue the notification. We have created an unlimited queue, so
    // this method should always succeed.
    try {
        if (!pendingNotifs.offer(n,2,TimeUnit.SECONDS)) {
            LOG.fine("Can't queue Notification: "+n);
        }
    } catch (InterruptedException x) {
            LOG.fine("Can't queue Notification: "+x);
    }
}
 
源代码18 项目: TencentKona-8   文件: CommunicatorServer.java
/**
 * Returns an array of MBeanNotificationInfo objects describing
 * the notification types sent by this CommunicatorServer.
 * There is only one type of notifications sent by the CommunicatorServer:
 * it is <tt>{@link javax.management.AttributeChangeNotification}</tt>,
 * sent when the <tt>State</tt> attribute of this CommunicatorServer
 * changes.
 */
@Override
public MBeanNotificationInfo[] getNotificationInfo() {

    // Initialize notifInfos on first call to getNotificationInfo()
    //
    if (notifInfos == null) {
        notifInfos = new MBeanNotificationInfo[1];
        String[] notifTypes = {
            AttributeChangeNotification.ATTRIBUTE_CHANGE};
        notifInfos[0] = new MBeanNotificationInfo( notifTypes,
                 AttributeChangeNotification.class.getName(),
                 "Sent to notify that the value of the State attribute "+
                 "of this CommunicatorServer instance has changed.");
    }

    return notifInfos.clone();
}
 
源代码19 项目: openjdk-jdk8u-backup   文件: SimpleStandard.java
/**
 * Operation: reset to their initial values the "State" and "NbChanges"
 * attributes of the "SimpleStandard" standard MBean.
 */
public void reset() {
    AttributeChangeNotification acn =
        new AttributeChangeNotification(this,
                                        0,
                                        0,
                                        "NbChanges reset",
                                        "NbChanges",
                                        "Integer",
                                        new Integer(nbChanges),
                                        new Integer(0));
    state = "initial state";
    nbChanges = 0;
    nbResets++;
    sendNotification(acn);
}
 
源代码20 项目: openjdk-8   文件: SimpleStandard.java
/**
 * Operation: reset to their initial values the "State" and "NbChanges"
 * attributes of the "SimpleStandard" standard MBean.
 */
public void reset() {
    checkSubject("reset");
    AttributeChangeNotification acn =
        new AttributeChangeNotification(this,
                                        0,
                                        0,
                                        "NbChanges reset",
                                        "NbChanges",
                                        "Integer",
                                        new Integer(nbChanges),
                                        new Integer(0));
    state = "initial state";
    nbChanges = 0;
    nbResets++;
    sendNotification(acn);
}
 
源代码21 项目: TencentKona-8   文件: SimpleStandard.java
/**
 * Operation: reset to their initial values the "State" and "NbChanges"
 * attributes of the "SimpleStandard" standard MBean.
 */
public void reset() {
    checkSubject("reset");
    AttributeChangeNotification acn =
        new AttributeChangeNotification(this,
                                        0,
                                        0,
                                        "NbChanges reset",
                                        "NbChanges",
                                        "Integer",
                                        new Integer(nbChanges),
                                        new Integer(0));
    state = "initial state";
    nbChanges = 0;
    nbResets++;
    sendNotification(acn);
}
 
源代码22 项目: gemfirexd-oss   文件: MX4JModelMBean.java
public void sendAttributeChangeNotification(Attribute oldAttribute, Attribute newAttribute) throws MBeanException, RuntimeOperationsException
{
   if (oldAttribute == null || newAttribute == null) throw new RuntimeOperationsException(new IllegalArgumentException(LocalizedStrings.MX4JModelMBean_ATTRIBUTE_CANNOT_BE_NULL.toLocalizedString()));
   if (!oldAttribute.getName().equals(newAttribute.getName())) throw new RuntimeOperationsException(new IllegalArgumentException(LocalizedStrings.MX4JModelMBean_ATTRIBUTE_NAMES_CANNOT_BE_DIFFERENT.toLocalizedString()));

   // TODO: the source must be the object name of the MBean if the listener was registered through MBeanServer
   Object oldValue = oldAttribute.getValue();
   AttributeChangeNotification n = new AttributeChangeNotification(this,
                                                                   1,
                                                                   System.currentTimeMillis(),
                                                                   "Attribute value changed",
                                                                   oldAttribute.getName(),
                                                                   oldValue == null ? null : oldValue.getClass().getName(),
                                                                   oldValue,
                                                                   newAttribute.getValue());
   sendAttributeChangeNotification(n);
}
 
源代码23 项目: tomcatsrc   文件: BaseModelMBean.java
/**
 * Send an <code>AttributeChangeNotification</code> to all registered
 * listeners.
 *
 * @param notification The <code>AttributeChangeNotification</code>
 *  that will be passed
 *
 * @exception MBeanException if an object initializer throws an
 *  exception
 * @exception RuntimeOperationsException wraps IllegalArgumentException
 *  when the specified notification is <code>null</code> or invalid
 */
@Override
public void sendAttributeChangeNotification
    (AttributeChangeNotification notification)
    throws MBeanException, RuntimeOperationsException {

    if (notification == null)
        throw new RuntimeOperationsException
            (new IllegalArgumentException("Notification is null"),
             "Notification is null");
    if (attributeBroadcaster == null)
        return; // This means there are no registered listeners
    if( log.isDebugEnabled() )
        log.debug( "AttributeChangeNotification " + notification );
    attributeBroadcaster.sendNotification(notification);

}
 
源代码24 项目: jdk8u60   文件: CommunicatorServer.java
/**
 * Returns an array of MBeanNotificationInfo objects describing
 * the notification types sent by this CommunicatorServer.
 * There is only one type of notifications sent by the CommunicatorServer:
 * it is <tt>{@link javax.management.AttributeChangeNotification}</tt>,
 * sent when the <tt>State</tt> attribute of this CommunicatorServer
 * changes.
 */
@Override
public MBeanNotificationInfo[] getNotificationInfo() {

    // Initialize notifInfos on first call to getNotificationInfo()
    //
    if (notifInfos == null) {
        notifInfos = new MBeanNotificationInfo[1];
        String[] notifTypes = {
            AttributeChangeNotification.ATTRIBUTE_CHANGE};
        notifInfos[0] = new MBeanNotificationInfo( notifTypes,
                 AttributeChangeNotification.class.getName(),
                 "Sent to notify that the value of the State attribute "+
                 "of this CommunicatorServer instance has changed.");
    }

    return notifInfos.clone();
}
 
源代码25 项目: openjdk-jdk8u-backup   文件: SimpleStandard.java
/**
 * Operation: reset to their initial values the "State" and "NbChanges"
 * attributes of the "SimpleStandard" standard MBean.
 */
public void reset() {
    checkSubject();
    AttributeChangeNotification acn =
        new AttributeChangeNotification(this,
                                        0,
                                        0,
                                        "NbChanges reset",
                                        "NbChanges",
                                        "Integer",
                                        new Integer(nbChanges),
                                        new Integer(0));
    state = "initial state";
    nbChanges = 0;
    nbResets++;
    sendNotification(acn);
}
 
源代码26 项目: jdk8u60   文件: SimpleStandard.java
/**
 * Operation: reset to their initial values the "State" and "NbChanges"
 * attributes of the "SimpleStandard" standard MBean.
 */
public void reset() {
    checkSubject();
    AttributeChangeNotification acn =
        new AttributeChangeNotification(this,
                                        0,
                                        0,
                                        "NbChanges reset",
                                        "NbChanges",
                                        "Integer",
                                        new Integer(nbChanges),
                                        new Integer(0));
    state = "initial state";
    nbChanges = 0;
    nbResets++;
    sendNotification(acn);
}
 
源代码27 项目: wildfly-core   文件: MBeanInfoFactory.java
private MBeanNotificationInfo[] getNotifications() {
    List<MBeanNotificationInfo> notifications = new ArrayList<>();
    for (Map.Entry<String, NotificationEntry> entry : resourceRegistration.getNotificationDescriptions(PathAddress.EMPTY_ADDRESS, true).entrySet()) {
        ModelNode descriptionModel = entry.getValue().getDescriptionProvider().getModelDescription(null);
        String description = descriptionModel.get(DESCRIPTION).asString();
        String notificationType = entry.getKey();
        MBeanNotificationInfo info = null;
        if (notificationType.equals(ModelDescriptionConstants.ATTRIBUTE_VALUE_WRITTEN_NOTIFICATION)) {
            info = new MBeanNotificationInfo(new String[]{AttributeChangeNotification.ATTRIBUTE_CHANGE}, AttributeChangeNotification.class.getName(), description);
        } else if (notificationType.equals(ModelDescriptionConstants.RESOURCE_ADDED_NOTIFICATION)
                || notificationType.equals(ModelDescriptionConstants.RESOURCE_REMOVED_NOTIFICATION)) {
            // do not expose these notifications as they are emitted by the JMImplementation:type=MBeanServerDelegate MBean.
        } else {
            info = new MBeanNotificationInfo(new String[]{notificationType}, Notification.class.getName(), description);
        }
        if (info != null) {
            notifications.add(info);
        }
    }
    return notifications.toArray(new MBeanNotificationInfo[notifications.size()]);
}
 
源代码28 项目: JDKSourceCode1.8   文件: CommunicatorServer.java
/**
 * Returns an array of MBeanNotificationInfo objects describing
 * the notification types sent by this CommunicatorServer.
 * There is only one type of notifications sent by the CommunicatorServer:
 * it is <tt>{@link javax.management.AttributeChangeNotification}</tt>,
 * sent when the <tt>State</tt> attribute of this CommunicatorServer
 * changes.
 */
@Override
public MBeanNotificationInfo[] getNotificationInfo() {

    // Initialize notifInfos on first call to getNotificationInfo()
    //
    if (notifInfos == null) {
        notifInfos = new MBeanNotificationInfo[1];
        String[] notifTypes = {
            AttributeChangeNotification.ATTRIBUTE_CHANGE};
        notifInfos[0] = new MBeanNotificationInfo( notifTypes,
                 AttributeChangeNotification.class.getName(),
                 "Sent to notify that the value of the State attribute "+
                 "of this CommunicatorServer instance has changed.");
    }

    return notifInfos.clone();
}
 
源代码29 项目: jdk8u-dev-jdk   文件: CommunicatorServer.java
/**
 * Returns an array of MBeanNotificationInfo objects describing
 * the notification types sent by this CommunicatorServer.
 * There is only one type of notifications sent by the CommunicatorServer:
 * it is <tt>{@link javax.management.AttributeChangeNotification}</tt>,
 * sent when the <tt>State</tt> attribute of this CommunicatorServer
 * changes.
 */
@Override
public MBeanNotificationInfo[] getNotificationInfo() {

    // Initialize notifInfos on first call to getNotificationInfo()
    //
    if (notifInfos == null) {
        notifInfos = new MBeanNotificationInfo[1];
        String[] notifTypes = {
            AttributeChangeNotification.ATTRIBUTE_CHANGE};
        notifInfos[0] = new MBeanNotificationInfo( notifTypes,
                 AttributeChangeNotification.class.getName(),
                 "Sent to notify that the value of the State attribute "+
                 "of this CommunicatorServer instance has changed.");
    }

    return notifInfos.clone();
}
 
源代码30 项目: openjdk-jdk8u   文件: ScanManager.java
/**
 * Enqueue a state changed notification for the given states.
 **/
private void queueStateChangedNotification(
                long sequence,
                long time,
                ScanState old,
                ScanState current) {
    final AttributeChangeNotification n =
            new AttributeChangeNotification(SCAN_MANAGER_NAME,sequence,time,
            "ScanManager State changed to "+current,"State",
            ScanState.class.getName(),old.toString(),current.toString());
    // Queue the notification. We have created an unlimited queue, so
    // this method should always succeed.
    try {
        if (!pendingNotifs.offer(n,2,TimeUnit.SECONDS)) {
            LOG.fine("Can't queue Notification: "+n);
        }
    } catch (InterruptedException x) {
            LOG.fine("Can't queue Notification: "+x);
    }
}
 
 类所在包
 类方法
 同包方法