/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
package sun.management;
/**
* Helper class to build composite data.
*/
public class GcInfoBuilder {
// GC-specific composite type:
// Each GarbageCollectorMXBean may have different GC-specific attributes
// the CompositeType for the GcInfo could be different.
// GC-specific items
private final int gcExtItemCount;
private final char[] gcExtItemTypes;
this.gcExtItemTypes = new char[gcExtItemCount];
// Fill the information about extension attributes
// lazily build the CompositeType for the GcInfo
// including the GC-specific extension attributes
this.gcInfoCompositeType = null;
}
}
return poolNames;
}
int getGcExtItemCount() {
return gcExtItemCount;
}
// Returns the CompositeType for the GcInfo including
// the extension attributes
if (gcInfoCompositeType != null)
return gcInfoCompositeType;
// First, fill with the attributes in the GcInfo
// Then fill with the extension GC-specific attributes, if any.
if (gcExtItemCount > 0) {
switch (gcExtItemTypes[j]) {
case 'Z':
break;
case 'B':
break;
case 'C':
break;
case 'S':
break;
case 'I':
break;
case 'J':
break;
case 'F':
break;
case 'D':
break;
default:
throw new AssertionError(
}
}
}
try {
"CompositeType for GC info for " +
} catch (OpenDataException e) {
// shouldn't reach here
throw Util.newException(e);
}
return gcInfoCompositeType;
}
if (allItemNames == null) {
// initialize when forming the composite type
}
return allItemNames;
}
// Retrieve information about extension attributes
int numAttributes,
char[] types,
String[] descriptions);
/**
* Returns the last GcInfo
*
* @param gc GarbageCollectorMXBean that the gc info is associated with.
* @param numExtAtts number of extension attributes
* @param extAttValues Values of extension attributes to be filled.
* @param before Memory usage before GC to be filled.
* @param after Memory usage after GC to be filled.
*/
int numExtAtts,
char[] extAttTypes,
MemoryUsage[] after);
}