Class ExtendedGarbageCollectorMXBeanImpl
java.lang.Object
com.ibm.lang.management.internal.ExtendedGarbageCollectorMXBeanImpl
- All Implemented Interfaces:
GarbageCollectorMXBean, GarbageCollectorMXBean, GarbageCollectorMXBean, MemoryManagerMXBean, PlatformManagedObject, NotificationBroadcaster, NotificationEmitter
public final class ExtendedGarbageCollectorMXBeanImpl
extends Object
implements GarbageCollectorMXBean
Runtime type for
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 in a long the number of garbage collections carried out by the associated collector.final longFor the associated garbage collector, returns the total amount of time in milliseconds that it has spent carrying out garbage collection.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 names of all of the memory pools managed by thisMXBean.final longTo satisfy com.ibm.lang.management.GarbageCollectorMXBean.getName()Returns the name of this particular 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()Returnstrueif this memory manager is still valid in the 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, getTotalMemoryFreedMethods declared in interface GarbageCollectorMXBean
getCollectionCount, getCollectionTimeMethods declared in interface MemoryManagerMXBean
getMemoryPoolNames, getName, isValidMethods declared in interface PlatformManagedObject
getObjectName
-
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 in a long the number of garbage collections carried out by the associated collector.- Specified by:
getCollectionCountin interfaceGarbageCollectorMXBean- Returns:
- the total number of garbage collections that have been carried out by the associated garbage collector.
-
getCollectionTime
public final long getCollectionTime()For the associated garbage collector, returns the total amount of time in milliseconds that it has spent carrying out garbage collection.- Specified by:
getCollectionTimein interfaceGarbageCollectorMXBean- Returns:
- the number of milliseconds that have been spent in performing garbage collection. This is a cumulative figure.
-
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 names of all of the memory pools managed by thisMXBean.- Specified by:
getMemoryPoolNamesin interfaceMemoryManagerMXBean- Returns:
- string array containing the names of all of the managed memory pools.
-
getName
Returns the name of this particular memory manager.- Specified by:
getNamein interfaceMemoryManagerMXBean- Returns:
- the name of this memory manager.
-
isValid
public boolean isValid()Returnstrueif this memory manager is still valid in the virtual machine. That is, the memory manager has not been eliminated from the virtual machine memory.- Specified by:
isValidin interfaceMemoryManagerMXBean- Returns:
trueif the memory manager is still valid in the virtual machine ; otherwisefalse.
-
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.
-