sun.management.snmp.jvmmib.EnumJvmThreadCpuTimeMonitoring Java Examples

The following examples show how to use sun.management.snmp.jvmmib.EnumJvmThreadCpuTimeMonitoring. 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: JvmThreadingImpl.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Getter for the "JvmThreadCpuTimeMonitoring" variable.
 */
public EnumJvmThreadCpuTimeMonitoring getJvmThreadCpuTimeMonitoring()
    throws SnmpStatusException {

    ThreadMXBean mbean = getThreadMXBean();

    if(!mbean.isThreadCpuTimeSupported()) {
        log.debug("getJvmThreadCpuTimeMonitoring",
                  "Unsupported ThreadCpuTimeMonitoring");
        return JvmThreadCpuTimeMonitoringUnsupported;
    }

    try {
        if(mbean.isThreadCpuTimeEnabled()) {
            log.debug("getJvmThreadCpuTimeMonitoring",
                  "Enabled ThreadCpuTimeMonitoring");
            return JvmThreadCpuTimeMonitoringEnabled;
        } else {
            log.debug("getJvmThreadCpuTimeMonitoring",
                      "Disabled ThreadCpuTimeMonitoring");
            return JvmThreadCpuTimeMonitoringDisabled;
        }
    }catch(UnsupportedOperationException e) {
        log.debug("getJvmThreadCpuTimeMonitoring",
                  "Newly unsupported ThreadCpuTimeMonitoring");

        return JvmThreadCpuTimeMonitoringUnsupported;
    }
}
 
Example #2
Source File: JvmThreadingImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Setter for the "JvmThreadCpuTimeMonitoring" variable.
 */
public void setJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring x)
    throws SnmpStatusException {

    ThreadMXBean mbean = getThreadMXBean();

    // We can trust the received value, it has been checked in
    // checkJvmThreadCpuTimeMonitoring
    if(JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue())
        mbean.setThreadCpuTimeEnabled(true);
    else
        mbean.setThreadCpuTimeEnabled(false);
}
 
Example #3
Source File: JvmThreadingImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Checker for the "JvmThreadCpuTimeMonitoring" variable.
 */
public void checkJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring
                                            x)
    throws SnmpStatusException {

    //Can't be set externaly to unsupported state.
    if(JvmThreadCpuTimeMonitoringUnsupported.intValue() == x.intValue()) {
         log.debug("checkJvmThreadCpuTimeMonitoring",
                  "Try to set to illegal unsupported value");
        throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
    }

    if ((JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue()) ||
        (JvmThreadCpuTimeMonitoringDisabled.intValue() == x.intValue())) {

        // The value is a valid value. But is the feature supported?
        ThreadMXBean mbean = getThreadMXBean();
        if(mbean.isThreadCpuTimeSupported()) return;

        // Not supported.
        log.debug("checkJvmThreadCpuTimeMonitoring",
                  "Unsupported operation, can't set state");
        throw new
            SnmpStatusException(SnmpDefinitions.snmpRspInconsistentValue);
    }

    // Unknown value.
    log.debug("checkJvmThreadCpuTimeMonitoring",
              "unknown enum value ");
    throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
}
 
Example #4
Source File: JvmThreadingImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Getter for the "JvmThreadCpuTimeMonitoring" variable.
 */
public EnumJvmThreadCpuTimeMonitoring getJvmThreadCpuTimeMonitoring()
    throws SnmpStatusException {

    ThreadMXBean mbean = getThreadMXBean();

    if(!mbean.isThreadCpuTimeSupported()) {
        log.debug("getJvmThreadCpuTimeMonitoring",
                  "Unsupported ThreadCpuTimeMonitoring");
        return JvmThreadCpuTimeMonitoringUnsupported;
    }

    try {
        if(mbean.isThreadCpuTimeEnabled()) {
            log.debug("getJvmThreadCpuTimeMonitoring",
                  "Enabled ThreadCpuTimeMonitoring");
            return JvmThreadCpuTimeMonitoringEnabled;
        } else {
            log.debug("getJvmThreadCpuTimeMonitoring",
                      "Disabled ThreadCpuTimeMonitoring");
            return JvmThreadCpuTimeMonitoringDisabled;
        }
    }catch(UnsupportedOperationException e) {
        log.debug("getJvmThreadCpuTimeMonitoring",
                  "Newly unsupported ThreadCpuTimeMonitoring");

        return JvmThreadCpuTimeMonitoringUnsupported;
    }
}
 
