APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.jmx.remote.internal

public Class ArrayNotificationBuffer

extends Object
implements NotificationBuffer
Class Inheritance
All Implemented Interfaces
com.sun.jmx.remote.internal.NotificationBuffer
Imports
java.util.ArrayList, .Collection, .Collections, .HashSet, .List, .Set, .HashMap, .Map, javax.management.InstanceNotFoundException, .MBeanServer, .MBeanServerDelegate, .MBeanServerNotification, .Notification, .NotificationBroadcaster, .NotificationFilter, .NotificationFilterSupport, .NotificationListener, .ObjectName, .QueryEval, .QueryExp, javax.management.remote.NotificationResult, .TargetedNotification, com.sun.jmx.remote.util.EnvHelp, .ClassLogger

A circular buffer of notifications received from an MBean server.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
private class
private static class
private class

Field Summary

Modifier and TypeField and Description
pack-priv static final String
private static final QueryExp
private final NotificationListener
private Set<ObjectName>
private static final NotificationFilter
private final NotificationListener
private boolean
private long
private static final Object
private static final ClassLogger
private final MBeanServer
private static final HashMap<MBeanServer, ArrayNotificationBuffer>
private long
private final ArrayQueue<ArrayNotificationBuffer.NamedNotification>
private int
private final Collection<ArrayNotificationBuffer.ShareBuffer>

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private void
pack-priv synchronized void
private void
addNotificationListener(final ObjectName name, final NotificationListener listener, final NotificationFilter filter, final Object handback)

pack-priv void
private void
private void
private void
private void
public void
private void
pack-priv synchronized long
public NotificationResult
fetchNotifications(NotificationBufferFilter
an object that will add notifications to a List<TargetedNotification> if they match the current listeners with their filters.
filter
,
long
the first sequence number to consider.
startSequenceNumber
,
long
the maximum time to wait. May be 0 to indicate not to wait if there are no notifications.
timeout
,
int
the maximum number of notifications to return. May be 0 to indicate a wait for eligible notifications that will return a usable nextSequenceNumber. The TargetedNotification array in the returned NotificationResult may contain more than this number of elements but will not contain more than this number of different notifications.
maxNotifications
)

Implements com.sun.jmx.remote.internal.NotificationBuffer.fetchNotifications.

Fetch notifications that match the given listeners.

public static NotificationBuffer
private synchronized boolean
private static boolean
isInstanceOf(final MBeanServer mbs, final ObjectName name, final String className)

pack-priv synchronized long
pack-priv synchronized ArrayNotificationBuffer.NamedNotification
notificationAt(long seqNo)

private Set<ObjectName>
queryNames(final ObjectName name, final QueryExp query)

private void
pack-priv static void
private void
private void
private synchronized void
resize(int newSize)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

broadcasterClassback to summary
pack-priv static final String broadcasterClass
broadcasterQueryback to summary
private static final QueryExp broadcasterQuery
bufferListenerback to summary
private final NotificationListener bufferListener
createdDuringQueryback to summary
private Set<ObjectName> createdDuringQuery
creationFilterback to summary
private static final NotificationFilter creationFilter
creationListenerback to summary
private final NotificationListener creationListener
disposedback to summary
private boolean disposed
earliestSequenceNumberback to summary
private long earliestSequenceNumber
globalLockback to summary
private static final Object globalLock
loggerback to summary
private static final ClassLogger logger
mBeanServerback to summary
private final MBeanServer mBeanServer
mbsToBufferback to summary
private static final HashMap<MBeanServer, ArrayNotificationBuffer> mbsToBuffer
nextSequenceNumberback to summary
private long nextSequenceNumber
queueback to summary
private final ArrayQueue<ArrayNotificationBuffer.NamedNotification> queue
queueSizeback to summary
private int queueSize
sharersback to summary
private final Collection<ArrayNotificationBuffer.ShareBuffer> sharers

Constructor Detail

