Class RecordedThread
java.lang.Object
jdk.jfr.consumer.RecordedObject
jdk.jfr.consumer.RecordedThread
-
Method Summary
Modifier and TypeMethodDescriptionlonggetId()Returns a unique ID for both native threads and Java threads that can't be reused within the lifespan of the JVM.Returns the Java thread name, ornullif doesn't exist.longReturns the Java thread ID, or-1if it's not a Java thread.Returns the thread name used by the operating system.longReturns the thread ID used by the operating system.Returns the Java thread group, if available.booleanReturnstrueif this is a virtual Thread,falseotherwise.Methods declared in class RecordedObject
getBoolean, getByte, getChar, getClass, getDouble, getDuration, getFields, getFloat, getInstant, getInt, getLong, getShort, getString, getThread, getValue, hasField, toStringModifier and TypeMethodDescriptionfinal booleangetBoolean(String name) Returns the value of a field of typeboolean.final byteReturns the value of a field of typebyte.final charReturns the value of a field of typechar.final RecordedClassReturns the value of a field of typeClass.final doubleReturns the value of a field of typedoubleor of another primitive type that is convertible to typedoubleby a widening conversion.final DurationgetDuration(String name) Returns the value of a timespan field.Returns an immutable list of the fields for this object.final floatReturns the value of a field of typefloator of another primitive type convertible to typefloatby a widening conversion.final InstantgetInstant(String name) Returns the value of a timestamp field.final intReturns the value of a field of typeintor of another primitive type that is convertible to typeintby a widening conversion.final longReturns the value of a field of typelongor of another primitive type that is convertible to typelongby a widening conversion.final shortReturns the value of a field of typeshortor of another primitive type convertible to typeshortby a widening conversion.final StringReturns the value of a field of typeString.final RecordedThreadReturns the value of a field of typeThread.final <T> TReturns the value of the field with the given name.booleanReturnstrueif a field with the given name exists,falseotherwise.final StringtoString()Returns a textual representation of this object.Methods declared in class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitModifier and TypeMethodDescriptionprotected Objectclone()Answers a new instance of the same class as the receiver, whose slots have been filled in with the values in the slots of the receiver.booleanCompares the argument to the receiver, and answers true if they represent the same object using a class specific comparison.protected voidfinalize()Deprecated, for removal: This API element is subject to removal in a future version.May cause performance issues, deadlocks and hangs.getClass()Answers the unique instance of java.lang.Class which represents the class of the receiver.inthashCode()Answers an integer hash code for the receiver.final voidnotify()Causes one thread which iswaiting on the receiver to be made ready to run.final voidCauses all threads which arewaiting on the receiver to be made ready to run.final voidwait()Causes the thread which sent this message to be made not ready to run pending some change in the receiver (as indicated bynotifyornotifyAll).final voidwait(long time) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.final voidwait(long time, int frac) Causes the thread which sent this message to be made not ready to run either pending some change in the receiver (as indicated bynotifyornotifyAll) or the expiration of the timeout.
-
Method Details
-
getOSName
Returns the thread name used by the operating system.- Returns:
- the OS thread name, or
nullif doesn't exist
-
getOSThreadId
public long getOSThreadId()Returns the thread ID used by the operating system.- Returns:
- the OS thread ID, or
-1if doesn't exist
-
getThreadGroup
Returns the Java thread group, if available.- Returns:
- the thread group, or
nullif doesn't exist
-
getJavaName
Returns the Java thread name, ornullif doesn't exist.Returns
java.lang.Thread.getName()if the thread has a Java representation.nullotherwise.- Returns:
- the Java thread name, or
nullif doesn't exist
-
getJavaThreadId
public long getJavaThreadId()Returns the Java thread ID, or-1if it's not a Java thread.- Returns:
- the Java thread ID, or
-1if it's not a Java thread - See Also:
-
getId
public long getId()Returns a unique ID for both native threads and Java threads that can't be reused within the lifespan of the JVM.See
getJavaThreadId()for the ID that is returned byjava.lang.Thread.threadId().See
getOSThreadId()for the ID that is returned by the operating system.- Returns:
- a unique ID for the thread
-
isVirtual
public boolean isVirtual()Returnstrueif this is a virtual Thread,falseotherwise.- Returns:
trueif this is a virtual Thread,falseotherwise- Since:
- 21
-