Example #5
Source File: JvmThreadingImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Setter for the "JvmThreadCpuTimeMonitoring" variable.
 */
public void setJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring x)
    throws SnmpStatusException {

    ThreadMXBean mbean = getThreadMXBean();

    // We can trust the received value, it has been checked in
    // checkJvmThreadCpuTimeMonitoring
    if(JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue())
        mbean.setThreadCpuTimeEnabled(true);
    else
        mbean.setThreadCpuTimeEnabled(false);
}
 
Example #6
Source File: JvmThreadingImpl.java    From openjdk-8-source with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Checker for the "JvmThreadCpuTimeMonitoring" variable.
 */
public void checkJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring
                                            x)
    throws SnmpStatusException {

    //Can't be set externaly to unsupported state.
    if(JvmThreadCpuTimeMonitoringUnsupported.intValue() == x.intValue()) {
         log.debug("checkJvmThreadCpuTimeMonitoring",
                  "Try to set to illegal unsupported value");
        throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
    }

    if ((JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue()) ||
        (JvmThreadCpuTimeMonitoringDisabled.intValue() == x.intValue())) {

        // The value is a valid value. But is the feature supported?
        ThreadMXBean mbean = getThreadMXBean();
        if(mbean.isThreadCpuTimeSupported()) return;

        // Not supported.
        log.debug("checkJvmThreadCpuTimeMonitoring",
                  "Unsupported operation, can't set state");
        throw new
            SnmpStatusException(SnmpDefinitions.snmpRspInconsistentValue);
    }

    // Unknown value.
    log.debug("checkJvmThreadCpuTimeMonitoring",
              "unknown enum value ");
    throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
}
 
Example #7
Source File: JvmThreadingImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Getter for the "JvmThreadCpuTimeMonitoring" variable.
 */
public EnumJvmThreadCpuTimeMonitoring getJvmThreadCpuTimeMonitoring()
    throws SnmpStatusException {

    ThreadMXBean mbean = getThreadMXBean();

    if(!mbean.isThreadCpuTimeSupported()) {
        log.debug("getJvmThreadCpuTimeMonitoring",
                  "Unsupported ThreadCpuTimeMonitoring");
        return JvmThreadCpuTimeMonitoringUnsupported;
    }

    try {
        if(mbean.isThreadCpuTimeEnabled()) {
            log.debug("getJvmThreadCpuTimeMonitoring",
                  "Enabled ThreadCpuTimeMonitoring");
            return JvmThreadCpuTimeMonitoringEnabled;
        } else {
            log.debug("getJvmThreadCpuTimeMonitoring",
                      "Disabled ThreadCpuTimeMonitoring");
            return JvmThreadCpuTimeMonitoringDisabled;
        }
    }catch(UnsupportedOperationException e) {
        log.debug("getJvmThreadCpuTimeMonitoring",
                  "Newly unsupported ThreadCpuTimeMonitoring");

        return JvmThreadCpuTimeMonitoringUnsupported;
    }
}
 
Example #8
Source File: JvmThreadingImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Setter for the "JvmThreadCpuTimeMonitoring" variable.
 */
public void setJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring x)
    throws SnmpStatusException {

    ThreadMXBean mbean = getThreadMXBean();

    // We can trust the received value, it has been checked in
    // checkJvmThreadCpuTimeMonitoring
    if(JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue())
        mbean.setThreadCpuTimeEnabled(true);
    else
        mbean.setThreadCpuTimeEnabled(false);
}
 
Example #9
Source File: JvmThreadingImpl.java    From openjdk-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Checker for the "JvmThreadCpuTimeMonitoring" variable.
 */
public void checkJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring
                                            x)
    throws SnmpStatusException {

    //Can't be set externaly to unsupported state.
    if(JvmThreadCpuTimeMonitoringUnsupported.intValue() == x.intValue()) {
         log.debug("checkJvmThreadCpuTimeMonitoring",
                  "Try to set to illegal unsupported value");
        throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
    }

    if ((JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue()) ||
        (JvmThreadCpuTimeMonitoringDisabled.intValue() == x.intValue())) {

        // The value is a valid value. But is the feature supported?
        ThreadMXBean mbean = getThreadMXBean();
        if(mbean.isThreadCpuTimeSupported()) return;

        // Not supported.
        log.debug("checkJvmThreadCpuTimeMonitoring",
                  "Unsupported operation, can't set state");
        throw new
            SnmpStatusException(SnmpDefinitions.snmpRspInconsistentValue);
    }

    // Unknown value.
    log.debug("checkJvmThreadCpuTimeMonitoring",
              "unknown enum value ");
    throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
}
 
