Class ExtendedGarbageCollectorMXBeanImpl
- All Implemented Interfaces:
GarbageCollectorMXBean, GarbageCollectorMXBean, GarbageCollectorMXBean, MemoryManagerMXBean, PlatformManagedObject, NotificationBroadcaster, NotificationEmitter
GarbageCollectorMXBean.-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionprotected voidaddMemoryPool(MemoryPoolMXBean poolBean) add managed pool for this beanfinal voidaddNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) Adds a listener to this MBean.final longTo satisfy com.ibm.lang.management.GarbageCollectorMXBean.final longReturns the total number of collections that have occurred.final longReturns the approximate accumulated collection elapsed time in milliseconds.final longTo satisfy com.ibm.lang.management.GarbageCollectorMXBean.final longTo satisfy com.ibm.lang.management.GarbageCollectorMXBean.Returns the GC information about the most recent GC.String[]Returns the name of memory pools that this memory manager manages.final longTo satisfy com.ibm.lang.management.GarbageCollectorMXBean.getName()Returns the name representing this memory manager.Returns an array indicating, for each notification this MBean may send, the name of the Java class of the notification and the notification type.Returns anObjectNameinstance representing the object name of this platform managed object.final StringTODO Was this intended to be exposed in com.ibm.lang.management.GarbageCollectorMXBean?final longTo satisfy com.ibm.lang.management.GarbageCollectorMXBean.final longTo satisfy com.ibm.lang.management.GarbageCollectorMXBean.booleanisValid()Tests if this memory manager is valid in the Java virtual machine.final voidRemoves a listener from this MBean.final voidremoveNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) Removes a listener from this MBean.final voidsendNotification(Notification notification) Send notifications to registered listeners.voidsetAllocatedHeapSizeTarget(long size) To satisfy com.ibm.lang.management.GarbageCollectorMXBean.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods declared in interface GarbageCollectorMXBean
getLastCollectionEndTime, getLastCollectionStartTime, getMemoryUsed, getTotalCompacts, getTotalMemoryFreedModifier and TypeMethodDescriptionlongReturns the end time in milliseconds of the last garbage collection that was carried out by this collector.longReturns the start time in milliseconds of the last garbage collection that was carried out by this collector.longReturns the amount of heap memory used by objects that are managed by the collector corresponding to this bean object.longReturns the cumulative total number of compacts that was performed by garbage collector corresponding to this bean object.longReturns the cumulative total amount of memory freed, in bytes, by the garbage collector corresponding to this bean object.
-
Field Details
-
id
protected final int idThe internal identifier.
-
-
Method Details
-
getNotificationInfo
Returns an array indicating, for each notification this MBean may send, the name of the Java class of the notification and the notification type.
It is not illegal for the MBean to send notifications not described in this array. However, some clients of the MBean server may depend on the array being complete for their correct functioning.
- Specified by:
getNotificationInfoin interfaceNotificationBroadcaster- Returns:
- the array of possible notifications.
-
getLastGcInfo
Returns the GC information about the most recent GC. This method returns aGcInfo. If no GC information is available,nullis returned. The collector-specific attributes, if any, can be obtained via theCompositeDatainterface.MBeanServer access: The mapped type of
GcInfoisCompositeDatawith attributes specified inGcInfo.- Specified by:
getLastGcInfoin interfaceGarbageCollectorMXBean- Returns:
- a
GcInfoobject representing the most GC information; ornullif no GC information available.
-
getCollectionCount
public final long getCollectionCount()Returns the total number of collections that have occurred. This method returns-1if the collection count is undefined for this collector.- Specified by:
getCollectionCountin interfaceGarbageCollectorMXBean- Returns:
- the total number of collections that have occurred.
-
getCollectionTime
public final long getCollectionTime()Returns the approximate accumulated collection elapsed time in milliseconds. This method returns-1if the collection elapsed time is undefined for this collector.The Java virtual machine implementation may use a high resolution timer to measure the elapsed time. This method may return the same value even if the collection count has been incremented if the collection elapsed time is very short.
- Specified by:
getCollectionTimein interfaceGarbageCollectorMXBean- Returns:
- the approximate accumulated collection elapsed time in milliseconds.
-
getLastCollectionStartTime
public final long getLastCollectionStartTime()To satisfy com.ibm.lang.management.GarbageCollectorMXBean. -
getLastCollectionEndTime
public final long getLastCollectionEndTime()To satisfy com.ibm.lang.management.GarbageCollectorMXBean. -
getMemoryUsed
public final long getMemoryUsed()To satisfy com.ibm.lang.management.GarbageCollectorMXBean. -
getTotalMemoryFreed
public final long getTotalMemoryFreed()To satisfy com.ibm.lang.management.GarbageCollectorMXBean. -
getTotalCompacts
public final long getTotalCompacts()To satisfy com.ibm.lang.management.GarbageCollectorMXBean. -
getAllocatedHeapSizeTarget
public final long getAllocatedHeapSizeTarget()To satisfy com.ibm.lang.management.GarbageCollectorMXBean. -
setAllocatedHeapSizeTarget
public void setAllocatedHeapSizeTarget(long size) To satisfy com.ibm.lang.management.GarbageCollectorMXBean. -
getStrategy
TODO Was this intended to be exposed in com.ibm.lang.management.GarbageCollectorMXBean? -
removeNotificationListener
public final void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException Removes a listener from this MBean. The MBean must have a listener that exactly matches the given
listener,filter, andhandbackparameters. If there is more than one such listener, only one is removed.The
filterandhandbackparameters may be null if and only if they are null in a listener to be removed.- Specified by:
removeNotificationListenerin interfaceNotificationEmitter- Parameters:
listener- A listener that was previously added to this MBean.filter- The filter that was specified when the listener was added.handback- The handback that was specified when the listener was added.- Throws:
ListenerNotFoundException- The listener is not registered with the MBean, or it is not registered with the given filter and handback.
-
addNotificationListener
public final void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws IllegalArgumentException Adds a listener to this MBean.- Specified by:
addNotificationListenerin interfaceNotificationBroadcaster- Parameters:
listener- The listener object which will handle the notifications emitted by the broadcaster.filter- The filter object. If filter is null, no filtering will be performed before handling notifications.handback- An opaque object to be sent back to the listener when a notification is emitted. This object cannot be used by the Notification broadcaster object. It should be resent unchanged with the notification to the listener.- Throws:
IllegalArgumentException- Listener parameter is null.- See Also:
-
removeNotificationListener
public final void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException Removes a listener from this MBean. If the listener has been registered with different handback objects or notification filters, all entries corresponding to the listener will be removed.- Specified by:
removeNotificationListenerin interfaceNotificationBroadcaster- Parameters:
listener- A listener that was previously added to this MBean.- Throws:
ListenerNotFoundException- The listener is not registered with the MBean.- See Also:
-
sendNotification
Send notifications to registered listeners. This will be called at the end of Garbage Collections.- Parameters:
notification- For this type of bean the user data will consist of aCompositeDatainstance that represents aGarbageCollectionNotificationInfoobject
-
addMemoryPool
add managed pool for this bean- Parameters:
poolBean- managed pool bean
-
getMemoryPoolNames
Returns the name of memory pools that this memory manager manages.- Specified by:
getMemoryPoolNamesin interfaceMemoryManagerMXBean- Returns:
- an array of
Stringobjects, each is the name of a memory pool that this memory manager manages.
-
getName
Returns the name representing this memory manager.- Specified by:
getNamein interfaceMemoryManagerMXBean- Returns:
- the name of this memory manager.
-
isValid
public boolean isValid()Tests if this memory manager is valid in the Java virtual machine. A memory manager becomes invalid once the Java virtual machine removes it from the memory system.- Specified by:
isValidin interfaceMemoryManagerMXBean- Returns:
trueif the memory manager is valid in the Java virtual machine;falseotherwise.
-
getObjectName
Returns anObjectNameinstance representing the object name of this platform managed object.- Specified by:
getObjectNamein interfacePlatformManagedObject- Returns:
- an
ObjectNameinstance representing the object name of this platform managed object.
-