Java Doc for ThreadMXBean.java in  » Apache-Harmony-Java-SE » java-package » java » lang » management » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Apache Harmony Java SE » java package » java.lang.management 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.management.ThreadMXBean

ThreadMXBean
public interface ThreadMXBean (Code)

ThreadMXBean is an interface used by the management system to access thread-related properties.

ObjectName: java.lang:type=Threading


since:
   1.5




Method Summary
 long[]findMonitorDeadlockedThreads()
    

Finds cycles of threads that are in deadlock waiting to acquire and object monitor.

 long[]getAllThreadIds()
    

The ID of all currently live threads.

 longgetCurrentThreadCpuTime()
    

The total CPU time (in nanoseconds) for the current thread.

 longgetCurrentThreadUserTime()
    

The total user time (in nanoseconds) for the current thread.

 intgetDaemonThreadCount()
    

The current number of live daemon threads.

 intgetPeakThreadCount()
    

The peak number of live threads since JVM start or the last reset.

 intgetThreadCount()
    

The current number of live threads (daemon and non-daemon).

 longgetThreadCpuTime(long id)
    

The total CPU time (in nanoseconds) for the given thread.


Parameters:
  id - The ID of the thread to get the CPU time for.
 ThreadInfogetThreadInfo(long id)
    

The thread information for the given thread with a stack trace depth of zero.


Parameters:
  id - The ID of the thread to get information for.
 ThreadInfo[]getThreadInfo(long[] ids)
    

The thread information for the given threads with a stack trace depth of zero.


Parameters:
  ids - An array of IDs of the threads to get information for.
 ThreadInfo[]getThreadInfo(long[] ids, int maxDepth)
    

The thread information for the given threads, which is qualified by a maximum stack trace depth.


Parameters:
  ids - An array of IDs of the threads to get information for.
Parameters:
  maxDepth - The maximum depth of the stack trace to return in theThreadInfo.
 ThreadInfogetThreadInfo(long id, int maxDepth)
    

The thread information for the given thread with a stack trace depth of zero.


Parameters:
  id - The ID of the thread to get information for.
Parameters:
  maxDepth - The maximum depth of the stack trace to return in theThreadInfo.
 longgetThreadUserTime(long id)
    

The total user time (in nanoseconds) for the given thread.


Parameters:
  id - The ID of the thread to get the user time for.
 longgetTotalStartedThreadCount()
    

The total number of threads that have been created and started within the JVM.

 booleanisCurrentThreadCpuTimeSupported()
    

Indicates whether or not current thread CPU time monitoring is supported.

 booleanisThreadContentionMonitoringEnabled()
    

Indicates whether or not thread contention monitoring is enabled.

 booleanisThreadContentionMonitoringSupported()
    

Indicates whether or not thread contention monitoring is supported.

 booleanisThreadCpuTimeEnabled()
    

Indicates whether or not thread CPU time monitoring is enabled.

 booleanisThreadCpuTimeSupported()
    

Indicates whether or not thread CPU time monitoring is supported.

 voidresetPeakThreadCount()
    

Resets the peak thread count to the current thread count.

 voidsetThreadContentionMonitoringEnabled(boolean enable)
    

Enables or disables thread contention monitoring.

 voidsetThreadCpuTimeEnabled(boolean enable)
    

Enables or disables thread CPU time monitoring.




Method Detail
findMonitorDeadlockedThreads
long[] findMonitorDeadlockedThreads()(Code)

Finds cycles of threads that are in deadlock waiting to acquire and object monitor.

An array of thread IDs of deadlocked.
throws:
  SecurityException - if caller doesn't haveManagementPermission("monitor").
See Also:   Thread.getId



getAllThreadIds
long[] getAllThreadIds()(Code)

The ID of all currently live threads.

An array of thread IDs.
throws:
  SecurityException - if caller doesn't haveManagementPermission("monitor").
See Also:   Thread.getId



getCurrentThreadCpuTime
long getCurrentThreadCpuTime()(Code)

The total CPU time (in nanoseconds) for the current thread. This is convenience method for ThreadMXBean.getThreadCpuTime(long) getThreadCpuTime (Thread.currentThread().getId());.

The total CPU time for the current thread.
throws:
  UnsupportedOperationException - if this is not supported.



getCurrentThreadUserTime
long getCurrentThreadUserTime()(Code)

The total user time (in nanoseconds) for the current thread. This is convenience method for ThreadMXBean.getThreadUserTime(long) getThreadUserTime (Thread.currentThread().getId());.

The total user time for the current thread.
throws:
  UnsupportedOperationException - if this is not supported.



getDaemonThreadCount
int getDaemonThreadCount()(Code)

The current number of live daemon threads.

The number of daemon threads.



getPeakThreadCount
int getPeakThreadCount()(Code)

The peak number of live threads since JVM start or the last reset.

The peak number of threads.
See Also:   ThreadMXBean.resetPeakThreadCount()



getThreadCount
int getThreadCount()(Code)

The current number of live threads (daemon and non-daemon).

The number of threads.



getThreadCpuTime
long getThreadCpuTime(long id)(Code)

