< prev index next >
src/java.management/share/classes/java/lang/management/ThreadMXBean.java
Print this page
*** 158,168 ****
* Some threads included in the returned array
* may have been terminated when this method returns.
*
* @return an array of {@code long}, each is a thread ID.
*
! * @throws java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
*/
public long[] getAllThreadIds();
--- 158,168 ----
* Some threads included in the returned array
* may have been terminated when this method returns.
*
* @return an array of {@code long}, each is a thread ID.
*
! * @throws SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
*/
public long[] getAllThreadIds();
*** 197,207 ****
* with no stack trace, no locked monitor and no synchronizer info;
* {@code null} if the thread of the given ID is not alive or
* it does not exist.
*
* @throws IllegalArgumentException if {@code id <= 0}.
! * @throws java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
*/
public ThreadInfo getThreadInfo(long id);
--- 197,207 ----
* with no stack trace, no locked monitor and no synchronizer info;
* {@code null} if the thread of the given ID is not alive or
* it does not exist.
*
* @throws IllegalArgumentException if {@code id <= 0}.
! * @throws SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
*/
public ThreadInfo getThreadInfo(long id);
*** 235,245 ****
* element of the input array of IDs
* with no stack trace, no locked monitor and no synchronizer info.
*
* @throws IllegalArgumentException if any element in the input array
* {@code ids} is {@code <= 0}.
! * @throws java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
*/
public ThreadInfo[] getThreadInfo(long[] ids);
--- 235,245 ----
* element of the input array of IDs
* with no stack trace, no locked monitor and no synchronizer info.
*
* @throws IllegalArgumentException if any element in the input array
* {@code ids} is {@code <= 0}.
! * @throws SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
*/
public ThreadInfo[] getThreadInfo(long[] ids);
*** 282,292 ****
* {@code null} if the thread of the given ID is not alive or
* it does not exist.
*
* @throws IllegalArgumentException if {@code id <= 0}.
* @throws IllegalArgumentException if {@code maxDepth is negative}.
! * @throws java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
*
*/
public ThreadInfo getThreadInfo(long id, int maxDepth);
--- 282,292 ----
* {@code null} if the thread of the given ID is not alive or
* it does not exist.
*
* @throws IllegalArgumentException if {@code id <= 0}.
* @throws IllegalArgumentException if {@code maxDepth is negative}.
! * @throws SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
*
*/
public ThreadInfo getThreadInfo(long id, int maxDepth);
*** 335,345 ****
* synchronizer info.
*
* @throws IllegalArgumentException if {@code maxDepth is negative}.
* @throws IllegalArgumentException if any element in the input array
* {@code ids} is {@code <= 0}.
! * @throws java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
*
*/
public ThreadInfo[] getThreadInfo(long[] ids, int maxDepth);
--- 335,345 ----
* synchronizer info.
*
* @throws IllegalArgumentException if {@code maxDepth is negative}.
* @throws IllegalArgumentException if any element in the input array
* {@code ids} is {@code <= 0}.
! * @throws SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
*
*/
public ThreadInfo[] getThreadInfo(long[] ids, int maxDepth);
*** 358,368 ****
* Tests if thread contention monitoring is enabled.
*
* @return {@code true} if thread contention monitoring is enabled;
* {@code false} otherwise.
*
! * @throws java.lang.UnsupportedOperationException if the Java virtual
* machine does not support thread contention monitoring.
*
* @see #isThreadContentionMonitoringSupported
*/
public boolean isThreadContentionMonitoringEnabled();
--- 358,368 ----
* Tests if thread contention monitoring is enabled.
*
* @return {@code true} if thread contention monitoring is enabled;
* {@code false} otherwise.
*
! * @throws UnsupportedOperationException if the Java virtual
* machine does not support thread contention monitoring.
*
* @see #isThreadContentionMonitoringSupported
*/
public boolean isThreadContentionMonitoringEnabled();
*** 372,385 ****
* Thread contention monitoring is disabled by default.
*
* @param enable {@code true} to enable;
* {@code false} to disable.
*
! * @throws java.lang.UnsupportedOperationException if the Java
* virtual machine does not support thread contention monitoring.
*
! * @throws java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("control").
*
* @see #isThreadContentionMonitoringSupported
*/
--- 372,385 ----
* Thread contention monitoring is disabled by default.
*
* @param enable {@code true} to enable;
* {@code false} to disable.
*
! * @throws UnsupportedOperationException if the Java
* virtual machine does not support thread contention monitoring.
*
! * @throws SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("control").
*
* @see #isThreadContentionMonitoringSupported
*/
*** 392,411 ****
* If the implementation distinguishes between user mode time and system
* mode time, the returned CPU time is the amount of time that
* the current thread has executed in user mode or system mode.
*
* <p>
! * This is a convenient method for local management use and is
* equivalent to calling:
* <blockquote><pre>
* {@link #getThreadCpuTime getThreadCpuTime}(Thread.currentThread().getId());
* </pre></blockquote>
*
* @return the total CPU time for the current thread if CPU time
* measurement is enabled; {@code -1} otherwise.
*
! * @throws java.lang.UnsupportedOperationException if the Java
* virtual machine does not support CPU time measurement for
* the current thread.
*
* @see #getCurrentThreadUserTime
* @see #isCurrentThreadCpuTimeSupported
--- 392,411 ----
* If the implementation distinguishes between user mode time and system
* mode time, the returned CPU time is the amount of time that
* the current thread has executed in user mode or system mode.
*
* <p>
! * This is a convenience method for local management use and is
* equivalent to calling:
* <blockquote><pre>
* {@link #getThreadCpuTime getThreadCpuTime}(Thread.currentThread().getId());
* </pre></blockquote>
*
* @return the total CPU time for the current thread if CPU time
* measurement is enabled; {@code -1} otherwise.
*
! * @throws UnsupportedOperationException if the Java
* virtual machine does not support CPU time measurement for
* the current thread.
*
* @see #getCurrentThreadUserTime
* @see #isCurrentThreadCpuTimeSupported
*** 419,438 ****
* in user mode in nanoseconds.
* The returned value is of nanoseconds precision but
* not necessarily nanoseconds accuracy.
*
* <p>
! * This is a convenient method for local management use and is
* equivalent to calling:
* <blockquote><pre>
* {@link #getThreadUserTime getThreadUserTime}(Thread.currentThread().getId());
* </pre></blockquote>
*
* @return the user-level CPU time for the current thread if CPU time
* measurement is enabled; {@code -1} otherwise.
*
! * @throws java.lang.UnsupportedOperationException if the Java
* virtual machine does not support CPU time measurement for
* the current thread.
*
* @see #getCurrentThreadCpuTime
* @see #isCurrentThreadCpuTimeSupported
--- 419,438 ----
* in user mode in nanoseconds.
* The returned value is of nanoseconds precision but
* not necessarily nanoseconds accuracy.
*
* <p>
! * This is a convenience method for local management use and is
* equivalent to calling:
* <blockquote><pre>
* {@link #getThreadUserTime getThreadUserTime}(Thread.currentThread().getId());
* </pre></blockquote>
*
* @return the user-level CPU time for the current thread if CPU time
* measurement is enabled; {@code -1} otherwise.
*
! * @throws UnsupportedOperationException if the Java
* virtual machine does not support CPU time measurement for
* the current thread.
*
* @see #getCurrentThreadCpuTime
* @see #isCurrentThreadCpuTimeSupported
*** 465,475 ****
* if the thread of the specified ID exists, the thread is alive,
* and CPU time measurement is enabled;
* {@code -1} otherwise.
*
* @throws IllegalArgumentException if {@code id <= 0}.
! * @throws java.lang.UnsupportedOperationException if the Java
* virtual machine does not support CPU time measurement for
* other threads.
*
* @see #getThreadUserTime
* @see #isThreadCpuTimeSupported
--- 465,475 ----
* if the thread of the specified ID exists, the thread is alive,
* and CPU time measurement is enabled;
* {@code -1} otherwise.
*
* @throws IllegalArgumentException if {@code id <= 0}.
! * @throws UnsupportedOperationException if the Java
* virtual machine does not support CPU time measurement for
* other threads.
*
* @see #getThreadUserTime
* @see #isThreadCpuTimeSupported
*** 500,510 ****
* if the thread of the specified ID exists, the thread is alive,
* and CPU time measurement is enabled;
* {@code -1} otherwise.
*
* @throws IllegalArgumentException if {@code id <= 0}.
! * @throws java.lang.UnsupportedOperationException if the Java
* virtual machine does not support CPU time measurement for
* other threads.
*
* @see #getThreadCpuTime
* @see #isThreadCpuTimeSupported
--- 500,510 ----
* if the thread of the specified ID exists, the thread is alive,
* and CPU time measurement is enabled;
* {@code -1} otherwise.
*
* @throws IllegalArgumentException if {@code id <= 0}.
! * @throws UnsupportedOperationException if the Java
* virtual machine does not support CPU time measurement for
* other threads.
*
* @see #getThreadCpuTime
* @see #isThreadCpuTimeSupported
*** 546,556 ****
* Tests if thread CPU time measurement is enabled.
*
* @return {@code true} if thread CPU time measurement is enabled;
* {@code false} otherwise.
*
! * @throws java.lang.UnsupportedOperationException if the Java virtual
* machine does not support CPU time measurement for other threads
* nor for the current thread.
*
* @see #isThreadCpuTimeSupported
* @see #isCurrentThreadCpuTimeSupported
--- 546,556 ----
* Tests if thread CPU time measurement is enabled.
*
* @return {@code true} if thread CPU time measurement is enabled;
* {@code false} otherwise.
*
! * @throws UnsupportedOperationException if the Java virtual
* machine does not support CPU time measurement for other threads
* nor for the current thread.
*
* @see #isThreadCpuTimeSupported
* @see #isCurrentThreadCpuTimeSupported
*** 562,576 ****
* is platform dependent.
*
* @param enable {@code true} to enable;
* {@code false} to disable.
*
! * @throws java.lang.UnsupportedOperationException if the Java
* virtual machine does not support CPU time measurement for
* any threads nor for the current thread.
*
! * @throws java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("control").
*
* @see #isThreadCpuTimeSupported
* @see #isCurrentThreadCpuTimeSupported
--- 562,576 ----
* is platform dependent.
*
* @param enable {@code true} to enable;
* {@code false} to disable.
*
! * @throws UnsupportedOperationException if the Java
* virtual machine does not support CPU time measurement for
* any threads nor for the current thread.
*
! * @throws SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("control").
*
* @see #isThreadCpuTimeSupported
* @see #isCurrentThreadCpuTimeSupported
*** 602,612 ****
* should be used.
*
* @return an array of IDs of the threads that are monitor
* deadlocked, if any; {@code null} otherwise.
*
! * @throws java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
*
* @see #findDeadlockedThreads
*/
--- 602,612 ----
* should be used.
*
* @return an array of IDs of the threads that are monitor
* deadlocked, if any; {@code null} otherwise.
*
! * @throws SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
*
* @see #findDeadlockedThreads
*/
*** 614,624 ****
/**
* Resets the peak thread count to the current number of
* live threads.
*
! * @throws java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("control").
*
* @see #getPeakThreadCount
* @see #getThreadCount
--- 614,624 ----
/**
* Resets the peak thread count to the current number of
* live threads.
*
! * @throws SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("control").
*
* @see #getPeakThreadCount
* @see #getThreadCount
*** 640,653 ****
*
* @return an array of IDs of the threads that are
* deadlocked waiting for object monitors or ownable synchronizers, if any;
* {@code null} otherwise.
*
! * @throws java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
! * @throws java.lang.UnsupportedOperationException if the Java virtual
* machine does not support monitoring of ownable synchronizer usage.
*
* @see #isSynchronizerUsageSupported
* @see #findMonitorDeadlockedThreads
* @since 1.6
--- 640,653 ----
*
* @return an array of IDs of the threads that are
* deadlocked waiting for object monitors or ownable synchronizers, if any;
* {@code null} otherwise.
*
! * @throws SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
! * @throws UnsupportedOperationException if the Java virtual
* machine does not support monitoring of ownable synchronizer usage.
*
* @see #isSynchronizerUsageSupported
* @see #findMonitorDeadlockedThreads
* @since 1.6
*** 702,715 ****
*
* @return an array of the {@link ThreadInfo} objects, each containing
* information about a thread whose ID is in the corresponding
* element of the input array of IDs.
*
! * @throws java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
! * @throws java.lang.UnsupportedOperationException
* <ul>
* <li>if {@code lockedMonitors} is {@code true} but
* the Java virtual machine does not support monitoring
* of {@linkplain #isObjectMonitorUsageSupported
* object monitor usage}; or</li>
--- 702,715 ----
*
* @return an array of the {@link ThreadInfo} objects, each containing
* information about a thread whose ID is in the corresponding
* element of the input array of IDs.
*
! * @throws SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
! * @throws UnsupportedOperationException
* <ul>
* <li>if {@code lockedMonitors} is {@code true} but
* the Java virtual machine does not support monitoring
* of {@linkplain #isObjectMonitorUsageSupported
* object monitor usage}; or</li>
*** 792,805 ****
* @return an array of the {@link ThreadInfo} objects, each containing
* information about a thread whose ID is in the corresponding
* element of the input array of IDs.
*
* @throws IllegalArgumentException if {@code maxDepth} is negative.
! * @throws java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
! * @throws java.lang.UnsupportedOperationException
* <ul>
* <li>if {@code lockedMonitors} is {@code true} but
* the Java virtual machine does not support monitoring
* of {@linkplain #isObjectMonitorUsageSupported
* object monitor usage}; or</li>
--- 792,805 ----
* @return an array of the {@link ThreadInfo} objects, each containing
* information about a thread whose ID is in the corresponding
* element of the input array of IDs.
*
* @throws IllegalArgumentException if {@code maxDepth} is negative.
! * @throws SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
! * @throws UnsupportedOperationException
* <ul>
* <li>if {@code lockedMonitors} is {@code true} but
* the Java virtual machine does not support monitoring
* of {@linkplain #isObjectMonitorUsageSupported
* object monitor usage}; or</li>
*** 833,846 ****
* @param lockedSynchronizers if {@code true}, dump all locked
* ownable synchronizers.
*
* @return an array of {@link ThreadInfo} for all live threads.
*
! * @throws java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
! * @throws java.lang.UnsupportedOperationException
* <ul>
* <li>if {@code lockedMonitors} is {@code true} but
* the Java virtual machine does not support monitoring
* of {@linkplain #isObjectMonitorUsageSupported
* object monitor usage}; or</li>
--- 833,846 ----
* @param lockedSynchronizers if {@code true}, dump all locked
* ownable synchronizers.
*
* @return an array of {@link ThreadInfo} for all live threads.
*
! * @throws SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
! * @throws UnsupportedOperationException
* <ul>
* <li>if {@code lockedMonitors} is {@code true} but
* the Java virtual machine does not support monitoring
* of {@linkplain #isObjectMonitorUsageSupported
* object monitor usage}; or</li>
*** 882,895 ****
* {@link StackTraceElement} to be retrieved from the stack trace.
*
* @return an array of {@link ThreadInfo} for all live threads.
*
* @throws IllegalArgumentException if {@code maxDepth} is negative.
! * @throws java.lang.SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
! * @throws java.lang.UnsupportedOperationException
* <ul>
* <li>if {@code lockedMonitors} is {@code true} but
* the Java virtual machine does not support monitoring
* of {@linkplain #isObjectMonitorUsageSupported
* object monitor usage}; or</li>
--- 882,895 ----
* {@link StackTraceElement} to be retrieved from the stack trace.
*
* @return an array of {@link ThreadInfo} for all live threads.
*
* @throws IllegalArgumentException if {@code maxDepth} is negative.
! * @throws SecurityException if a security manager
* exists and the caller does not have
* ManagementPermission("monitor").
! * @throws UnsupportedOperationException
* <ul>
* <li>if {@code lockedMonitors} is {@code true} but
* the Java virtual machine does not support monitoring
* of {@linkplain #isObjectMonitorUsageSupported
* object monitor usage}; or</li>
< prev index next >