src/java.management/share/classes/java/lang/management/ThreadMXBean.java
author phh
Wed, 25 Sep 2019 15:22:33 -0700
changeset 58348 c29e49148be7
parent 58223 778fc2dcbdaa
child 58679 9c3209ff7550
permissions -rw-r--r--
8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread Summary: Add com.sun.management.getCurrentThreadAllocatedBytes, implement getThreadAllocatedBytes(long) independent of getThreadAllocatedBytes(long[]) Reviewed-by: mchung, dholmes, sspitsyn
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
55120
b0513c833960 8220251: fix headings in java.management
jjg
parents: 47592
diff changeset
     2
 * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package java.lang.management;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.util.Map;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
 * The management interface for the thread system of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
 * the Java virtual machine.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
 * <p> A Java virtual machine has a single instance of the implementation
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
 * class of this interface.  This instance implementing this interface is
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
 * an <a href="ManagementFactory.html#MXBean">MXBean</a>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
 * that can be obtained by calling
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
 * the {@link ManagementFactory#getThreadMXBean} method or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
 * from the {@link ManagementFactory#getPlatformMBeanServer
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
    40
 * platform MBeanServer} method.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 *
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
    42
 * <p>The {@code ObjectName} for uniquely identifying the MXBean for
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * the thread system within an MBeanServer is:
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 * <blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
 *    {@link ManagementFactory#THREAD_MXBEAN_NAME
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
    46
 *           java.lang:type=Threading}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
 * </blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
 *
401
ef01e0dccd63 6610094: Add generic support for platform MXBeans of any type (also fixed 6681031)
mchung
parents: 2
diff changeset
    49
 * It can be obtained by calling the
ef01e0dccd63 6610094: Add generic support for platform MXBeans of any type (also fixed 6681031)
mchung
parents: 2
diff changeset
    50
 * {@link PlatformManagedObject#getObjectName} method.
ef01e0dccd63 6610094: Add generic support for platform MXBeans of any type (also fixed 6681031)
mchung
parents: 2
diff changeset
    51
 *
55120
b0513c833960 8220251: fix headings in java.management
jjg
parents: 47592
diff changeset
    52
 * <h2>Thread ID</h2>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 * Thread ID is a positive long value returned by calling the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
 * {@link java.lang.Thread#getId} method for a thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
 * The thread ID is unique during its lifetime.  When a thread
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
 * is terminated, this thread ID may be reused.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
 * <p> Some methods in this interface take a thread ID or an array
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
 * of thread IDs as the input parameter and return per-thread information.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
 *
55120
b0513c833960 8220251: fix headings in java.management
jjg
parents: 47592
diff changeset
    61
 * <h2>Thread CPU time</h2>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
 * A Java virtual machine implementation may support measuring
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
 * the CPU time for the current thread, for any thread, or for no threads.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
 * The {@link #isThreadCpuTimeSupported} method can be used to determine
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
 * if a Java virtual machine supports measuring of the CPU time for any
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
 * thread.  The {@link #isCurrentThreadCpuTimeSupported} method can
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
 * be used to determine if a Java virtual machine supports measuring of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
 * the CPU time for the current  thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
 * A Java virtual machine implementation that supports CPU time measurement
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
 * for any thread will also support that for the current thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
 * <p> The CPU time provided by this interface has nanosecond precision
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
 * but not necessarily nanosecond accuracy.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
 * A Java virtual machine may disable CPU time measurement
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
 * by default.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
 * The {@link #isThreadCpuTimeEnabled} and {@link #setThreadCpuTimeEnabled}
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
 * methods can be used to test if CPU time measurement is enabled
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
 * and to enable/disable this support respectively.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
 * Enabling thread CPU measurement could be expensive in some
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
 * Java virtual machine implementations.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
 *
55120
b0513c833960 8220251: fix headings in java.management
jjg
parents: 47592
diff changeset
    86
 * <h2>Thread Contention Monitoring</h2>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
 * Some Java virtual machines may support thread contention monitoring.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
 * When thread contention monitoring is enabled, the accumulated elapsed
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
 * time that the thread has blocked for synchronization or waited for
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
 * notification will be collected and returned in the
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
    91
 * <a href="ThreadInfo.html#SyncStats">{@code ThreadInfo}</a> object.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
 * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
 * The {@link #isThreadContentionMonitoringSupported} method can be used to
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
 * determine if a Java virtual machine supports thread contention monitoring.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
 * The thread contention monitoring is disabled by default.  The
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
 * {@link #setThreadContentionMonitoringEnabled} method can be used to enable
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
 * thread contention monitoring.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
 *
55120
b0513c833960 8220251: fix headings in java.management
jjg
parents: 47592
diff changeset
    99
 * <h2>Synchronization Information and Deadlock Detection</h2>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
 * Some Java virtual machines may support monitoring of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
 * {@linkplain #isObjectMonitorUsageSupported object monitor usage} and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
 * {@linkplain #isSynchronizerUsageSupported ownable synchronizer usage}.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
 * The {@link #getThreadInfo(long[], boolean, boolean)} and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
 * {@link #dumpAllThreads} methods can be used to obtain the thread stack trace
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
 * and synchronization information including which
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
 * {@linkplain LockInfo <i>lock</i>} a thread is blocked to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
 * acquire or waiting on and which locks the thread currently owns.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
 * <p>
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   109
 * The {@code ThreadMXBean} interface provides the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
 * {@link #findMonitorDeadlockedThreads} and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
 * {@link #findDeadlockedThreads} methods to find deadlocks in
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
 * the running application.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
 *
401
ef01e0dccd63 6610094: Add generic support for platform MXBeans of any type (also fixed 6681031)
mchung
parents: 2
diff changeset
   114
 * @see ManagementFactory#getPlatformMXBeans(Class)
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
 * @see <a href="../../../javax/management/package-summary.html">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
 *      JMX Specification.</a>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
 * @see <a href="package-summary.html#examples">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
 *      Ways to Access MXBeans</a>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
 * @author  Mandy Chung
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
 * @since   1.5
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
401
ef01e0dccd63 6610094: Add generic support for platform MXBeans of any type (also fixed 6681031)
mchung
parents: 2
diff changeset
   124
public interface ThreadMXBean extends PlatformManagedObject {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
     * Returns the current number of live threads including both
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
     * daemon and non-daemon threads.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
     * @return the current number of live threads.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
    public int getThreadCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
     * Returns the peak live thread count since the Java virtual machine
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
     * started or peak was reset.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
     * @return the peak live thread count.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
    public int getPeakThreadCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
     * Returns the total number of threads created and also started
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
     * since the Java virtual machine started.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
     * @return the total number of threads started.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
    public long getTotalStartedThreadCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
     * Returns the current number of live daemon threads.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
     * @return the current number of live daemon threads.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    public int getDaemonThreadCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
     * Returns all live thread IDs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
     * Some threads included in the returned array
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
     * may have been terminated when this method returns.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
     *
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   161
     * @return an array of {@code long}, each is a thread ID.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
     *
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   163
     * @throws SecurityException if a security manager
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
     *         exists and the caller does not have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
     *         ManagementPermission("monitor").
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
    public long[] getAllThreadIds();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
     * Returns the thread info for a thread of the specified
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   171
     * {@code id} with no stack trace.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
     * This method is equivalent to calling:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
     * <blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
     *   {@link #getThreadInfo(long, int) getThreadInfo(id, 0);}
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
     * </blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
     * <p>
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   178
     * This method returns a {@code ThreadInfo} object representing
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * the thread information for the thread of the specified ID.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     * The stack trace, locked monitors, and locked synchronizers
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   181
     * in the returned {@code ThreadInfo} object will
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
     * be empty.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
     * If a thread of the given ID is not alive or does not exist,
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   185
     * this method will return {@code null}.  A thread is alive if
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
     * it has been started and has not yet died.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
     * <b>MBeanServer access</b>:<br>
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   190
     * The mapped type of {@code ThreadInfo} is
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   191
     * {@code CompositeData} with attributes as specified in the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
     * {@link ThreadInfo#from ThreadInfo.from} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * @param id the thread ID of the thread. Must be positive.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
     * @return a {@link ThreadInfo} object for the thread of the given ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
     * with no stack trace, no locked monitor and no synchronizer info;
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   198
     * {@code null} if the thread of the given ID is not alive or
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * it does not exist.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     *
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 5506
diff changeset
   201
     * @throws IllegalArgumentException if {@code id <= 0}.
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   202
     * @throws SecurityException if a security manager
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
     *         exists and the caller does not have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
     *         ManagementPermission("monitor").
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
    public ThreadInfo getThreadInfo(long id);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     * Returns the thread info for each thread
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   210
     * whose ID is in the input array {@code ids} with no stack trace.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
     * This method is equivalent to calling:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
     * <blockquote><pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
     *   {@link #getThreadInfo(long[], int) getThreadInfo}(ids, 0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     * <p>
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   217
     * This method returns an array of the {@code ThreadInfo} objects.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     * The stack trace, locked monitors, and locked synchronizers
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   219
     * in each {@code ThreadInfo} object will be empty.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
     * If a thread of a given ID is not alive or does not exist,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * the corresponding element in the returned array will
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   223
     * contain {@code null}.  A thread is alive if
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
     * it has been started and has not yet died.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     * <b>MBeanServer access</b>:<br>
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   228
     * The mapped type of {@code ThreadInfo} is
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   229
     * {@code CompositeData} with attributes as specified in the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * {@link ThreadInfo#from ThreadInfo.from} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
     * @param ids an array of thread IDs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
     * @return an array of the {@link ThreadInfo} objects, each containing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
     * information about a thread whose ID is in the corresponding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     * element of the input array of IDs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     * with no stack trace, no locked monitor and no synchronizer info.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * @throws IllegalArgumentException if any element in the input array
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   239
     *         {@code ids} is {@code <= 0}.
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   240
     * @throws SecurityException if a security manager
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
     *         exists and the caller does not have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
     *         ManagementPermission("monitor").
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
    public ThreadInfo[] getThreadInfo(long[] ids);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    /**
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   247
     * Returns a thread info for a thread of the specified {@code id},
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     * with stack trace of a specified number of stack trace elements.
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   249
     * The {@code maxDepth} parameter indicates the maximum number of
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
     * {@link StackTraceElement} to be retrieved from the stack trace.
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   251
     * If {@code maxDepth == Integer.MAX_VALUE}, the entire stack trace of
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
     * the thread will be dumped.
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   253
     * If {@code maxDepth == 0}, no stack trace of the thread
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     * will be dumped.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
     * This method does not obtain the locked monitors and locked
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
     * synchronizers of the thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
     * When the Java virtual machine has no stack trace information
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   259
     * about a thread or {@code maxDepth == 0},
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     * the stack trace in the
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   261
     * {@code ThreadInfo} object will be an empty array of
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   262
     * {@code StackTraceElement}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
     * If a thread of the given ID is not alive or does not exist,
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   266
     * this method will return {@code null}.  A thread is alive if
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     * it has been started and has not yet died.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
     * <b>MBeanServer access</b>:<br>
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   271
     * The mapped type of {@code ThreadInfo} is
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   272
     * {@code CompositeData} with attributes as specified in the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * {@link ThreadInfo#from ThreadInfo.from} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
     * @param id the thread ID of the thread. Must be positive.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
     * @param maxDepth the maximum number of entries in the stack trace
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   277
     * to be dumped. {@code Integer.MAX_VALUE} could be used to request
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
     * the entire stack to be dumped.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     * @return a {@link ThreadInfo} of the thread of the given ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     * with no locked monitor and synchronizer info.
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   282
     * {@code null} if the thread of the given ID is not alive or
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
     * it does not exist.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
     *
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 5506
diff changeset
   285
     * @throws IllegalArgumentException if {@code id <= 0}.
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   286
     * @throws IllegalArgumentException if {@code maxDepth is negative}.
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   287
     * @throws SecurityException if a security manager
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
     *         exists and the caller does not have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
     *         ManagementPermission("monitor").
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
    public ThreadInfo getThreadInfo(long id, int maxDepth);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
     * Returns the thread info for each thread
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   296
     * whose ID is in the input array {@code ids},
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
     * with stack trace of a specified number of stack trace elements.
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   298
     * The {@code maxDepth} parameter indicates the maximum number of
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
     * {@link StackTraceElement} to be retrieved from the stack trace.
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   300
     * If {@code maxDepth == Integer.MAX_VALUE}, the entire stack trace of
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
     * the thread will be dumped.
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   302
     * If {@code maxDepth == 0}, no stack trace of the thread
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
     * will be dumped.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     * This method does not obtain the locked monitors and locked
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     * synchronizers of the threads.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
     * When the Java virtual machine has no stack trace information
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   308
     * about a thread or {@code maxDepth == 0},
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
     * the stack trace in the
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   310
     * {@code ThreadInfo} object will be an empty array of
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   311
     * {@code StackTraceElement}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
     * <p>
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   313
     * This method returns an array of the {@code ThreadInfo} objects,
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
     * each is the thread information about the thread with the same index
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   315
     * as in the {@code ids} array.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
     * If a thread of the given ID is not alive or does not exist,
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   317
     * {@code null} will be set in the corresponding element
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
     * in the returned array.  A thread is alive if
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     * it has been started and has not yet died.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
     * <b>MBeanServer access</b>:<br>
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   323
     * The mapped type of {@code ThreadInfo} is
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   324
     * {@code CompositeData} with attributes as specified in the
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
     * {@link ThreadInfo#from ThreadInfo.from} method.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
     * @param ids an array of thread IDs
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
     * @param maxDepth the maximum number of entries in the stack trace
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   329
     * to be dumped. {@code Integer.MAX_VALUE} could be used to request
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     * the entire stack to be dumped.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
     * @return an array of the {@link ThreadInfo} objects, each containing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
     * information about a thread whose ID is in the corresponding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
     * element of the input array of IDs with no locked monitor and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
     * synchronizer info.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
     *
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   337
     * @throws IllegalArgumentException if {@code maxDepth is negative}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
     * @throws IllegalArgumentException if any element in the input array
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   339
     *      {@code ids} is {@code <= 0}.
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   340
     * @throws SecurityException if a security manager
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
     *         exists and the caller does not have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     *         ManagementPermission("monitor").
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
    public ThreadInfo[] getThreadInfo(long[] ids, int maxDepth);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
     * Tests if the Java virtual machine supports thread contention monitoring.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
     * @return
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   351
     *   {@code true}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
     *     if the Java virtual machine supports thread contention monitoring;
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   353
     *   {@code false} otherwise.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
    public boolean isThreadContentionMonitoringSupported();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
     * Tests if thread contention monitoring is enabled.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
     *
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   360
     * @return {@code true} if thread contention monitoring is enabled;
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   361
     *         {@code false} otherwise.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
     *
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   363
     * @throws UnsupportedOperationException if the Java virtual
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
     * machine does not support thread contention monitoring.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
     * @see #isThreadContentionMonitoringSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
    public boolean isThreadContentionMonitoringEnabled();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
     * Enables or disables thread contention monitoring.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
     * Thread contention monitoring is disabled by default.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
     *
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   374
     * @param enable {@code true} to enable;
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   375
     *               {@code false} to disable.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
     *
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   377
     * @throws UnsupportedOperationException if the Java
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
     * virtual machine does not support thread contention monitoring.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
     *
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   380
     * @throws SecurityException if a security manager
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
     *         exists and the caller does not have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
     *         ManagementPermission("control").
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     * @see #isThreadContentionMonitoringSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
    public void setThreadContentionMonitoringEnabled(boolean enable);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
     * Returns the total CPU time for the current thread in nanoseconds.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
     * The returned value is of nanoseconds precision but
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
     * not necessarily nanoseconds accuracy.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
     * If the implementation distinguishes between user mode time and system
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
     * mode time, the returned CPU time is the amount of time that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
     * the current thread has executed in user mode or system mode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     * <p>
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   397
     * This is a convenience method for local management use and is
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
     * equivalent to calling:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
     * <blockquote><pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
     *   {@link #getThreadCpuTime getThreadCpuTime}(Thread.currentThread().getId());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
     * @return the total CPU time for the current thread if CPU time
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   404
     * measurement is enabled; {@code -1} otherwise.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
     *
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   406
     * @throws UnsupportedOperationException if the Java
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
     * virtual machine does not support CPU time measurement for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
     * the current thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
     * @see #getCurrentThreadUserTime
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
     * @see #isCurrentThreadCpuTimeSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
     * @see #isThreadCpuTimeEnabled
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
     * @see #setThreadCpuTimeEnabled
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
    public long getCurrentThreadCpuTime();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
     * Returns the CPU time that the current thread has executed
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
     * in user mode in nanoseconds.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
     * The returned value is of nanoseconds precision but
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
     * not necessarily nanoseconds accuracy.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * <p>
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   424
     * This is a convenience method for local management use and is
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
     * equivalent to calling:
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
     * <blockquote><pre>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
     *   {@link #getThreadUserTime getThreadUserTime}(Thread.currentThread().getId());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
     * </pre></blockquote>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     * @return the user-level CPU time for the current thread if CPU time
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   431
     * measurement is enabled; {@code -1} otherwise.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
     *
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   433
     * @throws UnsupportedOperationException if the Java
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
     * virtual machine does not support CPU time measurement for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
     * the current thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
     * @see #getCurrentThreadCpuTime
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
     * @see #isCurrentThreadCpuTimeSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     * @see #isThreadCpuTimeEnabled
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
     * @see #setThreadCpuTimeEnabled
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
    public long getCurrentThreadUserTime();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
     * Returns the total CPU time for a thread of the specified ID in nanoseconds.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
     * The returned value is of nanoseconds precision but
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
     * not necessarily nanoseconds accuracy.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
     * If the implementation distinguishes between user mode time and system
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
     * mode time, the returned CPU time is the amount of time that
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
     * the thread has executed in user mode or system mode.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
     * If the thread of the specified ID is not alive or does not exist,
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   454
     * this method returns {@code -1}. If CPU time measurement
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   455
     * is disabled, this method returns {@code -1}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
     * A thread is alive if it has been started and has not yet died.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     * If CPU time measurement is enabled after the thread has started,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
     * the Java virtual machine implementation may choose any time up to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
     * and including the time that the capability is enabled as the point
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
     * where CPU time measurement starts.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
     * @param id the thread ID of a thread
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
     * @return the total CPU time for a thread of the specified ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
     * if the thread of the specified ID exists, the thread is alive,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
     * and CPU time measurement is enabled;
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   467
     * {@code -1} otherwise.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
     *
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 5506
diff changeset
   469
     * @throws IllegalArgumentException if {@code id <= 0}.
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   470
     * @throws UnsupportedOperationException if the Java
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
     * virtual machine does not support CPU time measurement for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
     * other threads.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
     * @see #getThreadUserTime
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
     * @see #isThreadCpuTimeSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
     * @see #isThreadCpuTimeEnabled
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
     * @see #setThreadCpuTimeEnabled
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
    public long getThreadCpuTime(long id);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
     * Returns the CPU time that a thread of the specified ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
     * has executed in user mode in nanoseconds.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
     * The returned value is of nanoseconds precision but
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
     * not necessarily nanoseconds accuracy.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
     * If the thread of the specified ID is not alive or does not exist,
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   489
     * this method returns {@code -1}. If CPU time measurement
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   490
     * is disabled, this method returns {@code -1}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
     * A thread is alive if it has been started and has not yet died.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
     * If CPU time measurement is enabled after the thread has started,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
     * the Java virtual machine implementation may choose any time up to
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
     * and including the time that the capability is enabled as the point
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
     * where CPU time measurement starts.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
     * @param id the thread ID of a thread
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
     * @return the user-level CPU time for a thread of the specified ID
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
     * if the thread of the specified ID exists, the thread is alive,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
     * and CPU time measurement is enabled;
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   502
     * {@code -1} otherwise.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
     *
18156
edb590d448c5 8016217: More javadoc warnings
alanb
parents: 5506
diff changeset
   504
     * @throws IllegalArgumentException if {@code id <= 0}.
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   505
     * @throws UnsupportedOperationException if the Java
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
     * virtual machine does not support CPU time measurement for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   507
     * other threads.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   508
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   509
     * @see #getThreadCpuTime
90ce3da70b43 Initial load
duke
parents:
diff changeset
   510
     * @see #isThreadCpuTimeSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   511
     * @see #isThreadCpuTimeEnabled
90ce3da70b43 Initial load
duke
parents:
diff changeset
   512
     * @see #setThreadCpuTimeEnabled
90ce3da70b43 Initial load
duke
parents:
diff changeset
   513
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   514
    public long getThreadUserTime(long id);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   515
90ce3da70b43 Initial load
duke
parents:
diff changeset
   516
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   517
     * Tests if the Java virtual machine implementation supports CPU time
90ce3da70b43 Initial load
duke
parents:
diff changeset
   518
     * measurement for any thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   519
     * A Java virtual machine implementation that supports CPU time
90ce3da70b43 Initial load
duke
parents:
diff changeset
   520
     * measurement for any thread will also support CPU time
90ce3da70b43 Initial load
duke
parents:
diff changeset
   521
     * measurement for the current thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   522
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   523
     * @return
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   524
     *   {@code true}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   525
     *     if the Java virtual machine supports CPU time
90ce3da70b43 Initial load
duke
parents:
diff changeset
   526
     *     measurement for any thread;
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   527
     *   {@code false} otherwise.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   528
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   529
    public boolean isThreadCpuTimeSupported();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   530
90ce3da70b43 Initial load
duke
parents:
diff changeset
   531
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   532
     * Tests if the Java virtual machine supports CPU time
90ce3da70b43 Initial load
duke
parents:
diff changeset
   533
     * measurement for the current thread.
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   534
     * This method returns {@code true} if {@link #isThreadCpuTimeSupported}
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   535
     * returns {@code true}.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   536
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   537
     * @return
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   538
     *   {@code true}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   539
     *     if the Java virtual machine supports CPU time
90ce3da70b43 Initial load
duke
parents:
diff changeset
   540
     *     measurement for current thread;
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   541
     *   {@code false} otherwise.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   542
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   543
    public boolean isCurrentThreadCpuTimeSupported();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   544
90ce3da70b43 Initial load
duke
parents:
diff changeset
   545
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   546
     * Tests if thread CPU time measurement is enabled.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   547
     *
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   548
     * @return {@code true} if thread CPU time measurement is enabled;
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   549
     *         {@code false} otherwise.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   550
     *
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   551
     * @throws UnsupportedOperationException if the Java virtual
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   552
     * machine does not support CPU time measurement for other threads
90ce3da70b43 Initial load
duke
parents:
diff changeset
   553
     * nor for the current thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   554
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   555
     * @see #isThreadCpuTimeSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   556
     * @see #isCurrentThreadCpuTimeSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   557
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   558
    public boolean isThreadCpuTimeEnabled();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   559
90ce3da70b43 Initial load
duke
parents:
diff changeset
   560
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   561
     * Enables or disables thread CPU time measurement.  The default
90ce3da70b43 Initial load
duke
parents:
diff changeset
   562
     * is platform dependent.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   563
     *
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   564
     * @param enable {@code true} to enable;
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   565
     *               {@code false} to disable.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   566
     *
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   567
     * @throws UnsupportedOperationException if the Java
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   568
     * virtual machine does not support CPU time measurement for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   569
     * any threads nor for the current thread.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   570
     *
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   571
     * @throws SecurityException if a security manager
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   572
     *         exists and the caller does not have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   573
     *         ManagementPermission("control").
90ce3da70b43 Initial load
duke
parents:
diff changeset
   574
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   575
     * @see #isThreadCpuTimeSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   576
     * @see #isCurrentThreadCpuTimeSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   577
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   578
    public void setThreadCpuTimeEnabled(boolean enable);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   579
90ce3da70b43 Initial load
duke
parents:
diff changeset
   580
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   581
     * Finds cycles of threads that are in deadlock waiting to acquire
90ce3da70b43 Initial load
duke
parents:
diff changeset
   582
     * object monitors. That is, threads that are blocked waiting to enter a
90ce3da70b43 Initial load
duke
parents:
diff changeset
   583
     * synchronization block or waiting to reenter a synchronization block
90ce3da70b43 Initial load
duke
parents:
diff changeset
   584
     * after an {@link Object#wait Object.wait} call,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   585
     * where each thread owns one monitor while
90ce3da70b43 Initial load
duke
parents:
diff changeset
   586
     * trying to obtain another monitor already held by another thread
90ce3da70b43 Initial load
duke
parents:
diff changeset
   587
     * in a cycle.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   588
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   589
     * More formally, a thread is <em>monitor deadlocked</em> if it is
90ce3da70b43 Initial load
duke
parents:
diff changeset
   590
     * part of a cycle in the relation "is waiting for an object monitor
90ce3da70b43 Initial load
duke
parents:
diff changeset
   591
     * owned by".  In the simplest case, thread A is blocked waiting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   592
     * for a monitor owned by thread B, and thread B is blocked waiting
90ce3da70b43 Initial load
duke
parents:
diff changeset
   593
     * for a monitor owned by thread A.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   594
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   595
     * This method is designed for troubleshooting use, but not for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   596
     * synchronization control.  It might be an expensive operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   597
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   598
     * This method finds deadlocks involving only object monitors.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   599
     * To find deadlocks involving both object monitors and
90ce3da70b43 Initial load
duke
parents:
diff changeset
   600
     * <a href="LockInfo.html#OwnableSynchronizer">ownable synchronizers</a>,
90ce3da70b43 Initial load
duke
parents:
diff changeset
   601
     * the {@link #findDeadlockedThreads findDeadlockedThreads} method
90ce3da70b43 Initial load
duke
parents:
diff changeset
   602
     * should be used.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   603
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   604
     * @return an array of IDs of the threads that are monitor
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   605
     * deadlocked, if any; {@code null} otherwise.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   606
     *
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   607
     * @throws SecurityException if a security manager
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   608
     *         exists and the caller does not have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   609
     *         ManagementPermission("monitor").
90ce3da70b43 Initial load
duke
parents:
diff changeset
   610
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   611
     * @see #findDeadlockedThreads
90ce3da70b43 Initial load
duke
parents:
diff changeset
   612
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   613
    public long[] findMonitorDeadlockedThreads();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   614
90ce3da70b43 Initial load
duke
parents:
diff changeset
   615
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   616
     * Resets the peak thread count to the current number of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   617
     * live threads.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   618
     *
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   619
     * @throws SecurityException if a security manager
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   620
     *         exists and the caller does not have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   621
     *         ManagementPermission("control").
90ce3da70b43 Initial load
duke
parents:
diff changeset
   622
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   623
     * @see #getPeakThreadCount
90ce3da70b43 Initial load
duke
parents:
diff changeset
   624
     * @see #getThreadCount
90ce3da70b43 Initial load
duke
parents:
diff changeset
   625
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   626
    public void resetPeakThreadCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   627
90ce3da70b43 Initial load
duke
parents:
diff changeset
   628
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   629
     * Finds cycles of threads that are in deadlock waiting to acquire
90ce3da70b43 Initial load
duke
parents:
diff changeset
   630
     * object monitors or
90ce3da70b43 Initial load
duke
parents:
diff changeset
   631
     * <a href="LockInfo.html#OwnableSynchronizer">ownable synchronizers</a>.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   632
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   633
     * Threads are <em>deadlocked</em> in a cycle waiting for a lock of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   634
     * these two types if each thread owns one lock while
90ce3da70b43 Initial load
duke
parents:
diff changeset
   635
     * trying to acquire another lock already held
90ce3da70b43 Initial load
duke
parents:
diff changeset
   636
     * by another thread in the cycle.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   637
     * <p>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   638
     * This method is designed for troubleshooting use, but not for
90ce3da70b43 Initial load
duke
parents:
diff changeset
   639
     * synchronization control.  It might be an expensive operation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   640
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   641
     * @return an array of IDs of the threads that are
90ce3da70b43 Initial load
duke
parents:
diff changeset
   642
     * deadlocked waiting for object monitors or ownable synchronizers, if any;
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   643
     * {@code null} otherwise.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   644
     *
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   645
     * @throws SecurityException if a security manager
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   646
     *         exists and the caller does not have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   647
     *         ManagementPermission("monitor").
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   648
     * @throws UnsupportedOperationException if the Java virtual
21278
ef8a3a2a72f2 8022746: List of spelling errors in API doc
malenkov
parents: 18799
diff changeset
   649
     * machine does not support monitoring of ownable synchronizer usage.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   650
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   651
     * @see #isSynchronizerUsageSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   652
     * @see #findMonitorDeadlockedThreads
90ce3da70b43 Initial load
duke
parents:
diff changeset
   653
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   654
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   655
    public long[] findDeadlockedThreads();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   656
90ce3da70b43 Initial load
duke
parents:
diff changeset
   657
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   658
     * Tests if the Java virtual machine supports monitoring of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   659
     * object monitor usage.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   660
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   661
     * @return
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   662
     *   {@code true}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   663
     *     if the Java virtual machine supports monitoring of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   664
     *     object monitor usage;
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   665
     *   {@code false} otherwise.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   666
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   667
     * @see #dumpAllThreads
90ce3da70b43 Initial load
duke
parents:
diff changeset
   668
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   669
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   670
    public boolean isObjectMonitorUsageSupported();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   671
90ce3da70b43 Initial load
duke
parents:
diff changeset
   672
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   673
     * Tests if the Java virtual machine supports monitoring of
90ce3da70b43 Initial load
duke
parents:
diff changeset
   674
     * <a href="LockInfo.html#OwnableSynchronizer">
90ce3da70b43 Initial load
duke
parents:
diff changeset
   675
     * ownable synchronizer</a> usage.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   676
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   677
     * @return
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   678
     *   {@code true}
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   679
     *     if the Java virtual machine supports monitoring of ownable
90ce3da70b43 Initial load
duke
parents:
diff changeset
   680
     *     synchronizer usage;
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   681
     *   {@code false} otherwise.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   682
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   683
     * @see #dumpAllThreads
90ce3da70b43 Initial load
duke
parents:
diff changeset
   684
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   685
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   686
    public boolean isSynchronizerUsageSupported();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   687
90ce3da70b43 Initial load
duke
parents:
diff changeset
   688
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   689
     * Returns the thread info for each thread
47592
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   690
     * whose ID is in the input array {@code ids},
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   691
     * with stack trace and synchronization information.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   692
     * This is equivalent to calling:
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   693
     * <blockquote>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   694
     * {@link #getThreadInfo(long[], boolean, boolean, int)
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   695
     * getThreadInfo(ids, lockedMonitors, lockedSynchronizers, Integer.MAX_VALUE)}
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   696
     * </blockquote>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   697
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   698
     * @param  ids an array of thread IDs.
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   699
     * @param  lockedMonitors if {@code true}, retrieves all locked monitors.
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   700
     * @param  lockedSynchronizers if {@code true}, retrieves all locked
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   701
     *             ownable synchronizers.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   702
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   703
     * @return an array of the {@link ThreadInfo} objects, each containing
90ce3da70b43 Initial load
duke
parents:
diff changeset
   704
     * information about a thread whose ID is in the corresponding
90ce3da70b43 Initial load
duke
parents:
diff changeset
   705
     * element of the input array of IDs.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   706
     *
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   707
     * @throws SecurityException if a security manager
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   708
     *         exists and the caller does not have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   709
     *         ManagementPermission("monitor").
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   710
     * @throws UnsupportedOperationException
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   711
     *         <ul>
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   712
     *           <li>if {@code lockedMonitors} is {@code true} but
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   713
     *               the Java virtual machine does not support monitoring
90ce3da70b43 Initial load
duke
parents:
diff changeset
   714
     *               of {@linkplain #isObjectMonitorUsageSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   715
     *               object monitor usage}; or</li>
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   716
     *           <li>if {@code lockedSynchronizers} is {@code true} but
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   717
     *               the Java virtual machine does not support monitoring
90ce3da70b43 Initial load
duke
parents:
diff changeset
   718
     *               of {@linkplain #isSynchronizerUsageSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   719
     *               ownable synchronizer usage}.</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   720
     *         </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   721
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   722
     * @see #isObjectMonitorUsageSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   723
     * @see #isSynchronizerUsageSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   724
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   725
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   726
     */
47592
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   727
    public ThreadInfo[] getThreadInfo(long[] ids, boolean lockedMonitors,
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   728
                                      boolean lockedSynchronizers);
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   729
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   730
    /**
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   731
     * Returns the thread info for each thread whose ID
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   732
     * is in the input array {@code ids},
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   733
     * with stack trace of the specified maximum number of elements
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   734
     * and synchronization information.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   735
     * If {@code maxDepth == 0}, no stack trace of the thread
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   736
     * will be dumped.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   737
     *
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   738
     * <p>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   739
     * This method obtains a snapshot of the thread information
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   740
     * for each thread including:
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   741
     * <ul>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   742
     *    <li>stack trace of the specified maximum number of elements,</li>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   743
     *    <li>the object monitors currently locked by the thread
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   744
     *        if {@code lockedMonitors} is {@code true}, and</li>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   745
     *    <li>the <a href="LockInfo.html#OwnableSynchronizer">
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   746
     *        ownable synchronizers</a> currently locked by the thread
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   747
     *        if {@code lockedSynchronizers} is {@code true}.</li>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   748
     * </ul>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   749
     * <p>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   750
     * This method returns an array of the {@code ThreadInfo} objects,
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   751
     * each is the thread information about the thread with the same index
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   752
     * as in the {@code ids} array.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   753
     * If a thread of the given ID is not alive or does not exist,
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   754
     * {@code null} will be set in the corresponding element
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   755
     * in the returned array.  A thread is alive if
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   756
     * it has been started and has not yet died.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   757
     * <p>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   758
     * If a thread does not lock any object monitor or {@code lockedMonitors}
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   759
     * is {@code false}, the returned {@code ThreadInfo} object will have an
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   760
     * empty {@code MonitorInfo} array.  Similarly, if a thread does not
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   761
     * lock any synchronizer or {@code lockedSynchronizers} is {@code false},
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   762
     * the returned {@code ThreadInfo} object
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   763
     * will have an empty {@code LockInfo} array.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   764
     *
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   765
     * <p>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   766
     * When both {@code lockedMonitors} and {@code lockedSynchronizers}
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   767
     * parameters are {@code false}, it is equivalent to calling:
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   768
     * <blockquote><pre>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   769
     *     {@link #getThreadInfo(long[], int)  getThreadInfo(ids, maxDepth)}
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   770
     * </pre></blockquote>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   771
     *
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   772
     * <p>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   773
     * This method is designed for troubleshooting use, but not for
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   774
     * synchronization control.  It might be an expensive operation.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   775
     *
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   776
     * <p>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   777
     * <b>MBeanServer access</b>:<br>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   778
     * The mapped type of {@code ThreadInfo} is
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   779
     * {@code CompositeData} with attributes as specified in the
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   780
     * {@link ThreadInfo#from ThreadInfo.from} method.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   781
     *
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   782
     * @implSpec The default implementation throws
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   783
     * {@code UnsupportedOperationException}.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   784
     *
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   785
     * @param  ids an array of thread IDs.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   786
     * @param  lockedMonitors if {@code true}, retrieves all locked monitors.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   787
     * @param  lockedSynchronizers if {@code true}, retrieves all locked
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   788
     *             ownable synchronizers.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   789
     * @param  maxDepth indicates the maximum number of
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   790
     * {@link StackTraceElement} to be retrieved from the stack trace.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   791
     *
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   792
     * @return an array of the {@link ThreadInfo} objects, each containing
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   793
     * information about a thread whose ID is in the corresponding
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   794
     * element of the input array of IDs.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   795
     *
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   796
     * @throws IllegalArgumentException if {@code maxDepth} is negative.
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   797
     * @throws SecurityException if a security manager
47592
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   798
     *         exists and the caller does not have
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   799
     *         ManagementPermission("monitor").
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   800
     * @throws UnsupportedOperationException
47592
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   801
     *         <ul>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   802
     *           <li>if {@code lockedMonitors} is {@code true} but
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   803
     *               the Java virtual machine does not support monitoring
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   804
     *               of {@linkplain #isObjectMonitorUsageSupported
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   805
     *               object monitor usage}; or</li>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   806
     *           <li>if {@code lockedSynchronizers} is {@code true} but
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   807
     *               the Java virtual machine does not support monitoring
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   808
     *               of {@linkplain #isSynchronizerUsageSupported
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   809
     *               ownable synchronizer usage}.</li>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   810
     *         </ul>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   811
     *
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   812
     * @see #isObjectMonitorUsageSupported
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   813
     * @see #isSynchronizerUsageSupported
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   814
     *
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   815
     * @since 10
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   816
     */
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   817
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   818
    public default ThreadInfo[] getThreadInfo(long[] ids, boolean lockedMonitors,
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   819
                                              boolean lockedSynchronizers, int maxDepth) {
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   820
        throw new UnsupportedOperationException();
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   821
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   822
90ce3da70b43 Initial load
duke
parents:
diff changeset
   823
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   824
     * Returns the thread info for all live threads with stack trace
90ce3da70b43 Initial load
duke
parents:
diff changeset
   825
     * and synchronization information.
47592
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   826
     * This is equivalent to calling:
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   827
     * <blockquote>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   828
     * {@link #dumpAllThreads(boolean, boolean, int)
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   829
     * dumpAllThreads(lockedMonitors, lockedSynchronizers, Integer.MAX_VALUE)}
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   830
     * </blockquote>
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   831
     *
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   832
     * @param  lockedMonitors if {@code true}, dump all locked monitors.
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   833
     * @param  lockedSynchronizers if {@code true}, dump all locked
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   834
     *             ownable synchronizers.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   835
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   836
     * @return an array of {@link ThreadInfo} for all live threads.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   837
     *
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   838
     * @throws SecurityException if a security manager
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   839
     *         exists and the caller does not have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   840
     *         ManagementPermission("monitor").
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   841
     * @throws UnsupportedOperationException
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   842
     *         <ul>
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   843
     *           <li>if {@code lockedMonitors} is {@code true} but
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   844
     *               the Java virtual machine does not support monitoring
90ce3da70b43 Initial load
duke
parents:
diff changeset
   845
     *               of {@linkplain #isObjectMonitorUsageSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   846
     *               object monitor usage}; or</li>
32034
05676cfd40b5 8133040: docs: replace <tt> tags (obsolete in html5) for java.management
avstepan
parents: 25859
diff changeset
   847
     *           <li>if {@code lockedSynchronizers} is {@code true} but
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   848
     *               the Java virtual machine does not support monitoring
90ce3da70b43 Initial load
duke
parents:
diff changeset
   849
     *               of {@linkplain #isSynchronizerUsageSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   850
     *               ownable synchronizer usage}.</li>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   851
     *         </ul>
90ce3da70b43 Initial load
duke
parents:
diff changeset
   852
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   853
     * @see #isObjectMonitorUsageSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   854
     * @see #isSynchronizerUsageSupported
90ce3da70b43 Initial load
duke
parents:
diff changeset
   855
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
   856
     * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
   857
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   858
    public ThreadInfo[] dumpAllThreads(boolean lockedMonitors, boolean lockedSynchronizers);
47592
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   859
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   860
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   861
    /**
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   862
     * Returns the thread info for all live threads
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   863
     * with stack trace of the specified maximum number of elements
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   864
     * and synchronization information.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   865
     * if {@code maxDepth == 0}, no stack trace of the thread
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   866
     * will be dumped.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   867
     * Some threads included in the returned array
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   868
     * may have been terminated when this method returns.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   869
     *
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   870
     * <p>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   871
     * This method returns an array of {@link ThreadInfo} objects
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   872
     * as specified in the {@link #getThreadInfo(long[], boolean, boolean, int)}
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   873
     * method.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   874
     *
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   875
     * @implSpec The default implementation throws
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   876
     * {@code UnsupportedOperationException}.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   877
     *
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   878
     * @param  lockedMonitors if {@code true}, dump all locked monitors.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   879
     * @param  lockedSynchronizers if {@code true}, dump all locked
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   880
     *             ownable synchronizers.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   881
     * @param  maxDepth indicates the maximum number of
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   882
     * {@link StackTraceElement} to be retrieved from the stack trace.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   883
     *
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   884
     * @return an array of {@link ThreadInfo} for all live threads.
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   885
     *
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   886
     * @throws IllegalArgumentException if {@code maxDepth} is negative.
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   887
     * @throws SecurityException if a security manager
47592
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   888
     *         exists and the caller does not have
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   889
     *         ManagementPermission("monitor").
58348
c29e49148be7 8231209: [REDO] ThreadMXBean::getThreadAllocatedBytes() can be quicker for self thread
phh
parents: 58223
diff changeset
   890
     * @throws UnsupportedOperationException
47592
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   891
     *         <ul>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   892
     *           <li>if {@code lockedMonitors} is {@code true} but
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   893
     *               the Java virtual machine does not support monitoring
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   894
     *               of {@linkplain #isObjectMonitorUsageSupported
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   895
     *               object monitor usage}; or</li>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   896
     *           <li>if {@code lockedSynchronizers} is {@code true} but
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   897
     *               the Java virtual machine does not support monitoring
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   898
     *               of {@linkplain #isSynchronizerUsageSupported
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   899
     *               ownable synchronizer usage}.</li>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   900
     *         </ul>
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   901
     *
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   902
     * @see #isObjectMonitorUsageSupported
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   903
     * @see #isSynchronizerUsageSupported
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   904
     *
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   905
     * @since 10
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   906
     */
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   907
    public default ThreadInfo[] dumpAllThreads(boolean lockedMonitors,
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   908
                                               boolean lockedSynchronizers, int maxDepth) {
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   909
        throw new UnsupportedOperationException();
68d46cb9be45 8185003: JMX: Add a version of ThreadMXBean.dumpAllThreads with a maxDepth argument
uvangapally
parents: 47216
diff changeset
   910
    }
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   911
}