|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface NotificationService
Provides enhanced abilities for working with Notifications. Listens to other MBeans (as configured) and collects the Notifications which can later be retrieved by calling takeNotifications(). The listening is quite powerful; both "listen to" and "don't listen to" ObjectNames or ObjectName patterns may be specified, and are dynamically maintained.
All received Notifications are resent to all listeners on this MBean. This makes it possible to listen to a single MBean for all "interesting" Notifications across many different MBeans, even if these MBeans are dynamically registered and unregistered.
Buffering is also available, via a named buffer facility. Creation of a buffer together with an optional filter allows a caller to buffer Notifications of interest which can later be retrieved as a batch. This facility may be of particular use for clients which disconnect and reconnect.
When a buffer overflows, a notification of type BUFFER_OVERFLOW_NOTIFICATION_TYPE is emitted
Field Summary | |
---|---|
static String |
BUFFER_OVERFLOW_NOTIFICATION_TYPE
When the buffer overflows this Notification is issued. |
static String |
J2EE_TYPE
The j2eeType as returned by AMX.getJ2EEType() . |
static String |
NEXT_SEQUENCE_NUMBER_KEY
Key within the Map returned by getNotifications() that yields the Long for the next sequence number. |
static String |
NOTIFICATIONS_KEY
Key within the Map returned by getNotifications() that yields the Notifications[]. |
static String |
OVERFLOWED_NOTIFICATION_KEY
Key for accessing the overwritten Notification with the Notification of type BUFFER_OVERFLOW_NOTIFICATION_TYPE. |
Fields inherited from interface com.sun.appserv.management.base.AMX |
---|
FULL_TYPE_DELIM, GROUP_CONFIGURATION, GROUP_JSR77, GROUP_MONITORING, GROUP_OTHER, GROUP_UTILITY, J2EE_TYPE_KEY, JMX_DOMAIN, NAME_KEY, NO_NAME, NOTIFICATION_PREFIX, NULL_NAME |
Method Summary | |
---|---|
Object |
createBuffer(int bufferSize,
NotificationFilter filter)
Create a new buffer of the specified size. |
void |
dontListenTo(ObjectName objectName)
Stop listening for Notifications on the specified . |
Map<String,Object> |
getBufferNotifications(Object bufferID,
long sequenceNumberIn)
Get all outstanding Notifications which have a sequence number that is equal to or greater than the specified one. |
NotificationFilter |
getFilter(ObjectName objectName)
Get the filter being used for a particular . |
Set<ObjectName> |
getListeneeSet()
Get the MBeans to which this service listens. |
Object |
getUserData()
The user data supplied when the instance was created. |
void |
listenTo(ObjectName pattern,
NotificationFilter filter)
Listen for Notifications from an using the specified filter, which may be null, in which case all Notifications are heard. |
void |
removeBuffer(Object id)
Remove the specified buffer. |
Methods inherited from interface com.sun.appserv.management.base.AMX |
---|
getContainer, getDomainRoot, getFullType, getGroup, getJ2EEType, getName, isDAS |
Methods inherited from interface javax.management.NotificationEmitter |
---|
removeNotificationListener |
Methods inherited from interface javax.management.NotificationBroadcaster |
---|
addNotificationListener, getNotificationInfo, removeNotificationListener |
Methods inherited from interface com.sun.appserv.management.base.AMXMBeanLogging |
---|
getMBeanLoggerName, getMBeanLogLevel, setMBeanLogLevel |
Methods inherited from interface javax.management.NotificationListener |
---|
handleNotification |
Field Detail |
---|
static final String J2EE_TYPE
AMX.getJ2EEType()
.
static final String BUFFER_OVERFLOW_NOTIFICATION_TYPE
static final String OVERFLOWED_NOTIFICATION_KEY
static final String NEXT_SEQUENCE_NUMBER_KEY
static final String NOTIFICATIONS_KEY
Method Detail |
---|
Object getUserData()
void listenTo(ObjectName pattern, NotificationFilter filter) throws InstanceNotFoundException
Note that Notifications may also be manually forced into the service by calling handlingNotification().
pattern
- name of to listen tofilter
-
InstanceNotFoundException
void dontListenTo(ObjectName objectName) throws InstanceNotFoundException
objectName
- name of which should no longer be listened to.
InstanceNotFoundException
NotificationFilter getFilter(ObjectName objectName)
objectName
-
Object createBuffer(int bufferSize, NotificationFilter filter)
bufferSize
- maximum number of Notifications to be bufferedfilter
- filter for Notifications to be buffered
void removeBuffer(Object id)
Map<String,Object> getBufferNotifications(Object bufferID, long sequenceNumberIn)
Notifications are never removed from the buffer; be sure to use the returned sequence number as a means of fetching new Notifications.
The Map is keyed by the following:
Set<ObjectName> getListeneeSet()
|
Java EE 5 SDK | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 2006 Sun Microsystems, Inc. All rights reserved.