Example #10
Source File: JvmThreadingImpl.java    From hottub with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Getter for the "JvmThreadCpuTimeMonitoring" variable.
 */
public EnumJvmThreadCpuTimeMonitoring getJvmThreadCpuTimeMonitoring()
    throws SnmpStatusException {

    ThreadMXBean mbean = getThreadMXBean();

    if(!mbean.isThreadCpuTimeSupported()) {
        log.debug("getJvmThreadCpuTimeMonitoring",
                  "Unsupported ThreadCpuTimeMonitoring");
        return JvmThreadCpuTimeMonitoringUnsupported;
    }

    try {
        if(mbean.isThreadCpuTimeEnabled()) {
            log.debug("getJvmThreadCpuTimeMonitoring",
                  "Enabled ThreadCpuTimeMonitoring");
            return JvmThreadCpuTimeMonitoringEnabled;
        } else {
            log.debug("getJvmThreadCpuTimeMonitoring",
                      "Disabled ThreadCpuTimeMonitoring");
            return JvmThreadCpuTimeMonitoringDisabled;
        }
    }catch(UnsupportedOperationException e) {
        log.debug("getJvmThreadCpuTimeMonitoring",
                  "Newly unsupported ThreadCpuTimeMonitoring");

        return JvmThreadCpuTimeMonitoringUnsupported;
    }
}
 
Example #11
Source File: JvmThreadingImpl.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Setter for the "JvmThreadCpuTimeMonitoring" variable.
 */
public void setJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring x)
    throws SnmpStatusException {

    ThreadMXBean mbean = getThreadMXBean();

    // We can trust the received value, it has been checked in
    // checkJvmThreadCpuTimeMonitoring
    if(JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue())
        mbean.setThreadCpuTimeEnabled(true);
    else
        mbean.setThreadCpuTimeEnabled(false);
}
 
Example #12
Source File: JvmThreadingImpl.java    From jdk8u_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Checker for the "JvmThreadCpuTimeMonitoring" variable.
 */
public void checkJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring
                                            x)
    throws SnmpStatusException {

    //Can't be set externaly to unsupported state.
    if(JvmThreadCpuTimeMonitoringUnsupported.intValue() == x.intValue()) {
         log.debug("checkJvmThreadCpuTimeMonitoring",
                  "Try to set to illegal unsupported value");
        throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
    }

    if ((JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue()) ||
        (JvmThreadCpuTimeMonitoringDisabled.intValue() == x.intValue())) {

        // The value is a valid value. But is the feature supported?
        ThreadMXBean mbean = getThreadMXBean();
        if(mbean.isThreadCpuTimeSupported()) return;

        // Not supported.
        log.debug("checkJvmThreadCpuTimeMonitoring",
                  "Unsupported operation, can't set state");
        throw new
            SnmpStatusException(SnmpDefinitions.snmpRspInconsistentValue);
    }

    // Unknown value.
    log.debug("checkJvmThreadCpuTimeMonitoring",
              "unknown enum value ");
    throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
}
 
Example #13
Source File: JvmThreadingImpl.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Getter for the "JvmThreadCpuTimeMonitoring" variable.
 */
public EnumJvmThreadCpuTimeMonitoring getJvmThreadCpuTimeMonitoring()
    throws SnmpStatusException {

    ThreadMXBean mbean = getThreadMXBean();

    if(!mbean.isThreadCpuTimeSupported()) {
        log.debug("getJvmThreadCpuTimeMonitoring",
                  "Unsupported ThreadCpuTimeMonitoring");
        return JvmThreadCpuTimeMonitoringUnsupported;
    }

    try {
        if(mbean.isThreadCpuTimeEnabled()) {
            log.debug("getJvmThreadCpuTimeMonitoring",
                  "Enabled ThreadCpuTimeMonitoring");
            return JvmThreadCpuTimeMonitoringEnabled;
        } else {
            log.debug("getJvmThreadCpuTimeMonitoring",
                      "Disabled ThreadCpuTimeMonitoring");
            return JvmThreadCpuTimeMonitoringDisabled;
        }
    }catch(UnsupportedOperationException e) {
        log.debug("getJvmThreadCpuTimeMonitoring",
                  "Newly unsupported ThreadCpuTimeMonitoring");

        return JvmThreadCpuTimeMonitoringUnsupported;
    }
}
 
