Java Doc for VMThreadManager.java in  » Apache-Harmony-Java-SE » java-package » java » lang » 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 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   java.lang.VMThreadManager

VMThreadManager
final class VMThreadManager (Code)
Provides the methods to interact with VM Thread Manager that are used by java.lang.Thread Thread class and java.lang.Object Object synchronization implementation.

A public constructor of the java.lang.Thread class should be called by the VM within startup phase to initialize the main thread. Note that the VMThread.currentThread() method should return a reference to the Thread object even if it hasn't been initialized yet.

This class must be implemented according to the common policy for porting interfaces - see the porting interface overview for more details.



Field Summary
final public static  intTM_ERROR_EBUSY
    
final public static  intTM_ERROR_ILLEGAL_STATE
    
final public static  intTM_ERROR_INTERRUPT
    
final public static  intTM_ERROR_NONE
     Thread Manager functions error codes.
final public static  intTM_THREAD_STATE_ALIVE
    
final public static  intTM_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER
    
final public static  intTM_THREAD_STATE_INTERRUPTED
    
final public static  intTM_THREAD_STATE_IN_NATIVE
    
final public static  intTM_THREAD_STATE_IN_OBJECT_WAIT
    
final public static  intTM_THREAD_STATE_PARKED
    
final public static  intTM_THREAD_STATE_RUNNABLE
    
final public static  intTM_THREAD_STATE_SLEEPING
    
final public static  intTM_THREAD_STATE_SUSPENDED
    
final public static  intTM_THREAD_STATE_TERMINATED
    
final public static  intTM_THREAD_STATE_VENDOR_1
    
final public static  intTM_THREAD_STATE_VENDOR_2
    
final public static  intTM_THREAD_STATE_VENDOR_3
    
final public static  intTM_THREAD_STATE_WAITING
    
final public static  intTM_THREAD_STATE_WAITING_INDEFINITELY
    
final public static  intTM_THREAD_STATE_WAITING_WITH_TIMEOUT
    


Method Summary
static  ThreadcurrentThread()
    
native public static  ThreadcurrentThreadNative()
     This method satisfies the requirements of the specification for the Thread.currentThread Thread.currentThread() method.

But there is one special case.

native static  intgetState(java.lang.Thread thread)
    
native static  booleanholdsLock(Object object)
     This method satisfies the requirements of the specification for the Thread.holdsLock(java.lang.Object) Thread.holdsLock(Object obj) method.
native static  longinit(Thread thread, ThreadWeakRef ref, long oldAddr)
     This method initialize native thread structure as well as inter dependencies between java thread and native thread.
native static  intinterrupt(Thread thread)
     This method satisfies the requirements of the specification for the Thread.interrupt Thread.interrupt() method.
native static  booleanisAlive(Thread thread)
     Checks if the specified thread is dead.

Note: This method is used for the Thread.isAliveThread.isAlive() method implementation.
Parameters:
  thread - the thread to check the status for.

native static  booleanisInterrupted()
     This method satisfies the requirements of the specification for the Thread.interrupted Thread.interrupted() method.
native static  booleanisInterrupted(Thread thread)
     This method satisfies the requirements of the specification for the Thread.isInterrupted Thread.isInterrupted() method.
native static  intnotify(Object object)
     This method satisfies the requirements of the specification for the Object.notify Object.notify() method.
native static  intnotifyAll(Object object)
     This method satisfies the requirements of the specification for the Object.notifyAll Object.notifyAll() method.
native static  intresume(Thread thread)
     This method satisfies the requirements of the specification for the Thread.resume Thread.resume() method.
native static  intsetPriority(Thread thread, int priority)
     Changes the priority of the specified thread.
native static  intsleep(long millis, int nanos)
     This method satisfies the requirements of the specification for the Thread.sleep(longint) Thread.sleep(long timeout, int nanos) method.
native static  intstart(Thread thread, long stackSize, boolean daemon, int priority)
     Starts the specified thread.
native static  intstop(Thread thread, Throwable throwable)
     This method satisfies the requirements of the specification for the Thread.stop(java.lang.Throwable) Thread.stop(Throwable obj) method.
native static  intsuspend(Thread thread)
     This method satisfies the requirements of the specification for the Thread.suspend Thread.suspend() method.
native static  intwait(Object object, long millis, int nanos)
     This method satisfies the requirements of the specification for the Object.wait(longint) Object.wait(long timeout, int nanos) method.
native static  intyield()
     This method satisfies the requirements of the specification for the Thread.yield Thread.yield() method.

Field Detail
TM_ERROR_EBUSY
final public static int TM_ERROR_EBUSY(Code)



TM_ERROR_ILLEGAL_STATE
final public static int TM_ERROR_ILLEGAL_STATE(Code)



TM_ERROR_INTERRUPT
final public static int TM_ERROR_INTERRUPT(Code)



TM_ERROR_NONE
final public static int TM_ERROR_NONE(Code)
Thread Manager functions error codes.



TM_THREAD_STATE_ALIVE
final public static int TM_THREAD_STATE_ALIVE(Code)
JVMTI constants



TM_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER
final public static int TM_THREAD_STATE_BLOCKED_ON_MONITOR_ENTER(Code)



TM_THREAD_STATE_INTERRUPTED
final public static int TM_THREAD_STATE_INTERRUPTED(Code)



TM_THREAD_STATE_IN_NATIVE
final public static int TM_THREAD_STATE_IN_NATIVE(Code)



TM_THREAD_STATE_IN_OBJECT_WAIT
final public static int TM_THREAD_STATE_IN_OBJECT_WAIT(Code)



TM_THREAD_STATE_PARKED
final public static int TM_THREAD_STATE_PARKED(Code)



