Java Code Examples for java.lang.management.ThreadInfo#from()
The following examples show how to use
java.lang.management.ThreadInfo#from() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ThreadInfoCompositeData.java From jdk8u-dev-jdk with GNU General Public License v2.0 | 6 votes |
public static void badNameCompositeData() throws Exception { CompositeType ct = new CompositeType("MyCompositeType", "CompositeType for ThreadInfo", badItemNames, badItemNames, validItemTypes); CompositeData cd = new CompositeDataSupport(ct, badItemNames, values); try { ThreadInfo info = ThreadInfo.from(cd); } catch (IllegalArgumentException e) { System.out.println("Expected exception: " + e.getMessage()); return; } throw new RuntimeException( "IllegalArgumentException not thrown"); }
Example 2
Source File: ThreadInfoCompositeData.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public static void badTypeCompositeData() throws Exception { CompositeType ct = new CompositeType("MyCompositeType", "CompositeType for ThreadInfo", validItemNames, validItemNames, badItemTypes); // patch values[STACK_TRACE] to Long values[STACK_TRACE] = new Long(1000); values[LOCK_INFO] = new Long(1000); CompositeData cd = new CompositeDataSupport(ct, validItemNames, values); try { ThreadInfo info = ThreadInfo.from(cd); } catch (IllegalArgumentException e) { System.out.println("Expected exception: " + e.getMessage()); return; } throw new RuntimeException( "IllegalArgumentException not thrown"); }
Example 3
Source File: ThreadInfoCompositeData.java From openjdk-jdk8u with GNU General Public License v2.0 | 6 votes |
public static void createV5ThreadInfo() throws Exception { String[] v5ItemNames = new String[NUM_V5_ATTS]; OpenType[] v5ItemTypes = new OpenType[NUM_V5_ATTS]; Object[] v5ItemValues = new Object[NUM_V5_ATTS]; for (int i = 0; i < NUM_V5_ATTS; i++) { v5ItemNames[i] = validItemNames[i]; v5ItemTypes[i] = validItemTypes[i]; v5ItemValues[i] = values[i]; } CompositeType ct = new CompositeType("MyCompositeType", "CompositeType for JDK 5.0 ThreadInfo", v5ItemNames, v5ItemNames, v5ItemTypes); CompositeData cd = new CompositeDataSupport(ct, v5ItemNames, v5ItemValues); ThreadInfo info = ThreadInfo.from(cd); checkThreadInfo(info); }
Example 4
Source File: ThreadInfoCompositeData.java From openjdk-jdk9 with GNU General Public License v2.0 | 6 votes |
public static void badNameCompositeData() throws Exception { CompositeType ct = new CompositeType("MyCompositeType", "CompositeType for ThreadInfo", badItemNames, badItemNames, validItemTypes); CompositeData cd = new CompositeDataSupport(ct, badItemNames, values); try { ThreadInfo info = ThreadInfo.from(cd); } catch (IllegalArgumentException e) { System.out.println("Expected exception: " + e.getMessage()); return; } throw new RuntimeException( "IllegalArgumentException not thrown"); }
Example 5
Source File: ThreadInfoCompositeData.java From openjdk-8 with GNU General Public License v2.0 | 6 votes |
public static void badTypeCompositeData() throws Exception { CompositeType ct = new CompositeType("MyCompositeType", "CompositeType for ThreadInfo", validItemNames, validItemNames, badItemTypes); // patch values[STACK_TRACE] to Long values[STACK_TRACE] = new Long(1000); values[LOCK_INFO] = new Long(1000); CompositeData cd = new CompositeDataSupport(ct, validItemNames, values); try { ThreadInfo info = ThreadInfo.from(cd); } catch (IllegalArgumentException e) { System.out.println("Expected exception: " + e.getMessage()); return; } throw new RuntimeException( "IllegalArgumentException not thrown"); }
Example 6
Source File: ThreadInfoCompositeData.java From native-obfuscator with GNU General Public License v3.0 | 6 votes |
public static void badTypeCompositeData() throws Exception { CompositeType ct = new CompositeType("MyCompositeType", "CompositeType for ThreadInfo", validItemNames, validItemNames, badItemTypes); // patch values[STACK_TRACE] to Long values[STACK_TRACE] = new Long(1000); values[LOCK_INFO] = new Long(1000); CompositeData cd = new CompositeDataSupport(ct, validItemNames, values); try { ThreadInfo info = ThreadInfo.from(cd); } catch (IllegalArgumentException e) { System.out.println("Expected exception: " + e.getMessage()); return; } throw new RuntimeException( "IllegalArgumentException not thrown"); }
Example 7
Source File: ThreadInfoCompositeData.java From TencentKona-8 with GNU General Public License v2.0 | 6 votes |
public static void badTypeCompositeData() throws Exception { CompositeType ct = new CompositeType("MyCompositeType", "CompositeType for ThreadInfo", validItemNames, validItemNames, badItemTypes); // patch values[STACK_TRACE] to Long values[STACK_TRACE] = new Long(1000); values[LOCK_INFO] = new Long(1000); CompositeData cd = new CompositeDataSupport(ct, validItemNames, values); try { ThreadInfo info = ThreadInfo.from(cd); } catch (IllegalArgumentException e) { System.out.println("Expected exception: " + e.getMessage()); return; } throw new RuntimeException( "IllegalArgumentException not thrown"); }
Example 8
Source File: ThreadInfoCompositeData.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public static void badNameCompositeData() throws Exception { CompositeType ct = new CompositeType("MyCompositeType", "CompositeType for ThreadInfo", badItemNames, badItemNames, validItemTypes); CompositeData cd = new CompositeDataSupport(ct, badItemNames, values); try { ThreadInfo info = ThreadInfo.from(cd); } catch (IllegalArgumentException e) { System.out.println("Expected exception: " + e.getMessage()); return; } throw new RuntimeException( "IllegalArgumentException not thrown"); }
Example 9
Source File: ThreadInfoCompositeData.java From openjdk-8-source with GNU General Public License v2.0 | 6 votes |
public static void badNameCompositeData() throws Exception { CompositeType ct = new CompositeType("MyCompositeType", "CompositeType for ThreadInfo", badItemNames, badItemNames, validItemTypes); CompositeData cd = new CompositeDataSupport(ct, badItemNames, values); try { ThreadInfo info = ThreadInfo.from(cd); } catch (IllegalArgumentException e) { System.out.println("Expected exception: " + e.getMessage()); return; } throw new RuntimeException( "IllegalArgumentException not thrown"); }
Example 10
Source File: ThreadInfoCompositeData.java From jdk8u-jdk with GNU General Public License v2.0 | 6 votes |
public static void badNameCompositeData() throws Exception { CompositeType ct = new CompositeType("MyCompositeType", "CompositeType for ThreadInfo", badItemNames, badItemNames, validItemTypes); CompositeData cd = new CompositeDataSupport(ct, badItemNames, values); try { ThreadInfo info = ThreadInfo.from(cd); } catch (IllegalArgumentException e) { System.out.println("Expected exception: " + e.getMessage()); return; } throw new RuntimeException( "IllegalArgumentException not thrown"); }
Example 11
Source File: ThreadInfoCompositeData.java From openjdk-8-source with GNU General Public License v2.0 | 5 votes |
public static void createGoodCompositeData() throws Exception { CompositeType ct = new CompositeType("MyCompositeType", "CompositeType for ThreadInfo", validItemNames, validItemNames, validItemTypes); CompositeData cd = new CompositeDataSupport(ct, validItemNames, values); ThreadInfo info = ThreadInfo.from(cd); checkThreadInfo(info); }
Example 12
Source File: ThreadInfoCompositeData.java From native-obfuscator with GNU General Public License v3.0 | 5 votes |
public static void createGoodCompositeData() throws Exception { CompositeType ct = new CompositeType("MyCompositeType", "CompositeType for ThreadInfo", validItemNames, validItemNames, validItemTypes); CompositeData cd = new CompositeDataSupport(ct, validItemNames, values); ThreadInfo info = ThreadInfo.from(cd); checkThreadInfo(info); }
Example 13
Source File: ThreadDump.java From visualvm with GNU General Public License v2.0 | 5 votes |
public ThreadInfo[] getThreads() { synchronized (tinfoLock) { if (tinfos == null) { int i = 0; tinfos = new ThreadInfo[cdThreads.length]; for (Object cd : cdThreads) { tinfos[i++] = ThreadInfo.from((CompositeData) cd); } cdThreads = null; } return tinfos; } }
Example 14
Source File: ThreadInfoCompositeData.java From dragonwell8_jdk with GNU General Public License v2.0 | 5 votes |
public static void createGoodCompositeData() throws Exception { CompositeType ct = new CompositeType("MyCompositeType", "CompositeType for ThreadInfo", validItemNames, validItemNames, validItemTypes); CompositeData cd = new CompositeDataSupport(ct, validItemNames, values); ThreadInfo info = ThreadInfo.from(cd); checkThreadInfo(info); }
Example 15
Source File: StackTraceSnapshotBuilderTest.java From netbeans with Apache License 2.0 | 5 votes |
private void addStacktrace(java.lang.management.ThreadInfo[] tinfos, long time) { java.lang.management.ThreadInfo[] newInfo = new java.lang.management.ThreadInfo[tinfos.length]; int i = 0; for (java.lang.management.ThreadInfo tinfo : tinfos) { CompositeData aaa = ThreadInfoCompositeData.toCompositeData(tinfo); newInfo[i++] = ThreadInfo.from(aaa); } instance.addStacktrace(newInfo, time); }
Example 16
Source File: StackTraceSnapshotBuilderTest.java From visualvm with GNU General Public License v2.0 | 5 votes |
private void addStacktrace(java.lang.management.ThreadInfo[] tinfos, long time) { java.lang.management.ThreadInfo[] newInfo = new java.lang.management.ThreadInfo[tinfos.length]; int i = 0; for (java.lang.management.ThreadInfo tinfo : tinfos) { CompositeData aaa = ThreadInfoCompositeData.toCompositeData(tinfo); newInfo[i++] = ThreadInfo.from(aaa); } instance.addStacktrace(newInfo, time); }
Example 17
Source File: ThreadInfoCompositeData.java From openjdk-jdk9 with GNU General Public License v2.0 | 5 votes |
public static void createGoodCompositeData() throws Exception { CompositeType ct = new CompositeType("MyCompositeType", "CompositeType for ThreadInfo", validItemNames, validItemNames, validItemTypes); CompositeData cd = new CompositeDataSupport(ct, validItemNames, values); ThreadInfo info = ThreadInfo.from(cd); checkThreadInfo(info); }
Example 18
Source File: ThreadDump.java From netbeans with Apache License 2.0 | 5 votes |
public ThreadInfo[] getThreads() { synchronized (tinfoLock) { if (tinfos == null) { int i = 0; tinfos = new ThreadInfo[cdThreads.length]; for (Object cd : cdThreads) { tinfos[i++] = ThreadInfo.from((CompositeData) cd); } cdThreads = null; } return tinfos; } }
Example 19
Source File: ThreadInfoCompositeData.java From openjdk-jdk8u with GNU General Public License v2.0 | 5 votes |
public static void createGoodCompositeData() throws Exception { CompositeType ct = new CompositeType("MyCompositeType", "CompositeType for ThreadInfo", validItemNames, validItemNames, validItemTypes); CompositeData cd = new CompositeDataSupport(ct, validItemNames, values); ThreadInfo info = ThreadInfo.from(cd); checkThreadInfo(info); }
Example 20
Source File: ThreadInfoCompositeData.java From hottub with GNU General Public License v2.0 | 5 votes |
public static void createGoodCompositeData() throws Exception { CompositeType ct = new CompositeType("MyCompositeType", "CompositeType for ThreadInfo", validItemNames, validItemNames, validItemTypes); CompositeData cd = new CompositeDataSupport(ct, validItemNames, values); ThreadInfo info = ThreadInfo.from(cd); checkThreadInfo(info); }