The total CPU time (in nanoseconds) for the given thread.


Parameters:
  id - The ID of the thread to get the CPU time for. The total CPU time for the current thread or -1 if the thread isnot alive or measurement is not enabled.
throws:
  IllegalArgumentException - if id is less than orequal to 0.
throws:
  UnsupportedOperationException - if this is not supported.



getThreadInfo
ThreadInfo getThreadInfo(long id)(Code)

The thread information for the given thread with a stack trace depth of zero.


Parameters:
  id - The ID of the thread to get information for. A ThreadInfo instance representing the information of thegiven thread or null if the thread is not alive ordoesn't exist.
throws:
  IllegalArgumentException - if id is less than orequal to 0.
throws:
  SecurityException - if caller doesn't haveManagementPermission("monitor").



getThreadInfo
ThreadInfo[] getThreadInfo(long[] ids)(Code)

The thread information for the given threads with a stack trace depth of zero.


Parameters:
  ids - An array of IDs of the threads to get information for. An array of ThreadInfo instance representing theinformation of the given threads.
throws:
  IllegalArgumentException - if and element in ids isless than or equal to 0.
throws:
  SecurityException - if caller doesn't haveManagementPermission("monitor").



getThreadInfo
ThreadInfo[] getThreadInfo(long[] ids, int maxDepth)(Code)

The thread information for the given threads, which is qualified by a maximum stack trace depth.


Parameters:
  ids - An array of IDs of the threads to get information for.
Parameters:
  maxDepth - The maximum depth of the stack trace to return in theThreadInfo. If zero, then an empty array is stored. IfInteger.MAX_VALUE, then the entire stack trace isreturned. An array of ThreadInfo instance representing theinformation of the given threads.
throws:
  IllegalArgumentException - if and element in ids isless than or equal to 0.
throws:
  SecurityException - if caller doesn't haveManagementPermission("monitor").



getThreadInfo
ThreadInfo getThreadInfo(long id, int maxDepth)(Code)

The thread information for the given thread with a stack trace depth of zero.


Parameters:
  id - The ID of the thread to get information for.
Parameters:
  maxDepth - The maximum depth of the stack trace to return in theThreadInfo. If zero, then an empty array is stored. IfInteger.MAX_VALUE, then the entire stack trace isreturned. A ThreadInfo instance representing the information of thegiven thread or null if the thread is not alive ordoesn't exist.
throws:
  IllegalArgumentException - if id is less than orequal to 0.
throws:
  SecurityException - if caller doesn't haveManagementPermission("monitor").



getThreadUserTime
long getThreadUserTime(long id)(Code)

The total user time (in nanoseconds) for the given thread.


Parameters:
  id - The ID of the thread to get the user time for. The total user time for the current thread or -1 if the thread isnot alive or measurement is not enabled.
throws:
  IllegalArgumentException - if id is less than orequal to 0.
throws:
  UnsupportedOperationException - if this is not supported.



getTotalStartedThreadCount
long getTotalStartedThreadCount()(Code)

The total number of threads that have been created and started within the JVM.

The total number of created and started threads.



isCurrentThreadCpuTimeSupported
boolean isCurrentThreadCpuTimeSupported()(Code)

Indicates whether or not current thread CPU time monitoring is supported.

true if supported, otherwise false.



isThreadContentionMonitoringEnabled
boolean isThreadContentionMonitoringEnabled()(Code)

Indicates whether or not thread contention monitoring is enabled.

true if enabled, otherwise false.



isThreadContentionMonitoringSupported
boolean isThreadContentionMonitoringSupported()(Code)

Indicates whether or not thread contention monitoring is supported.

true if supported, otherwise false.



isThreadCpuTimeEnabled
boolean isThreadCpuTimeEnabled()(Code)

Indicates whether or not thread CPU time monitoring is enabled.

true if enabled, otherwise false.



isThreadCpuTimeSupported
boolean isThreadCpuTimeSupported()(Code)

Indicates whether or not thread CPU time monitoring is supported.

true if supported, otherwise false.



resetPeakThreadCount
void resetPeakThreadCount()(Code)

Resets the peak thread count to the current thread count.


throws:
  SecurityException - if caller doesn't haveManagementPermission("control").



setThreadContentionMonitoringEnabled
void setThreadContentionMonitoringEnabled(boolean enable)(Code)

Enables or disables thread contention monitoring.


Parameters:
  enable - true to enable, false todisable.
throws:
  UnsupportedOperationException - if this is not supported.
throws:
  SecurityException - if caller doesn't haveManagementPermission("control").
See Also:   ThreadMXBean.isThreadContentionMonitoringSupported()



setThreadCpuTimeEnabled
void setThreadCpuTimeEnabled(boolean enable)(Code)

Enables or disables thread CPU time monitoring.


Parameters:
  enable - true to enable, false todisable.
throws:
  UnsupportedOperationException - if this is not supported.
throws:
  SecurityException - if caller doesn't haveManagementPermission("control").
See Also:   ThreadMXBean.isThreadCpuTimeSupported()



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.