ArrayNotificationBufferback to summary
private ArrayNotificationBuffer(MBeanServer mbs, int queueSize)

Method Detail

addBufferListenerback to summary
private void addBufferListener(ObjectName name)
addNotificationback to summary
pack-priv synchronized void addNotification(ArrayNotificationBuffer.NamedNotification notif)
addNotificationListenerback to summary
private void addNotificationListener(final ObjectName name, final NotificationListener listener, final NotificationFilter filter, final Object handback) throws Exception
addSharerback to summary
pack-priv void addSharer(ArrayNotificationBuffer.ShareBuffer sharer)
checkNoLocksback to summary
private void checkNoLocks()
createdNotificationback to summary
private void createdNotification(MBeanServerNotification n)
createListenersback to summary
private void createListeners()
destroyListenersback to summary
private void destroyListeners()
disposeback to summary
public void dispose()

Implements com.sun.jmx.remote.internal.NotificationBuffer.dispose.

Doc from com.sun.jmx.remote.internal.NotificationBuffer.dispose.

Discard this buffer.

dropNotificationback to summary
private void dropNotification()
earliestSequenceNumberback to summary
pack-priv synchronized long earliestSequenceNumber()
fetchNotificationsback to summary
public NotificationResult fetchNotifications(NotificationBufferFilter filter, long startSequenceNumber, long timeout, int maxNotifications) throws InterruptedException

Implements com.sun.jmx.remote.internal.NotificationBuffer.fetchNotifications.

Fetch notifications that match the given listeners.

The operation only considers notifications with a sequence number at least startSequenceNumber. It will take no longer than timeout, and will return no more than maxNotifications different notifications.

If there are no notifications matching the criteria, the operation will block until one arrives, subject to the timeout.

Parameters
filter:NotificationBufferFilter

an object that will add notifications to a List<TargetedNotification> if they match the current listeners with their filters.

startSequenceNumber:long

the first sequence number to consider.

timeout:long

the maximum time to wait. May be 0 to indicate not to wait if there are no notifications.

maxNotifications:int

the maximum number of notifications to return. May be 0 to indicate a wait for eligible notifications that will return a usable nextSequenceNumber. The TargetedNotification array in the returned NotificationResult may contain more than this number of elements but will not contain more than this number of different notifications.

getNotificationBufferback to summary
public static NotificationBuffer getNotificationBuffer(MBeanServer mbs, Map<String, ?> env)
isDisposedback to summary
private synchronized boolean isDisposed()
isInstanceOfback to summary
private static boolean isInstanceOf(final MBeanServer mbs, final ObjectName name, final String className)
nextSequenceNumberback to summary
pack-priv synchronized long nextSequenceNumber()
notificationAtback to summary
pack-priv synchronized ArrayNotificationBuffer.NamedNotification notificationAt(long seqNo)
queryNamesback to summary
private Set<ObjectName> queryNames(final ObjectName name, final QueryExp query)
removeBufferListenerback to summary
private void removeBufferListener(ObjectName name)
removeNotificationBufferback to summary
pack-priv static void removeNotificationBuffer(MBeanServer mbs)
removeNotificationListenerback to summary
private void removeNotificationListener(final ObjectName name, final NotificationListener listener) throws Exception
removeSharerback to summary
private void removeSharer(ArrayNotificationBuffer.ShareBuffer sharer)
resizeback to summary
private synchronized void resize(int newSize)
com.sun.jmx.remote.internal back to summary

private Class ArrayNotificationBuffer.BroadcasterQuery

extends QueryEval
implements QueryExp
Class Inheritance
All Implemented Interfaces
javax.management.QueryExp, java.io.Serializable

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public boolean
apply(final ObjectName name)

Implements javax.management.QueryExp.apply.

Applies the QueryExp on an MBean.

Inherited from javax.management.QueryEval:
getMBeanServersetMBeanServer

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides javax.management.QueryEval.serialVersionUID.

Constructor Detail