Example #14
Source File: JvmThreadingImpl.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Setter for the "JvmThreadCpuTimeMonitoring" variable.
 */
public void setJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring x)
    throws SnmpStatusException {

    ThreadMXBean mbean = getThreadMXBean();

    // We can trust the received value, it has been checked in
    // checkJvmThreadCpuTimeMonitoring
    if(JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue())
        mbean.setThreadCpuTimeEnabled(true);
    else
        mbean.setThreadCpuTimeEnabled(false);
}
 
Example #15
Source File: JvmThreadingImpl.java    From jdk8u-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Checker for the "JvmThreadCpuTimeMonitoring" variable.
 */
public void checkJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring
                                            x)
    throws SnmpStatusException {

    //Can't be set externaly to unsupported state.
    if(JvmThreadCpuTimeMonitoringUnsupported.intValue() == x.intValue()) {
         log.debug("checkJvmThreadCpuTimeMonitoring",
                  "Try to set to illegal unsupported value");
        throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
    }

    if ((JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue()) ||
        (JvmThreadCpuTimeMonitoringDisabled.intValue() == x.intValue())) {

        // The value is a valid value. But is the feature supported?
        ThreadMXBean mbean = getThreadMXBean();
        if(mbean.isThreadCpuTimeSupported()) return;

        // Not supported.
        log.debug("checkJvmThreadCpuTimeMonitoring",
                  "Unsupported operation, can't set state");
        throw new
            SnmpStatusException(SnmpDefinitions.snmpRspInconsistentValue);
    }

    // Unknown value.
    log.debug("checkJvmThreadCpuTimeMonitoring",
              "unknown enum value ");
    throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
}
 
Example #16
Source File: JvmThreadingImpl.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Getter for the "JvmThreadCpuTimeMonitoring" variable.
 */
public EnumJvmThreadCpuTimeMonitoring getJvmThreadCpuTimeMonitoring()
    throws SnmpStatusException {

    ThreadMXBean mbean = getThreadMXBean();

    if(!mbean.isThreadCpuTimeSupported()) {
        log.debug("getJvmThreadCpuTimeMonitoring",
                  "Unsupported ThreadCpuTimeMonitoring");
        return JvmThreadCpuTimeMonitoringUnsupported;
    }

    try {
        if(mbean.isThreadCpuTimeEnabled()) {
            log.debug("getJvmThreadCpuTimeMonitoring",
                  "Enabled ThreadCpuTimeMonitoring");
            return JvmThreadCpuTimeMonitoringEnabled;
        } else {
            log.debug("getJvmThreadCpuTimeMonitoring",
                      "Disabled ThreadCpuTimeMonitoring");
            return JvmThreadCpuTimeMonitoringDisabled;
        }
    }catch(UnsupportedOperationException e) {
        log.debug("getJvmThreadCpuTimeMonitoring",
                  "Newly unsupported ThreadCpuTimeMonitoring");

        return JvmThreadCpuTimeMonitoringUnsupported;
    }
}
 
Example #17
Source File: JvmThreadingImpl.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Setter for the "JvmThreadCpuTimeMonitoring" variable.
 */
public void setJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring x)
    throws SnmpStatusException {

    ThreadMXBean mbean = getThreadMXBean();

    // We can trust the received value, it has been checked in
    // checkJvmThreadCpuTimeMonitoring
    if(JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue())
        mbean.setThreadCpuTimeEnabled(true);
    else
        mbean.setThreadCpuTimeEnabled(false);
}
 
Example #18
Source File: JvmThreadingImpl.java    From jdk8u-dev-jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Checker for the "JvmThreadCpuTimeMonitoring" variable.
 */
