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 Details

    • id

      protected final int id
      The internal identifier.
  • Method Details

    • getNotificationInfo

      public MBeanNotificationInfo[] 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:
      getNotificationInfo in interface NotificationBroadcaster
      Returns:
      the array of possible notifications.
    • getLastGcInfo

      public GcInfo getLastGcInfo()
      Returns the GC information about the most recent GC. This method returns a GcInfo. If no GC information is available, null is returned. The collector-specific attributes, if any, can be obtained via the CompositeData interface.

      MBeanServer access: The mapped type of GcInfo is CompositeData with attributes specified in GcInfo.

      Specified by:
      getLastGcInfo in interface GarbageCollectorMXBean
      Returns:
      a GcInfo object representing the most GC information; or null if 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:
      getCollectionCount in interface GarbageCollectorMXBean
      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:
      getCollectionTime in interface GarbageCollectorMXBean
      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

      public final String 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, and handback parameters. If there is more than one such listener, only one is removed.

      The filter and handback parameters may be null if and only if they are null in a listener to be removed.

      Specified by:
      removeNotificationListener in interface NotificationEmitter
      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:
      addNotificationListener in interface NotificationBroadcaster
      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:
      removeNotificationListener in interface NotificationBroadcaster
      Parameters:
      listener - A listener that was previously added to this MBean.
      Throws:
      ListenerNotFoundException - The listener is not registered with the MBean.
      See Also:
    • sendNotification

      public final void sendNotification(Notification notification)
      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 a CompositeData instance that represents a GarbageCollectionNotificationInfo object
    • addMemoryPool

      protected void addMemoryPool(MemoryPoolMXBean poolBean)
      add managed pool for this bean
      Parameters:
      poolBean - managed pool bean
    • getMemoryPoolNames

      public String[] getMemoryPoolNames()
      Returns the names of all of the memory pools managed by this MXBean.
      Specified by:
      getMemoryPoolNames in interface MemoryManagerMXBean
      Returns:
      string array containing the names of all of the managed memory pools.
    • getName

      public String getName()
      Returns the name of this particular memory manager.
      Specified by:
      getName in interface MemoryManagerMXBean
      Returns:
      the name of this memory manager.
    • isValid

      public boolean isValid()
      Returns true if 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:
      isValid in interface MemoryManagerMXBean
      Returns:
      true if the memory manager is still valid in the virtual machine ; otherwise false.
    • getObjectName

      public ObjectName getObjectName()
      Returns an ObjectName instance representing the object name of this platform managed object.
      Specified by:
      getObjectName in interface PlatformManagedObject
      Returns:
      an ObjectName instance representing the object name of this platform managed object.