Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 199756 Details for
Bug 352230
Proposed patch to add daemon flag to Thread Overview and Details
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read
this important communication.
[patch]
Patch to add daemon column
daemonthread.patch (text/plain), 4.33 KB, created by
Kevin Grigorenko
on 2011-07-15 12:08:06 EDT
(
hide
)
Description:
Patch to add daemon column
Filename:
MIME Type:
Creator:
Kevin Grigorenko
Created:
2011-07-15 12:08:06 EDT
Size:
4.33 KB
patch
obsolete
>### Eclipse Workspace Patch 1.0 >#P org.eclipse.mat.api >Index: src/org/eclipse/mat/inspections/threads/ThreadInfoImpl.java >=================================================================== >--- src/org/eclipse/mat/inspections/threads/ThreadInfoImpl.java (revision 1164) >+++ src/org/eclipse/mat/inspections/threads/ThreadInfoImpl.java (working copy) >@@ -46,12 +46,14 @@ > private static final Column COL_SHALLOW = new Column(Messages.Column_ShallowHeap, int.class); > private static final Column COL_RETAINED = new Column(Messages.Column_RetainedHeap, long.class); > private static final Column COL_CONTEXTCL = new Column(Messages.ThreadInfoImpl_Column_ContextClassLoader); >+ private static final Column COL_ISDAEMON = new Column(Messages.ThreadInfoImpl_Column_IsDaemon, Boolean.class); > > private static final List<Column> defaultColumns = Arrays.asList(new Column[] { COL_NAME, // > COL_INSTANCE, // > COL_SHALLOW, // > COL_RETAINED, // >- COL_CONTEXTCL }); >+ COL_CONTEXTCL, >+ COL_ISDAEMON}); > > // ////////////////////////////////////////////////////////////// > // factory methods >@@ -109,6 +111,7 @@ > info.instance = info.subject.getTechnicalName(); > info.shallowHeap = info.subject.getUsedHeapSize(); > info.retainedHeap = info.subject.getRetainedHeapSize(); >+ info.isDaemon = resolveIsDaemon(info.subject); > > IObject contextClassLoader = (IObject) info.subject.resolveValue("contextClassLoader"); //$NON-NLS-1$ > if (contextClassLoader != null) >@@ -120,6 +123,27 @@ > } > } > >+ private static Boolean resolveIsDaemon(IObject thread) >+ { >+ try >+ { >+ Object daemon = thread.resolveValue("daemon"); >+ if (daemon == null) { >+ daemon = thread.resolveValue("isDaemon"); >+ } >+ if (daemon != null) { >+ if (daemon instanceof Boolean) { >+ return (Boolean)daemon; >+ } >+ } >+ } >+ catch (SnapshotException e) >+ { >+ // Failing to get daemon status is not the end of the world >+ } >+ return null; >+ } >+ > private static void extractFromDetailsResolver(ThreadInfoImpl info, boolean readFully, IProgressListener listener) > throws SnapshotException > { >@@ -185,6 +209,7 @@ > private long retainedHeap; > private String contextClassLoader; > private int contextClassLoaderId; >+ private Boolean isDaemon; > > // extended properties > private Map<Column, Object> properties = new HashMap<Column, Object>(); >@@ -273,6 +298,11 @@ > { > return requests; > } >+ >+ private Object isDaemon() >+ { >+ return isDaemon; >+ } > > public Object getValue(Column column) > { >@@ -286,6 +316,8 @@ > return getRetainedHeap(); > else if (column == COL_CONTEXTCL) > return getContextClassLoader(); >+ else if (column == COL_ISDAEMON) >+ return isDaemon(); > else > return properties.get(column); > } >Index: src/org/eclipse/mat/internal/Messages.java >=================================================================== >--- src/org/eclipse/mat/internal/Messages.java (revision 1164) >+++ src/org/eclipse/mat/internal/Messages.java (working copy) >@@ -507,6 +510,7 @@ > public static String TaskInfo_State_WaitingSyncIO; > > public static String ThreadInfoImpl_Column_ContextClassLoader; >+ public static String ThreadInfoImpl_Column_IsDaemon; > public static String ThreadInfoImpl_Column_Instance; > public static String ThreadInfoImpl_Column_Name; > >Index: src/org/eclipse/mat/internal/messages.properties >=================================================================== >--- src/org/eclipse/mat/internal/messages.properties (revision 1164) >+++ src/org/eclipse/mat/internal/messages.properties (working copy) >@@ -447,6 +450,7 @@ > TaskInfo_State_Waiting=waiting for a task > TaskInfo_State_WaitingSyncIO=waiting for sync. I/O > ThreadInfoImpl_Column_ContextClassLoader=Context Class Loader >+ThreadInfoImpl_Column_IsDaemon=Daemon thread? > ThreadInfoImpl_Column_Instance=Instance > ThreadInfoImpl_Column_Name=Name > ThreadInfoQuery_Requests=Requests
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 352230
: 199756