public void checkJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring
                                            x)
    throws SnmpStatusException {

    //Can't be set externaly to unsupported state.
    if(JvmThreadCpuTimeMonitoringUnsupported.intValue() == x.intValue()) {
         log.debug("checkJvmThreadCpuTimeMonitoring",
                  "Try to set to illegal unsupported value");
        throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
    }

    if ((JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue()) ||
        (JvmThreadCpuTimeMonitoringDisabled.intValue() == x.intValue())) {

        // The value is a valid value. But is the feature supported?
        ThreadMXBean mbean = getThreadMXBean();
        if(mbean.isThreadCpuTimeSupported()) return;

        // Not supported.
        log.debug("checkJvmThreadCpuTimeMonitoring",
                  "Unsupported operation, can't set state");
        throw new
            SnmpStatusException(SnmpDefinitions.snmpRspInconsistentValue);
    }

    // Unknown value.
    log.debug("checkJvmThreadCpuTimeMonitoring",
              "unknown enum value ");
    throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
}
 
Example #19
Source File: JvmThreadingImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Getter for the "JvmThreadCpuTimeMonitoring" variable.
 */
public EnumJvmThreadCpuTimeMonitoring getJvmThreadCpuTimeMonitoring()
    throws SnmpStatusException {

    ThreadMXBean mbean = getThreadMXBean();

    if(!mbean.isThreadCpuTimeSupported()) {
        log.debug("getJvmThreadCpuTimeMonitoring",
                  "Unsupported ThreadCpuTimeMonitoring");
        return JvmThreadCpuTimeMonitoringUnsupported;
    }

    try {
        if(mbean.isThreadCpuTimeEnabled()) {
            log.debug("getJvmThreadCpuTimeMonitoring",
                  "Enabled ThreadCpuTimeMonitoring");
            return JvmThreadCpuTimeMonitoringEnabled;
        } else {
            log.debug("getJvmThreadCpuTimeMonitoring",
                      "Disabled ThreadCpuTimeMonitoring");
            return JvmThreadCpuTimeMonitoringDisabled;
        }
    }catch(UnsupportedOperationException e) {
        log.debug("getJvmThreadCpuTimeMonitoring",
                  "Newly unsupported ThreadCpuTimeMonitoring");

        return JvmThreadCpuTimeMonitoringUnsupported;
    }
}
 
Example #20
Source File: JvmThreadingImpl.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Setter for the "JvmThreadCpuTimeMonitoring" variable.
 */
public void setJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring x)
    throws SnmpStatusException {

    ThreadMXBean mbean = getThreadMXBean();

    // We can trust the received value, it has been checked in
    // checkJvmThreadCpuTimeMonitoring
    if(JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue())
        mbean.setThreadCpuTimeEnabled(true);
    else
        mbean.setThreadCpuTimeEnabled(false);
}
 
Example #21
Source File: JvmThreadingImpl.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Checker for the "JvmThreadCpuTimeMonitoring" variable.
 */
public void checkJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring
                                            x)
    throws SnmpStatusException {

    //Can't be set externaly to unsupported state.
    if(JvmThreadCpuTimeMonitoringUnsupported.intValue() == x.intValue()) {
         log.debug("checkJvmThreadCpuTimeMonitoring",
                  "Try to set to illegal unsupported value");
        throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
    }

    if ((JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue()) ||
        (JvmThreadCpuTimeMonitoringDisabled.intValue() == x.intValue())) {

        // The value is a valid value. But is the feature supported?
        ThreadMXBean mbean = getThreadMXBean();
        if(mbean.isThreadCpuTimeSupported()) return;

        // Not supported.
        log.debug("checkJvmThreadCpuTimeMonitoring",
                  "Unsupported operation, can't set state");
        throw new
            SnmpStatusException(SnmpDefinitions.snmpRspInconsistentValue);
    }

    // Unknown value.
    log.debug("checkJvmThreadCpuTimeMonitoring",
              "unknown enum value ");
    throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
}
 
Example #22
Source File: JvmThreadingImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Getter for the "JvmThreadCpuTimeMonitoring" variable.
 */
