Class ThreadDumps
- java.lang.Object
-
- com.cloudbees.jenkins.support.api.Component
-
- com.cloudbees.jenkins.support.api.ObjectComponent<Computer>
-
- com.cloudbees.jenkins.support.impl.ThreadDumps
-
- All Implemented Interfaces:
ExtensionPoint
,Describable<ObjectComponent<Computer>>
@Extension(ordinal=-100.0) public class ThreadDumps extends ObjectComponent<Computer>
Thread dumps from the nodes.- Author:
- Stephen Connolly
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
ThreadDumps.DescriptorImpl
-
Nested classes/interfaces inherited from class com.cloudbees.jenkins.support.api.Component
Component.ComponentCategory
-
Nested classes/interfaces inherited from interface hudson.ExtensionPoint
ExtensionPoint.LegacyInstancesAreScopedToHudson
-
-
Constructor Summary
Constructors Constructor Description ThreadDumps()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description void
addContents(Container result)
Add contents to a containervoid
addContents(Container container, Computer item)
Add contents from a specific item to a containerComponent.ComponentCategory
getCategory()
Specify in whichComponent.ComponentCategory
the current component is related.ThreadDumps.DescriptorImpl
getDescriptor()
String
getDisplayName()
Set<Permission>
getRequiredPermissions()
Returns the (possibly empty, never null) list of permissions that are required for the user to include this in a bundle.hudson.remoting.Future<String>
getThreadDump(Node node)
static String
getThreadDump(hudson.remoting.VirtualChannel channel)
Deprecated.boolean
isApplicable(Computer item)
Return if this component is applicable to a specific item.<C extends AbstractModelObject>
booleanisApplicable(Class<C> clazz)
Return if this component is applicable to a specific class of item.static void
printThreadInfo(PrintWriter writer, ThreadInfo t, ThreadMXBean mbean)
static void
printThreadInfo(PrintWriter writer, ThreadInfo t, ThreadMXBean mbean, ContentFilter filter)
Prints theThreadInfo
(becauseThreadInfo.toString()
caps out the stack trace at 8 frames).static void
threadDump(OutputStream out)
Dumps all of the threads' current information to an output stream.static void
threadDumpLegacy(OutputStream out)
Deprecated.static void
threadDumpModern(OutputStream out)
Deprecated.-
Methods inherited from class com.cloudbees.jenkins.support.api.ObjectComponent
allInstances, for_, isSelectedByDefault
-
Methods inherited from class com.cloudbees.jenkins.support.api.Component
getDisplayPermissions, getId, isEnabled, isSelectedByDefault, start
-
-
-
-
Method Detail
-
getRequiredPermissions
@NonNull public Set<Permission> getRequiredPermissions()
Description copied from class:Component
Returns the (possibly empty, never null) list of permissions that are required for the user to include this in a bundle. An empty list indicates that any user can include this bundle.- Specified by:
getRequiredPermissions
in classComponent
- Returns:
- the (possibly empty, never null) list of permissions that are required for the user to include this in a bundle.
-
getDisplayName
@NonNull public String getDisplayName()
- Specified by:
getDisplayName
in classComponent
-
isApplicable
public <C extends AbstractModelObject> boolean isApplicable(Class<C> clazz)
Description copied from class:ObjectComponent
Return if this component is applicable to a specific class of item.- Overrides:
isApplicable
in classObjectComponent<Computer>
- Type Parameters:
C
- Object that extendsAbstractModelObject
- Parameters:
clazz
- the class- Returns:
true
if applicable to this class
-
isApplicable
public boolean isApplicable(Computer item)
Description copied from class:ObjectComponent
Return if this component is applicable to a specific item.- Overrides:
isApplicable
in classObjectComponent<Computer>
- Parameters:
item
- the item- Returns:
- true if applicable
-
addContents
public void addContents(@NonNull Container result)
Description copied from class:ObjectComponent
Add contents to a container- Overrides:
addContents
in classObjectComponent<Computer>
- Parameters:
result
- aContainer
-
addContents
public void addContents(@NonNull Container container, @NonNull Computer item)
Description copied from class:ObjectComponent
Add contents from a specific item to a container- Specified by:
addContents
in classObjectComponent<Computer>
- Parameters:
container
- theContainer
item
- the item
-
getCategory
@NonNull public Component.ComponentCategory getCategory()
Description copied from class:Component
Specify in whichComponent.ComponentCategory
the current component is related.- Overrides:
getCategory
in classComponent
- Returns:
- An enum value of
Component.ComponentCategory
.
-
getThreadDump
public hudson.remoting.Future<String> getThreadDump(Node node) throws IOException
- Throws:
IOException
-
getThreadDump
@Deprecated public static String getThreadDump(hudson.remoting.VirtualChannel channel) throws IOException, InterruptedException
Deprecated.- Throws:
IOException
InterruptedException
-
threadDump
public static void threadDump(OutputStream out) throws UnsupportedEncodingException
Dumps all of the threads' current information to an output stream.- Parameters:
out
- an output stream.- Throws:
UnsupportedEncodingException
- if the utf-8 encoding is not supported.
-
printThreadInfo
public static void printThreadInfo(PrintWriter writer, ThreadInfo t, ThreadMXBean mbean)
-
printThreadInfo
public static void printThreadInfo(PrintWriter writer, ThreadInfo t, ThreadMXBean mbean, @CheckForNull ContentFilter filter)
Prints theThreadInfo
(becauseThreadInfo.toString()
caps out the stack trace at 8 frames). It filters the content with the filter. It's used by other components, likeDeadlockRequestComponent
viaDeadlockTrackChecker
- Parameters:
writer
- the writer to print to.t
- the thread to printmbean
- theThreadMXBean
to use.filter
- theContentFilter
to use for filtering the thread name.
-
threadDumpModern
@Deprecated public static void threadDumpModern(OutputStream out) throws UnsupportedEncodingException
Deprecated.- Throws:
UnsupportedEncodingException
-
threadDumpLegacy
@Deprecated public static void threadDumpLegacy(OutputStream out) throws UnsupportedEncodingException
Deprecated.- Throws:
UnsupportedEncodingException
-
getDescriptor
public ThreadDumps.DescriptorImpl getDescriptor()
Description copied from class:ObjectComponent
- Specified by:
getDescriptor
in interfaceDescribable<ObjectComponent<Computer>>
- Overrides:
getDescriptor
in classObjectComponent<Computer>
-
-