TM_THREAD_STATE_RUNNABLE
final public static int TM_THREAD_STATE_RUNNABLE(Code)



TM_THREAD_STATE_SLEEPING
final public static int TM_THREAD_STATE_SLEEPING(Code)



TM_THREAD_STATE_SUSPENDED
final public static int TM_THREAD_STATE_SUSPENDED(Code)



TM_THREAD_STATE_TERMINATED
final public static int TM_THREAD_STATE_TERMINATED(Code)



TM_THREAD_STATE_VENDOR_1
final public static int TM_THREAD_STATE_VENDOR_1(Code)



TM_THREAD_STATE_VENDOR_2
final public static int TM_THREAD_STATE_VENDOR_2(Code)



TM_THREAD_STATE_VENDOR_3
final public static int TM_THREAD_STATE_VENDOR_3(Code)



TM_THREAD_STATE_WAITING
final public static int TM_THREAD_STATE_WAITING(Code)



TM_THREAD_STATE_WAITING_INDEFINITELY
final public static int TM_THREAD_STATE_WAITING_INDEFINITELY(Code)



TM_THREAD_STATE_WAITING_WITH_TIMEOUT
final public static int TM_THREAD_STATE_WAITING_WITH_TIMEOUT(Code)





Method Detail
currentThread
static Thread currentThread()(Code)



currentThreadNative
native public static Thread currentThreadNative()(Code)
This method satisfies the requirements of the specification for the Thread.currentThread Thread.currentThread() method.

But there is one special case. When this method is called while initializing the main thread it should return a reference to the main thread object even if it hasn't been initialized yet.

In other words the condition (VMThreadManager.currentThread() == this) should be satisfied for java.lang.Thread object in the only case: this object was created by VM to represent the application's main thread and hasn't been initialized yet.




getState
native static int getState(java.lang.Thread thread)(Code)
Returns the state of the given thread as described by JVMTI spec



holdsLock
native static boolean holdsLock(Object object)(Code)
This method satisfies the requirements of the specification for the Thread.holdsLock(java.lang.Object) Thread.holdsLock(Object obj) method. But it doesn't throw an NullPointerException exception. The object argument must not be null.



init
native static long init(Thread thread, ThreadWeakRef ref, long oldAddr)(Code)
This method initialize native thread structure as well as inter dependencies between java thread and native thread.



interrupt
native static int interrupt(Thread thread)(Code)
This method satisfies the requirements of the specification for the Thread.interrupt Thread.interrupt() method.



isAlive
native static boolean isAlive(Thread thread)(Code)
Checks if the specified thread is dead.

Note: This method is used for the Thread.isAliveThread.isAlive() method implementation.
Parameters:
  thread - the thread to check the status for. true if the thread has died already, false otherwise.




isInterrupted
native static boolean isInterrupted()(Code)
This method satisfies the requirements of the specification for the Thread.interrupted Thread.interrupted() method.



isInterrupted
native static boolean isInterrupted(Thread thread)(Code)
This method satisfies the requirements of the specification for the Thread.isInterrupted Thread.isInterrupted() method.



notify
native static int notify(Object object)(Code)
This method satisfies the requirements of the specification for the Object.notify Object.notify() method.



notifyAll
native static int notifyAll(Object object)(Code)
This method satisfies the requirements of the specification for the Object.notifyAll Object.notifyAll() method.



resume
native static int resume(Thread thread)(Code)
This method satisfies the requirements of the specification for the Thread.resume Thread.resume() method.



setPriority
native static int setPriority(Thread thread, int priority)(Code)
Changes the priority of the specified thread.

Note: This method is used for the Thread.setPriority(int)Thread.setPriority(int newPriority) method implementation.
Parameters:
  thread - the thread to change the priority for
Parameters:
  priority - new priority value




sleep
native static int sleep(long millis, int nanos)(Code)
This method satisfies the requirements of the specification for the Thread.sleep(longint) Thread.sleep(long timeout, int nanos) method. But it doesn't throw an IllegalArgumentException exception. The millis and nanos arguments must be valid.



start
native static int start(Thread thread, long stackSize, boolean daemon, int priority)(Code)
Starts the specified thread. Causes JVM to start executing run() method of the specified thread.

The method allows to set the stack size for the thread specified in its Thread.Thread(java.lang.ThreadGroupjava.lang.Runnablejava.lang.Stringlong) constructor .

Note: This method is used for the Thread.startThread.start() method implementation.
Parameters:
  thread - the thread to be started
Parameters:
  size - the desired stack size in bytes or zero to be ignored




stop
native static int stop(Thread thread, Throwable throwable)(Code)
This method satisfies the requirements of the specification for the Thread.stop(java.lang.Throwable) Thread.stop(Throwable obj) method. But it doesn't throw an NullPointerException exception. The throwable argument must not be null.



suspend
native static int suspend(Thread thread)(Code)
This method satisfies the requirements of the specification for the Thread.suspend Thread.suspend() method.



wait
native static int wait(Object object, long millis, int nanos) throws InterruptedException(Code)
This method satisfies the requirements of the specification for the Object.wait(longint) Object.wait(long timeout, int nanos) method. But it doesn't throw an IllegalArgumentException exception. The millis and nanos arguments must be valid.



yield
native static int yield()(Code)
This method satisfies the requirements of the specification for the Thread.yield Thread.yield() method.



Methods inherited from java.lang.Object
protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object object)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final public Class<? extends Object> getClass()(Code)(Java Doc)
public int hashCode()(Code)(Java Doc)
final public void notify()(Code)(Java Doc)
final public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final public void wait(long millis, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait(long millis) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

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