public EnumJvmThreadCpuTimeMonitoring getJvmThreadCpuTimeMonitoring()
    throws SnmpStatusException {

    ThreadMXBean mbean = getThreadMXBean();

    if(!mbean.isThreadCpuTimeSupported()) {
        log.debug("getJvmThreadCpuTimeMonitoring",
                  "Unsupported ThreadCpuTimeMonitoring");
        return JvmThreadCpuTimeMonitoringUnsupported;
    }

    try {
        if(mbean.isThreadCpuTimeEnabled()) {
            log.debug("getJvmThreadCpuTimeMonitoring",
                  "Enabled ThreadCpuTimeMonitoring");
            return JvmThreadCpuTimeMonitoringEnabled;
        } else {
            log.debug("getJvmThreadCpuTimeMonitoring",
                      "Disabled ThreadCpuTimeMonitoring");
            return JvmThreadCpuTimeMonitoringDisabled;
        }
    }catch(UnsupportedOperationException e) {
        log.debug("getJvmThreadCpuTimeMonitoring",
                  "Newly unsupported ThreadCpuTimeMonitoring");

        return JvmThreadCpuTimeMonitoringUnsupported;
    }
}
 
Example #23
Source File: JvmThreadingImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Setter for the "JvmThreadCpuTimeMonitoring" variable.
 */
public void setJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring x)
    throws SnmpStatusException {

    ThreadMXBean mbean = getThreadMXBean();

    // We can trust the received value, it has been checked in
    // checkJvmThreadCpuTimeMonitoring
    if(JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue())
        mbean.setThreadCpuTimeEnabled(true);
    else
        mbean.setThreadCpuTimeEnabled(false);
}
 
Example #24
Source File: JvmThreadingImpl.java    From TencentKona-8 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Checker for the "JvmThreadCpuTimeMonitoring" variable.
 */
public void checkJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring
                                            x)
    throws SnmpStatusException {

    //Can't be set externaly to unsupported state.
    if(JvmThreadCpuTimeMonitoringUnsupported.intValue() == x.intValue()) {
         log.debug("checkJvmThreadCpuTimeMonitoring",
                  "Try to set to illegal unsupported value");
        throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
    }

    if ((JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue()) ||
        (JvmThreadCpuTimeMonitoringDisabled.intValue() == x.intValue())) {

        // The value is a valid value. But is the feature supported?
        ThreadMXBean mbean = getThreadMXBean();
        if(mbean.isThreadCpuTimeSupported()) return;

        // Not supported.
        log.debug("checkJvmThreadCpuTimeMonitoring",
                  "Unsupported operation, can't set state");
        throw new
            SnmpStatusException(SnmpDefinitions.snmpRspInconsistentValue);
    }

    // Unknown value.
    log.debug("checkJvmThreadCpuTimeMonitoring",
              "unknown enum value ");
    throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
}
 
Example #25
Source File: JvmThreadingImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Getter for the "JvmThreadCpuTimeMonitoring" variable.
 */
public EnumJvmThreadCpuTimeMonitoring getJvmThreadCpuTimeMonitoring()
    throws SnmpStatusException {

    ThreadMXBean mbean = getThreadMXBean();

    if(!mbean.isThreadCpuTimeSupported()) {
        log.debug("getJvmThreadCpuTimeMonitoring",
                  "Unsupported ThreadCpuTimeMonitoring");
        return JvmThreadCpuTimeMonitoringUnsupported;
    }

    try {
        if(mbean.isThreadCpuTimeEnabled()) {
            log.debug("getJvmThreadCpuTimeMonitoring",
                  "Enabled ThreadCpuTimeMonitoring");
            return JvmThreadCpuTimeMonitoringEnabled;
        } else {
            log.debug("getJvmThreadCpuTimeMonitoring",
                      "Disabled ThreadCpuTimeMonitoring");
            return JvmThreadCpuTimeMonitoringDisabled;
        }
    }catch(UnsupportedOperationException e) {
        log.debug("getJvmThreadCpuTimeMonitoring",
                  "Newly unsupported ThreadCpuTimeMonitoring");

        return JvmThreadCpuTimeMonitoringUnsupported;
    }
}
 
Example #26
Source File: JvmThreadingImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Setter for the "JvmThreadCpuTimeMonitoring" variable.
 */
public void setJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring x)
    throws SnmpStatusException {

    ThreadMXBean mbean = getThreadMXBean();

    // We can trust the received value, it has been checked in
    // checkJvmThreadCpuTimeMonitoring
    if(JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue())
        mbean.setThreadCpuTimeEnabled(true);
    else
        mbean.setThreadCpuTimeEnabled(false);
}
 
Example #27
Source File: JvmThreadingImpl.java    From jdk8u60 with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Checker for the "JvmThreadCpuTimeMonitoring" variable.
 */
