ThreadInfoCompositeData.java revision 2362
2362N/A * Copyright (c) 2004, 2008, Oracle and/or its affiliates. All rights reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 2362N/A * published by the Free Software Foundation. Oracle designates this 0N/A * particular file as subject to the "Classpath" exception as provided 2362N/A * by Oracle in the LICENSE file that accompanied this code. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 2362N/A * or visit www.oracle.com if you need additional information or have any 0N/A * A CompositeData for ThreadInfo for the local management support. 0N/A * This class avoids the performance penalty paid to the 0N/A * construction of a CompositeData use in the local case. 0N/A // Convert StackTraceElement[] to CompositeData[] 0N/A // Convert MonitorInfo[] and LockInfo[] to CompositeData[] 0N/A // Convert MonitorInfo[] to CompositeData[] 0N/A // CONTENTS OF THIS ARRAY MUST BE SYNCHRONIZED WITH 0N/A // threadInfoItemNames! 0N/A // Should never reach here 0N/A // New attributes added in 6.0 ThreadInfo 0N/A // Current version of ThreadInfo 0N/A // Previous version of ThreadInfo 0N/A // Form a CompositeType for JDK 5.0 ThreadInfo version 0N/A "J2SE 5.0 java.lang.management.ThreadInfo",
0N/A // Should never reach here 0N/A // Each CompositeData object has its CompositeType associated 0N/A // with it. So we can get the CompositeType representing LockInfo 0N/A // from a mapped CompositeData for any LockInfo object. 0N/A // Thus we construct a random LockInfo object and pass it 0N/A // to LockDataConverter to do the conversion. 0N/A // The ThreadName item cannot be null so we check that 0N/A // it is present with a non-null value. 0N/A // The LockName and LockOwnerName can legitimately be null, 0N/A // we don't bother to check the value 0N/A // The StackTrace item cannot be null, but if it is we will get 0N/A // a NullPointerException when we ask for its length. 0N/A // 6.0 new attributes 0N/A // The LockedMonitors item cannot be null, but if it is we will get 0N/A // a NullPointerException when we ask for its length. 0N/A // The LockedSynchronizers item cannot be null, but if it is we will 0N/A // get a NullPointerException when we ask for its length. 0N/A /** Validate if the input CompositeData has the expected 0N/A * CompositeType (i.e. contain all attributes with expected 0N/A // check if cd is an older version 0N/A "Unexpected composite type for ThreadInfo");
0N/A "StackTraceElement[] is missing");
0N/A // validate v6 attributes 0N/A "Unexpected composite type for \"" +
0N/A "Unexpected composite type for \"" +