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 void
addMemoryPool
(MemoryPoolMXBean poolBean) add managed pool for this beanfinal void
addNotificationListener
(NotificationListener listener, NotificationFilter filter, Object handback) Adds a listener to this MBean.final long
To satisfy com.ibm.lang.management.GarbageCollectorMXBean.final long
Returns in a long the number of garbage collections carried out by the associated collector.final long
For the associated garbage collector, returns the total amount of time in milliseconds that it has spent carrying out garbage collection.final long
To satisfy com.ibm.lang.management.GarbageCollectorMXBean.final long
To 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 long
To 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 anObjectName
instance representing the object name of this platform managed object.final String
TODO Was this intended to be exposed in com.ibm.lang.management.GarbageCollectorMXBean?final long
To satisfy com.ibm.lang.management.GarbageCollectorMXBean.final long
To satisfy com.ibm.lang.management.GarbageCollectorMXBean.boolean
isValid()
Returnstrue
if this memory manager is still valid in the virtual machine.final void
Removes a listener from this MBean.final void
removeNotificationListener
(NotificationListener listener, NotificationFilter filter, Object handback) Removes a listener from this MBean.final void
sendNotification
(Notification notification) Send notifications to registered listeners.void
setAllocatedHeapSizeTarget
(long size) To satisfy com.ibm.lang.management.GarbageCollectorMXBean.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods declared in interface GarbageCollectorMXBean
getLastCollectionEndTime, getLastCollectionStartTime, getMemoryUsed, getTotalCompacts, getTotalMemoryFreed
Methods declared in interface GarbageCollectorMXBean
getCollectionCount, getCollectionTime
Methods declared in interface MemoryManagerMXBean
getMemoryPoolNames, getName, isValid
Methods 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:
getNotificationInfo
in 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,null
is returned. The collector-specific attributes, if any, can be obtained via theCompositeData
interface.MBeanServer access: The mapped type of
GcInfo
isCompositeData
with attributes specified inGcInfo
.- Specified by:
getLastGcInfo
in interfaceGarbageCollectorMXBean
- Returns:
- a
GcInfo
object representing the most GC information; ornull
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 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:
getCollectionTime
in 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
, andhandback
parameters. If there is more than one such listener, only one is removed.The
filter
andhandback
parameters may be null if and only if they are null in a listener to be removed.- Specified by:
removeNotificationListener
in 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:
addNotificationListener
in 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:
removeNotificationListener
in 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 aCompositeData
instance that represents aGarbageCollectionNotificationInfo
object
-
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:
getMemoryPoolNames
in 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:
getName
in interfaceMemoryManagerMXBean
- Returns:
- the name of this memory manager.
-
isValid
public boolean isValid()Returnstrue
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 interfaceMemoryManagerMXBean
- Returns:
true
if the memory manager is still valid in the virtual machine ; otherwisefalse
.
-
getObjectName
Returns anObjectName
instance representing the object name of this platform managed object.- Specified by:
getObjectName
in interfacePlatformManagedObject
- Returns:
- an
ObjectName
instance representing the object name of this platform managed object.
-