public void checkJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring
                                            x)
    throws SnmpStatusException {

    //Can't be set externaly to unsupported state.
    if(JvmThreadCpuTimeMonitoringUnsupported.intValue() == x.intValue()) {
         log.debug("checkJvmThreadCpuTimeMonitoring",
                  "Try to set to illegal unsupported value");
        throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
    }

    if ((JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue()) ||
        (JvmThreadCpuTimeMonitoringDisabled.intValue() == x.intValue())) {

        // The value is a valid value. But is the feature supported?
        ThreadMXBean mbean = getThreadMXBean();
        if(mbean.isThreadCpuTimeSupported()) return;

        // Not supported.
        log.debug("checkJvmThreadCpuTimeMonitoring",
                  "Unsupported operation, can't set state");
        throw new
            SnmpStatusException(SnmpDefinitions.snmpRspInconsistentValue);
    }

    // Unknown value.
    log.debug("checkJvmThreadCpuTimeMonitoring",
              "unknown enum value ");
    throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
}
 
Example #28
Source File: JvmThreadingImpl.java    From dragonwell8_jdk with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Getter for the "JvmThreadCpuTimeMonitoring" variable.
 */
public EnumJvmThreadCpuTimeMonitoring getJvmThreadCpuTimeMonitoring()
    throws SnmpStatusException {

    ThreadMXBean mbean = getThreadMXBean();

    if(!mbean.isThreadCpuTimeSupported()) {
        log.debug("getJvmThreadCpuTimeMonitoring",
                  "Unsupported ThreadCpuTimeMonitoring");
        return JvmThreadCpuTimeMonitoringUnsupported;
    }

    try {
        if(mbean.isThreadCpuTimeEnabled()) {
            log.debug("getJvmThreadCpuTimeMonitoring",
                  "Enabled ThreadCpuTimeMonitoring");
            return JvmThreadCpuTimeMonitoringEnabled;
        } else {
            log.debug("getJvmThreadCpuTimeMonitoring",
                      "Disabled ThreadCpuTimeMonitoring");
            return JvmThreadCpuTimeMonitoringDisabled;
        }
    }catch(UnsupportedOperationException e) {
        log.debug("getJvmThreadCpuTimeMonitoring",
                  "Newly unsupported ThreadCpuTimeMonitoring");

        return JvmThreadCpuTimeMonitoringUnsupported;
    }
}
 
Example #29
Source File: JvmThreadingImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Setter for the "JvmThreadCpuTimeMonitoring" variable.
 */
public void setJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring x)
    throws SnmpStatusException {

    ThreadMXBean mbean = getThreadMXBean();

    // We can trust the received value, it has been checked in
    // checkJvmThreadCpuTimeMonitoring
    if(JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue())
        mbean.setThreadCpuTimeEnabled(true);
    else
        mbean.setThreadCpuTimeEnabled(false);
}
 
Example #30
Source File: JvmThreadingImpl.java    From openjdk-jdk8u with GNU General Public License v2.0 5 votes vote down vote up
/**
 * Checker for the "JvmThreadCpuTimeMonitoring" variable.
 */
public void checkJvmThreadCpuTimeMonitoring(EnumJvmThreadCpuTimeMonitoring
                                            x)
    throws SnmpStatusException {

    //Can't be set externaly to unsupported state.
    if(JvmThreadCpuTimeMonitoringUnsupported.intValue() == x.intValue()) {
         log.debug("checkJvmThreadCpuTimeMonitoring",
                  "Try to set to illegal unsupported value");
        throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
    }

    if ((JvmThreadCpuTimeMonitoringEnabled.intValue() == x.intValue()) ||
        (JvmThreadCpuTimeMonitoringDisabled.intValue() == x.intValue())) {

        // The value is a valid value. But is the feature supported?
        ThreadMXBean mbean = getThreadMXBean();
        if(mbean.isThreadCpuTimeSupported()) return;

        // Not supported.
        log.debug("checkJvmThreadCpuTimeMonitoring",
                  "Unsupported operation, can't set state");
        throw new
            SnmpStatusException(SnmpDefinitions.snmpRspInconsistentValue);
    }

    // Unknown value.
    log.debug("checkJvmThreadCpuTimeMonitoring",
              "unknown enum value ");
    throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
}