KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > jmx > remote > internal > NotificationBuffer


1 /*
2  * @(#)NotificationBuffer.java 1.5 05/08/31
3  *
4  * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
5  * SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
6  */

7
8 package com.sun.jmx.remote.internal;
9
10 import java.util.Set JavaDoc;
11 import javax.management.remote.NotificationResult JavaDoc;
12 import javax.management.remote.TargetedNotification JavaDoc;
13
14 /** A buffer of notifications received from an MBean server. */
15 public interface NotificationBuffer {
16     /**
17      * <p>Fetch notifications that match the given listeners.</p>
18      *
19      * <p>The operation only considers notifications with a sequence
20      * number at least <code>startSequenceNumber</code>. It will take
21      * no longer than <code>timeout</code>, and will return no more
22      * than <code>maxNotifications</code> different notifications.</p>
23      *
24      * <p>If there are no notifications matching the criteria, the
25      * operation will block until one arrives, subject to the
26      * timeout.</p>
27      *
28      * @param listeners a Set of {@link ListenerInfo} that reflects
29      * the filters to be applied to notifications. Accesses to this
30      * Set are synchronized on the Set object. The Set is consulted
31      * for selected notifications that are present when the method
32      * starts, and for selected notifications that arrive while it is
33      * executing. The contents of the Set can be modified, with
34      * appropriate synchronization, while the method is running.
35      * @param startSequenceNumber the first sequence number to
36      * consider.
37      * @param timeout the maximum time to wait. May be 0 to indicate
38      * not to wait if there are no notifications.
39      * @param maxNotifications the maximum number of notifications to
40      * return. May be 0 to indicate a wait for eligible notifications
41      * that will return a usable <code>nextSequenceNumber</code>. The
42      * {@link TargetedNotification} array in the returned {@link
43      * NotificationResult} may contain more than this number of
44      * elements but will not contain more than this number of
45      * different notifications.
46      */

47     public NotificationResult JavaDoc
48         fetchNotifications(Set JavaDoc<ListenerInfo> listeners,
49                            long startSequenceNumber,
50                            long timeout,
51                            int maxNotifications)
52             throws InterruptedException JavaDoc;
53
54     /**
55      * <p>Discard this buffer.</p>
56      */

57     public void dispose();
58 }
59
Popular Tags