BroadcasterQueryback to summary
private BroadcasterQuery()

Method Detail

applyback to summary
public boolean apply(final ObjectName name)

Implements javax.management.QueryExp.apply.

Doc from javax.management.QueryExp.apply.

Applies the QueryExp on an MBean.

com.sun.jmx.remote.internal back to summary

private Class ArrayNotificationBuffer.BufferListener

extends Object
implements NotificationListener
Class Inheritance
  • java.lang.Object
  • com.sun.jmx.remote.internal.ArrayNotificationBuffer.BufferListener
All Implemented Interfaces
javax.management.NotificationListener, java.util.EventListener

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
handleNotification(Notification notif, Object handback)

Implements javax.management.NotificationListener.handleNotification.

Invoked when a JMX notification occurs.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

BufferListenerback to summary
private BufferListener()

Method Detail

handleNotificationback to summary
public void handleNotification(Notification notif, Object handback)

Implements javax.management.NotificationListener.handleNotification.

Doc from javax.management.NotificationListener.handleNotification.

Invoked when a JMX notification occurs. The implementation of this method should return as soon as possible, to avoid blocking its notification broadcaster.

com.sun.jmx.remote.internal back to summary

private Class ArrayNotificationBuffer.NamedNotification

extends Object
Class Inheritance
  • java.lang.Object
  • com.sun.jmx.remote.internal.ArrayNotificationBuffer.NamedNotification

Field Summary

Modifier and TypeField and Description
private final Notification
private final ObjectName

Constructor Summary

AccessConstructor and Description
pack-priv

Method Summary

Modifier and TypeMethod and Description
pack-priv Notification
pack-priv ObjectName
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

notificationback to summary
private final Notification notification
senderback to summary
private final ObjectName sender

Constructor Detail

NamedNotificationback to summary
pack-priv NamedNotification(ObjectName sender, Notification notif)

Method Detail

getNotificationback to summary
pack-priv Notification getNotification()
getObjectNameback to summary
pack-priv ObjectName getObjectName()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

com.sun.jmx.remote.internal back to summary

private Class ArrayNotificationBuffer.ShareBuffer

extends Object
implements NotificationBuffer
Class Inheritance
  • java.lang.Object
  • com.sun.jmx.remote.internal.ArrayNotificationBuffer.ShareBuffer
All Implemented Interfaces
com.sun.jmx.remote.internal.NotificationBuffer

Field Summary

Modifier and TypeField and Description
private final int

Constructor Summary

AccessConstructor and Description
pack-priv
ShareBuffer(int size)

Method Summary

Modifier and TypeMethod and Description
public void
public NotificationResult
fetchNotifications(NotificationBufferFilter filter, long startSequenceNumber, long timeout, int maxNotifications)

Implements com.sun.jmx.remote.internal.NotificationBuffer.fetchNotifications.

Fetch notifications that match the given listeners.

pack-priv int
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

sizeback to summary
private final int size

Constructor Detail

ShareBufferback to summary
pack-priv ShareBuffer(int size)

Method Detail

disposeback to summary
public void dispose()

Implements com.sun.jmx.remote.internal.NotificationBuffer.dispose.

Doc from com.sun.jmx.remote.internal.NotificationBuffer.dispose.

Discard this buffer.

fetchNotificationsback to summary
public NotificationResult fetchNotifications(NotificationBufferFilter filter, long startSequenceNumber, long timeout, int maxNotifications) throws InterruptedException

Implements com.sun.jmx.remote.internal.NotificationBuffer.fetchNotifications.

Doc from com.sun.jmx.remote.internal.NotificationBuffer.fetchNotifications.

Fetch notifications that match the given listeners.

The operation only considers notifications with a sequence number at least startSequenceNumber. It will take no longer than timeout, and will return no more than maxNotifications different notifications.

If there are no notifications matching the criteria, the operation will block until one arrives, subject to the timeout.

getSizeback to summary
pack-priv int getSize()