/*
* 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.
*/
// java imports
//
// jmx imports
//
// jdmk imports
//
/**
* The class is used for implementing the "JvmThreading" group.
*/
/**
* Variable for storing the value of "JvmThreadCpuTimeMonitoring".
*
* "The state of the Thread CPU Time Monitoring feature.
* This feature can be:
*
* unsupported: The JVM does not support Thread CPU Time Monitoring.
* enabled : The JVM supports Thread CPU Time Monitoring, and it
* is enabled.
* disabled : The JVM supports Thread CPU Time Monitoring, and it
* is disabled.
*
* Only enabled(3) and disabled(4) may be supplied as values to a
* SET request. unsupported(1) can only be set internally by the
* agent.
*
* See java.lang.management.ThreadMXBean.isThreadCpuTimeSupported(),
* java.lang.management.ThreadMXBean.isThreadCpuTimeEnabled(),
* java.lang.management.ThreadMXBean.setThreadCpuTimeEnabled()
* "
*
*/
final static EnumJvmThreadCpuTimeMonitoring
new EnumJvmThreadCpuTimeMonitoring("unsupported");
final static EnumJvmThreadCpuTimeMonitoring
new EnumJvmThreadCpuTimeMonitoring("enabled");
final static EnumJvmThreadCpuTimeMonitoring
new EnumJvmThreadCpuTimeMonitoring("disabled");
/**
* Variable for storing the value of "JvmThreadContentionMonitoring".
*
* "The state of the Thread Contention Monitoring feature.
* This feature can be:
*
* unsupported: The JVM does not support Thread Contention Monitoring.
* enabled : The JVM supports Thread Contention Monitoring, and it
* is enabled.
* disabled : The JVM supports Thread Contention Monitoring, and it
* is disabled.
*
* Only enabled(3) and disabled(4) may be supplied as values to a
* SET request. unsupported(1) can only be set internally by the
* agent.
*
* See java.lang.management.ThreadMXBean.isThreadContentionMonitoringSupported(),
* java.lang.management.ThreadMXBean.isThreadContentionMonitoringEnabled(),
* java.lang.management.ThreadMXBean.setThreadContentionMonitoringEnabled()
* "
*
*/
static final EnumJvmThreadContentionMonitoring
new EnumJvmThreadContentionMonitoring("unsupported");
static final EnumJvmThreadContentionMonitoring
new EnumJvmThreadContentionMonitoring("enabled");
static final EnumJvmThreadContentionMonitoring
new EnumJvmThreadContentionMonitoring("disabled");
/**
* Constructor for the "JvmThreading" group.
* If the group contains a table, the entries created through an SNMP SET
* will not be registered in Java DMK.
*/
}
/**
* Constructor for the "JvmThreading" group.
* If the group contains a table, the entries created through an SNMP SET
* will be AUTOMATICALLY REGISTERED in Java DMK.
*/
}
/**
* ThreadMXBean accessor. It is acquired from the
* java.lang.management.ManagementFactory
* @return The local ThreadMXBean.
*/
return ManagementFactory.getThreadMXBean();
}
/**
* Getter for the "JvmThreadCpuTimeMonitoring" variable.
*/
throws SnmpStatusException {
if(!mbean.isThreadCpuTimeSupported()) {
"Unsupported ThreadCpuTimeMonitoring");
}
try {
if(mbean.isThreadCpuTimeEnabled()) {
"Enabled ThreadCpuTimeMonitoring");
} else {
"Disabled ThreadCpuTimeMonitoring");
}
}catch(UnsupportedOperationException e) {
"Newly unsupported ThreadCpuTimeMonitoring");
}
}
/**
* Setter for the "JvmThreadCpuTimeMonitoring" variable.
*/
throws SnmpStatusException {
// We can trust the received value, it has been checked in
// checkJvmThreadCpuTimeMonitoring
mbean.setThreadCpuTimeEnabled(true);
else
mbean.setThreadCpuTimeEnabled(false);
}
/**
* Checker for the "JvmThreadCpuTimeMonitoring" variable.
*/
x)
throws SnmpStatusException {
//Can't be set externaly to unsupported state.
"Try to set to illegal unsupported value");
}
// The value is a valid value. But is the feature supported?
if(mbean.isThreadCpuTimeSupported()) return;
// Not supported.
"Unsupported operation, can't set state");
throw new
}
// Unknown value.
"unknown enum value ");
}
/**
* Getter for the "JvmThreadContentionMonitoring" variable.
*/
throws SnmpStatusException {
"Unsupported ThreadContentionMonitoring");
}
"Enabled ThreadContentionMonitoring");
} else {
"Disabled ThreadContentionMonitoring");
}
}
/**
* Setter for the "JvmThreadContentionMonitoring" variable.
*/
public void setJvmThreadContentionMonitoring(
throws SnmpStatusException {
// We can trust the received value, it has been checked in
// checkJvmThreadContentionMonitoring
else
}
/**
* Checker for the "JvmThreadContentionMonitoring" variable.
*/
public void checkJvmThreadContentionMonitoring(
throws SnmpStatusException {
//Can't be set externaly to unsupported state.
"Try to set to illegal unsupported value");
}
// The value is valid, but is the feature supported ?
if(mbean.isThreadContentionMonitoringSupported()) return;
"Unsupported operation, can't set state");
throw new
}
"Try to set to unknown value");
}
/**
* Getter for the "JvmThreadTotalStartedCount" variable.
*/
}
/**
* Getter for the "JvmThreadPeakCount" variable.
*/
}
/**
* Getter for the "JvmThreadDaemonCount" variable.
*/
}
/**
* Getter for the "JvmThreadCount" variable.
*/
}
/**
* Getter for the "JvmThreadPeakCountReset" variable.
*/
throws SnmpStatusException {
return new Long(jvmThreadPeakCountReset);
}
/**
* Setter for the "JvmThreadPeakCountReset" variable.
*/
throws SnmpStatusException {
final long l = x.longValue();
if (l > jvmThreadPeakCountReset) {
"jvmThreadPeakCountReset="+stamp);
}
}
/**
* Checker for the "JvmThreadPeakCountReset" variable.
*/
throws SnmpStatusException {
}
/* Last time thread peak count was reset */
}