java.lang.Object
com.ibm.java.lang.management.internal.OperatingSystemMXBeanImpl
com.ibm.lang.management.internal.ExtendedOperatingSystemMXBeanImpl
com.ibm.lang.management.internal.UnixExtendedOperatingSystem
- All Implemented Interfaces:
OperatingSystemMXBean
,UnixOperatingSystemMXBean
,OperatingSystemMXBean
,UnixOperatingSystemMXBean
,OperatingSystemMXBean
,PlatformManagedObject
,NotificationBroadcaster
,NotificationEmitter
public final class UnixExtendedOperatingSystem
extends ExtendedOperatingSystemMXBeanImpl
implements UnixOperatingSystemMXBean
-
Method Summary
Modifier and TypeMethodDescriptionvoid
addNotificationListener
(NotificationListener listener, NotificationFilter filter, Object handback) Adds a listener to this MBean.static UnixExtendedOperatingSystem
long
Returns the maximum number of file descriptors that can be opened in a process.long
Returns the current number of file descriptors that are in opened state.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.Methods declared in class com.ibm.lang.management.internal.ExtendedOperatingSystemMXBeanImpl
getCommittedVirtualMemorySize, getCpuLoad, getFreeMemorySize, getFreeSwapSpaceSize, getHardwareModel, getNotificationInfo, getProcessCpuLoad, getProcessCpuTime, getProcessCpuTimeByNS, getProcessingCapacity, getProcessPhysicalMemorySize, getProcessPrivateMemorySize, getProcessVirtualMemorySize, getTotalMemorySize, getTotalPhysicalMemory, getTotalSwapSpaceSize, isHardwareEmulated, isProcessRunning, retrieveMemoryUsage, retrieveMemoryUsage, retrieveProcessorUsage, retrieveProcessorUsage, retrieveTotalProcessorUsage, retrieveTotalProcessorUsage
Methods declared in class com.ibm.java.lang.management.internal.OperatingSystemMXBeanImpl
getArch, getAvailableProcessors, getName, getObjectName, getSystemLoadAverage, getVersion
Methods declared in class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods declared in interface com.ibm.lang.management.OperatingSystemMXBean
getCommittedVirtualMemorySize, getFreeSwapSpaceSize, getHardwareModel, getProcessCpuLoad, getProcessCpuTime, getProcessCpuTimeByNS, getProcessingCapacity, getProcessPhysicalMemorySize, getProcessPrivateMemorySize, getProcessVirtualMemorySize, getTotalPhysicalMemory, getTotalSwapSpaceSize, isHardwareEmulated, isProcessRunning, retrieveMemoryUsage, retrieveMemoryUsage, retrieveProcessorUsage, retrieveProcessorUsage, retrieveTotalProcessorUsage, retrieveTotalProcessorUsage
Methods declared in interface com.sun.management.OperatingSystemMXBean
getCpuLoad, getFreeMemorySize, getFreePhysicalMemorySize, getSystemCpuLoad, getTotalMemorySize, getTotalPhysicalMemorySize
Methods declared in interface java.lang.management.OperatingSystemMXBean
getArch, getAvailableProcessors, getName, getSystemLoadAverage, getVersion
Methods declared in interface java.lang.management.PlatformManagedObject
getObjectName
-
Method Details
-
getInstance
-
getMaxFileDescriptorCount
public long getMaxFileDescriptorCount()Returns the maximum number of file descriptors that can be opened in a process.- Specified by:
getMaxFileDescriptorCount
in interfaceUnixOperatingSystemMXBean
- Specified by:
getMaxFileDescriptorCount
in interfaceUnixOperatingSystemMXBean
- Returns:
- The maximum number of file descriptors that can be opened in a process or -1, if an error occurred while obtaining this. If the operating system doesn't have any limits configured, Long.MAX_VALUE is returned.
-
getOpenFileDescriptorCount
public long getOpenFileDescriptorCount()Returns the current number of file descriptors that are in opened state.- Specified by:
getOpenFileDescriptorCount
in interfaceUnixOperatingSystemMXBean
- Specified by:
getOpenFileDescriptorCount
in interfaceUnixOperatingSystemMXBean
- Returns:
- The current number of file descriptors that are in opened state or -1, if an error occurred while obtaining this.
-
addNotificationListener
public 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:
-
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.
-
sendNotification
Send notifications to registered listeners.- Parameters:
notification
- a notification to be sent
-