jdk/src/share/classes/sun/management/snmp/jvminstr/JvmMemPoolEntryImpl.java
author ohair
Tue, 25 May 2010 15:58:33 -0700
changeset 5506 202f599c92aa
parent 715 f16baef3a20e
child 25186 63e1a2ec30f5
permissions -rw-r--r--
6943119: Rebrand source copyright notices Reviewed-by: darcy, weijun
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
     2
 * Copyright (c) 2003, 2008, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 715
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
package sun.management.snmp.jvminstr;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
// java imports
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.util.Map;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
// jmx imports
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import com.sun.jmx.snmp.SnmpStatusException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import com.sun.jmx.snmp.SnmpDefinitions;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
// jdmk imports
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import java.lang.management.MemoryUsage;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
import java.lang.management.MemoryType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
import java.lang.management.MemoryPoolMXBean;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
import sun.management.snmp.jvmmib.JvmMemPoolEntryMBean;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
import sun.management.snmp.jvmmib.EnumJvmMemPoolState;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
import sun.management.snmp.jvmmib.EnumJvmMemPoolType;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
import sun.management.snmp.jvmmib.EnumJvmMemPoolThreshdSupport;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
import sun.management.snmp.jvmmib.EnumJvmMemPoolCollectThreshdSupport;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
import sun.management.snmp.util.MibLogger;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
import sun.management.snmp.util.JvmContextFactory;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 * The class is used for implementing the "JvmMemPoolEntry" group.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
public class JvmMemPoolEntryImpl implements JvmMemPoolEntryMBean {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
     * Variable for storing the value of "JvmMemPoolIndex".
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     * "An index value opaquely computed by the agent which uniquely
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * identifies a row in the jvmMemPoolTable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     * "
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
    final protected int jvmMemPoolIndex;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
    final static String memoryTag = "jvmMemPoolEntry.getUsage";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
    final static String peakMemoryTag = "jvmMemPoolEntry.getPeakUsage";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    final static String collectMemoryTag =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
        "jvmMemPoolEntry.getCollectionUsage";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
    final static MemoryUsage ZEROS = new MemoryUsage(0,0,0,0);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
35
935f747e70d3 6651382: The Java JVM SNMP provider reports incorrect stats when asked for multiple OIDs
dfuchs
parents: 2
diff changeset
    73
    final String entryMemoryTag;
935f747e70d3 6651382: The Java JVM SNMP provider reports incorrect stats when asked for multiple OIDs
dfuchs
parents: 2
diff changeset
    74
    final String entryPeakMemoryTag;
935f747e70d3 6651382: The Java JVM SNMP provider reports incorrect stats when asked for multiple OIDs
dfuchs
parents: 2
diff changeset
    75
    final String entryCollectMemoryTag;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
    MemoryUsage getMemoryUsage() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
            final Map<Object, Object> m = JvmContextFactory.getUserData();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
            if (m != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
                final MemoryUsage cached = (MemoryUsage)
35
935f747e70d3 6651382: The Java JVM SNMP provider reports incorrect stats when asked for multiple OIDs
dfuchs
parents: 2
diff changeset
    83
                    m.get(entryMemoryTag);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
                if (cached != null) {
35
935f747e70d3 6651382: The Java JVM SNMP provider reports incorrect stats when asked for multiple OIDs
dfuchs
parents: 2
diff changeset
    85
                    log.debug("getMemoryUsage",entryMemoryTag+
935f747e70d3 6651382: The Java JVM SNMP provider reports incorrect stats when asked for multiple OIDs
dfuchs
parents: 2
diff changeset
    86
                          " found in cache.");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
                    return cached;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
                MemoryUsage u = pool.getUsage();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                if (u == null) u = ZEROS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
35
935f747e70d3 6651382: The Java JVM SNMP provider reports incorrect stats when asked for multiple OIDs
dfuchs
parents: 2
diff changeset
    93
                m.put(entryMemoryTag,u);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
                return u;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
            // Should never come here.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
            // Log error!
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
            log.trace("getMemoryUsage", "ERROR: should never come here!");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
            return pool.getUsage();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
        } catch (RuntimeException x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
            log.trace("getMemoryUsage",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
                  "Failed to get MemoryUsage: " + x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
            log.debug("getMemoryUsage",x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
            throw x;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   106
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
    MemoryUsage getPeakMemoryUsage() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
            final Map<Object, Object> m = JvmContextFactory.getUserData();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
            if (m != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
                final MemoryUsage cached = (MemoryUsage)
35
935f747e70d3 6651382: The Java JVM SNMP provider reports incorrect stats when asked for multiple OIDs
dfuchs
parents: 2
diff changeset
   115
                    m.get(entryPeakMemoryTag);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
                if (cached != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
                    if (log.isDebugOn())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
                        log.debug("getPeakMemoryUsage",
35
935f747e70d3 6651382: The Java JVM SNMP provider reports incorrect stats when asked for multiple OIDs
dfuchs
parents: 2
diff changeset
   119
                              entryPeakMemoryTag + " found in cache.");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                    return cached;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
                MemoryUsage u = pool.getPeakUsage();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
                if (u == null) u = ZEROS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
35
935f747e70d3 6651382: The Java JVM SNMP provider reports incorrect stats when asked for multiple OIDs
dfuchs
parents: 2
diff changeset
   126
                m.put(entryPeakMemoryTag,u);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
                return u;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
            // Should never come here.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
            // Log error!
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
            log.trace("getPeakMemoryUsage", "ERROR: should never come here!");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
            return ZEROS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
        } catch (RuntimeException x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
            log.trace("getPeakMemoryUsage",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
                  "Failed to get MemoryUsage: " + x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
            log.debug("getPeakMemoryUsage",x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
            throw x;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
    MemoryUsage getCollectMemoryUsage() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
            final Map<Object, Object> m = JvmContextFactory.getUserData();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
            if (m != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
                final MemoryUsage cached = (MemoryUsage)
35
935f747e70d3 6651382: The Java JVM SNMP provider reports incorrect stats when asked for multiple OIDs
dfuchs
parents: 2
diff changeset
   148
                    m.get(entryCollectMemoryTag);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
                if (cached != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
                    if (log.isDebugOn())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
                        log.debug("getCollectMemoryUsage",
35
935f747e70d3 6651382: The Java JVM SNMP provider reports incorrect stats when asked for multiple OIDs
dfuchs
parents: 2
diff changeset
   152
                                  entryCollectMemoryTag + " found in cache.");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
                    return cached;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
                MemoryUsage u = pool.getCollectionUsage();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
                if (u == null) u = ZEROS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
35
935f747e70d3 6651382: The Java JVM SNMP provider reports incorrect stats when asked for multiple OIDs
dfuchs
parents: 2
diff changeset
   159
                m.put(entryCollectMemoryTag,u);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
                return u;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
            // Should never come here.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
            // Log error!
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
            log.trace("getCollectMemoryUsage",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
                      "ERROR: should never come here!");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
            return ZEROS;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
        } catch (RuntimeException x) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
            log.trace("getPeakMemoryUsage",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
                  "Failed to get MemoryUsage: " + x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
            log.debug("getPeakMemoryUsage",x);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
            throw x;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
    final MemoryPoolMXBean pool;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
     * Constructor for the "JvmMemPoolEntry" group.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
     */
35
935f747e70d3 6651382: The Java JVM SNMP provider reports incorrect stats when asked for multiple OIDs
dfuchs
parents: 2
diff changeset
   181
    public JvmMemPoolEntryImpl(MemoryPoolMXBean mp, final int index) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
        this.pool=mp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
        this.jvmMemPoolIndex = index;
35
935f747e70d3 6651382: The Java JVM SNMP provider reports incorrect stats when asked for multiple OIDs
dfuchs
parents: 2
diff changeset
   184
        this.entryMemoryTag = memoryTag + "." + index;
935f747e70d3 6651382: The Java JVM SNMP provider reports incorrect stats when asked for multiple OIDs
dfuchs
parents: 2
diff changeset
   185
        this.entryPeakMemoryTag = peakMemoryTag + "." + index;
935f747e70d3 6651382: The Java JVM SNMP provider reports incorrect stats when asked for multiple OIDs
dfuchs
parents: 2
diff changeset
   186
        this.entryCollectMemoryTag = collectMemoryTag + "." + index;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
     * Getter for the "JvmMemPoolMaxSize" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
    public Long getJvmMemPoolMaxSize() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
        final long val = getMemoryUsage().getMax();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
        if (val > -1) return  new Long(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
        else return JvmMemoryImpl.Long0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
     * Getter for the "JvmMemPoolUsed" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
    public Long getJvmMemPoolUsed() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
        final long val = getMemoryUsage().getUsed();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
        if (val > -1) return  new Long(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        else return JvmMemoryImpl.Long0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
     * Getter for the "JvmMemPoolInitSize" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    public Long getJvmMemPoolInitSize() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
        final long val = getMemoryUsage().getInit();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
        if (val > -1) return  new Long(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
        else return JvmMemoryImpl.Long0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
     * Getter for the "JvmMemPoolCommitted" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    public Long getJvmMemPoolCommitted() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
        final long val = getMemoryUsage().getCommitted();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
        if (val > -1) return  new Long(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
        else return JvmMemoryImpl.Long0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
     * Getter for the "JvmMemPoolPeakMaxSize" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
    public Long getJvmMemPoolPeakMaxSize() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
        final long val = getPeakMemoryUsage().getMax();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
        if (val > -1) return  new Long(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
        else return JvmMemoryImpl.Long0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
     * Getter for the "JvmMemPoolPeakUsed" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
    public Long getJvmMemPoolPeakUsed() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
        final long val = getPeakMemoryUsage().getUsed();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
        if (val > -1) return  new Long(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
        else return JvmMemoryImpl.Long0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
     * Getter for the "JvmMemPoolPeakCommitted" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
    public Long getJvmMemPoolPeakCommitted() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
        final long val = getPeakMemoryUsage().getCommitted();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
        if (val > -1) return  new Long(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
        else return JvmMemoryImpl.Long0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
     * Getter for the "JvmMemPoolCollectMaxSize" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
    public Long getJvmMemPoolCollectMaxSize() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
        final long val = getCollectMemoryUsage().getMax();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
        if (val > -1) return  new Long(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
        else return JvmMemoryImpl.Long0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
     * Getter for the "JvmMemPoolCollectUsed" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
    public Long getJvmMemPoolCollectUsed() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
        final long val = getCollectMemoryUsage().getUsed();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
        if (val > -1) return  new Long(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
        else return JvmMemoryImpl.Long0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
     * Getter for the "JvmMemPoolCollectCommitted" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
    public Long getJvmMemPoolCollectCommitted() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
        final long val = getCollectMemoryUsage().getCommitted();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
        if (val > -1) return  new Long(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
        else return JvmMemoryImpl.Long0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   277
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   278
90ce3da70b43 Initial load
duke
parents:
diff changeset
   279
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   280
     * Getter for the "JvmMemPoolThreshold" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
    public Long getJvmMemPoolThreshold() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
        if (!pool.isUsageThresholdSupported())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
            return JvmMemoryImpl.Long0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
        final long val = pool.getUsageThreshold();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
        if (val > -1) return  new Long(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   287
        else return JvmMemoryImpl.Long0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   288
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   289
90ce3da70b43 Initial load
duke
parents:
diff changeset
   290
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   291
     * Setter for the "JvmMemPoolThreshold" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   292
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   293
    public void setJvmMemPoolThreshold(Long x) throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   294
        final long val = x.longValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   295
        if (val < 0 )
90ce3da70b43 Initial load
duke
parents:
diff changeset
   296
            throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   297
        // This should never throw an exception has the checks have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   298
        // already been performed in checkJvmMemPoolThreshold().
90ce3da70b43 Initial load
duke
parents:
diff changeset
   299
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   300
        pool.setUsageThreshold(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   301
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   302
90ce3da70b43 Initial load
duke
parents:
diff changeset
   303
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   304
     * Checker for the "JvmMemPoolThreshold" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   305
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   306
    public void checkJvmMemPoolThreshold(Long x) throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   307
        // if threshold is -1, it means that low memory detection is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   308
        // supported.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   309
90ce3da70b43 Initial load
duke
parents:
diff changeset
   310
        if (!pool.isUsageThresholdSupported())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   311
            throw new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   312
                SnmpStatusException(SnmpDefinitions.snmpRspInconsistentValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   313
        final long val = x.longValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   314
        if (val < 0 )
90ce3da70b43 Initial load
duke
parents:
diff changeset
   315
            throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   316
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   317
90ce3da70b43 Initial load
duke
parents:
diff changeset
   318
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   319
     * Getter for the "JvmMemPoolThreshdSupport" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   320
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   321
    public EnumJvmMemPoolThreshdSupport getJvmMemPoolThreshdSupport()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   322
        throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   323
        if (pool.isUsageThresholdSupported())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   324
            return EnumJvmMemPoolThreshdSupported;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   325
        else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   326
            return EnumJvmMemPoolThreshdUnsupported;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   327
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   328
90ce3da70b43 Initial load
duke
parents:
diff changeset
   329
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   330
     * Getter for the "JvmMemPoolThreshdCount" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   331
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   332
    public Long getJvmMemPoolThreshdCount()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   333
        throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   334
        if (!pool.isUsageThresholdSupported())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   335
            return JvmMemoryImpl.Long0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   336
        final long val = pool.getUsageThresholdCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   337
        if (val > -1) return  new Long(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   338
        else return JvmMemoryImpl.Long0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   339
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   340
90ce3da70b43 Initial load
duke
parents:
diff changeset
   341
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   342
     * Getter for the "JvmMemPoolCollectThreshold" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   343
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   344
    public Long getJvmMemPoolCollectThreshold() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   345
        if (!pool.isCollectionUsageThresholdSupported())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   346
            return JvmMemoryImpl.Long0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   347
        final long val = pool.getCollectionUsageThreshold();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   348
        if (val > -1) return  new Long(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   349
        else return JvmMemoryImpl.Long0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   350
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   351
90ce3da70b43 Initial load
duke
parents:
diff changeset
   352
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   353
     * Setter for the "JvmMemPoolCollectThreshold" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   354
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   355
    public void setJvmMemPoolCollectThreshold(Long x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   356
        throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   357
        final long val = x.longValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   358
        if (val < 0 )
90ce3da70b43 Initial load
duke
parents:
diff changeset
   359
            throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   360
        // This should never throw an exception has the checks have
90ce3da70b43 Initial load
duke
parents:
diff changeset
   361
        // already been performed in checkJvmMemPoolCollectThreshold().
90ce3da70b43 Initial load
duke
parents:
diff changeset
   362
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   363
        pool.setCollectionUsageThreshold(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   364
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   365
90ce3da70b43 Initial load
duke
parents:
diff changeset
   366
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   367
     * Checker for the "JvmMemPoolCollectThreshold" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   368
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   369
    public void checkJvmMemPoolCollectThreshold(Long x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   370
        throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   371
        // if threshold is -1, it means that low memory detection is not
90ce3da70b43 Initial load
duke
parents:
diff changeset
   372
        // supported.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   373
90ce3da70b43 Initial load
duke
parents:
diff changeset
   374
        if (!pool.isCollectionUsageThresholdSupported())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   375
            throw new
90ce3da70b43 Initial load
duke
parents:
diff changeset
   376
                SnmpStatusException(SnmpDefinitions.snmpRspInconsistentValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   377
        final long val = x.longValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   378
        if (val < 0 )
90ce3da70b43 Initial load
duke
parents:
diff changeset
   379
            throw new SnmpStatusException(SnmpDefinitions.snmpRspWrongValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   380
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   381
90ce3da70b43 Initial load
duke
parents:
diff changeset
   382
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   383
     * Getter for the "JvmMemPoolThreshdSupport" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   384
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   385
    public EnumJvmMemPoolCollectThreshdSupport
90ce3da70b43 Initial load
duke
parents:
diff changeset
   386
        getJvmMemPoolCollectThreshdSupport()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   387
        throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   388
        if (pool.isCollectionUsageThresholdSupported())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   389
            return EnumJvmMemPoolCollectThreshdSupported;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   390
        else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   391
            return EnumJvmMemPoolCollectThreshdUnsupported;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   392
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   393
90ce3da70b43 Initial load
duke
parents:
diff changeset
   394
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   395
     * Getter for the "JvmMemPoolCollectThreshdCount" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   396
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   397
    public Long getJvmMemPoolCollectThreshdCount()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   398
        throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   399
        if (!pool.isCollectionUsageThresholdSupported())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   400
            return JvmMemoryImpl.Long0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   401
        final long val = pool.getCollectionUsageThresholdCount();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   402
        if (val > -1) return  new Long(val);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   403
        else return JvmMemoryImpl.Long0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   404
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   405
90ce3da70b43 Initial load
duke
parents:
diff changeset
   406
    public static EnumJvmMemPoolType jvmMemPoolType(MemoryType type)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   407
        throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   408
        if (type.equals(MemoryType.HEAP))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   409
            return  EnumJvmMemPoolTypeHeap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   410
        else if (type.equals(MemoryType.NON_HEAP))
90ce3da70b43 Initial load
duke
parents:
diff changeset
   411
            return EnumJvmMemPoolTypeNonHeap;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   412
        throw new SnmpStatusException(SnmpStatusException.snmpRspWrongValue);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   413
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   414
90ce3da70b43 Initial load
duke
parents:
diff changeset
   415
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   416
     * Getter for the "JvmMemPoolType" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   417
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   418
    public EnumJvmMemPoolType getJvmMemPoolType() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   419
        return jvmMemPoolType(pool.getType());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   420
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   421
90ce3da70b43 Initial load
duke
parents:
diff changeset
   422
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   423
     * Getter for the "JvmMemPoolName" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   424
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   425
    public String getJvmMemPoolName() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   426
        return JVM_MANAGEMENT_MIB_IMPL.validJavaObjectNameTC(pool.getName());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   427
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   428
90ce3da70b43 Initial load
duke
parents:
diff changeset
   429
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   430
     * Getter for the "JvmMemPoolIndex" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   431
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   432
    public Integer getJvmMemPoolIndex() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   433
        return new Integer(jvmMemPoolIndex);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   434
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   435
90ce3da70b43 Initial load
duke
parents:
diff changeset
   436
90ce3da70b43 Initial load
duke
parents:
diff changeset
   437
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   438
     * Getter for the "JvmMemPoolState" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   439
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   440
    public EnumJvmMemPoolState getJvmMemPoolState()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   441
        throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   442
        if (pool.isValid())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   443
            return JvmMemPoolStateValid;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   444
        else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   445
            return JvmMemPoolStateInvalid;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   446
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   447
90ce3da70b43 Initial load
duke
parents:
diff changeset
   448
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   449
     * Getter for the "JvmMemPoolPeakReset" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   450
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   451
    public synchronized Long getJvmMemPoolPeakReset()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   452
        throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   453
        return new Long(jvmMemPoolPeakReset);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   454
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   455
90ce3da70b43 Initial load
duke
parents:
diff changeset
   456
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   457
     * Setter for the "JvmMemPoolPeakReset" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   458
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   459
    public synchronized void setJvmMemPoolPeakReset(Long x)
90ce3da70b43 Initial load
duke
parents:
diff changeset
   460
        throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   461
        final long l = x.longValue();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   462
        if (l > jvmMemPoolPeakReset) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   463
            final long stamp = System.currentTimeMillis();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   464
            pool.resetPeakUsage();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   465
            jvmMemPoolPeakReset = stamp;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   466
            log.debug("setJvmMemPoolPeakReset",
90ce3da70b43 Initial load
duke
parents:
diff changeset
   467
                      "jvmMemPoolPeakReset="+stamp);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   468
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   469
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   470
90ce3da70b43 Initial load
duke
parents:
diff changeset
   471
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   472
     * Checker for the "JvmMemPoolPeakReset" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   473
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   474
    public void checkJvmMemPoolPeakReset(Long x) throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   475
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   476
90ce3da70b43 Initial load
duke
parents:
diff changeset
   477
    /* Last time peak usage was reset */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   478
    private long jvmMemPoolPeakReset = 0;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   479
90ce3da70b43 Initial load
duke
parents:
diff changeset
   480
    private final static EnumJvmMemPoolState JvmMemPoolStateValid =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   481
        new EnumJvmMemPoolState("valid");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   482
    private final static EnumJvmMemPoolState JvmMemPoolStateInvalid =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   483
        new EnumJvmMemPoolState("invalid");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   484
90ce3da70b43 Initial load
duke
parents:
diff changeset
   485
    private static final EnumJvmMemPoolType EnumJvmMemPoolTypeHeap =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   486
        new EnumJvmMemPoolType("heap");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   487
    private static final EnumJvmMemPoolType EnumJvmMemPoolTypeNonHeap =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   488
        new EnumJvmMemPoolType("nonheap");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   489
90ce3da70b43 Initial load
duke
parents:
diff changeset
   490
    private static final EnumJvmMemPoolThreshdSupport
90ce3da70b43 Initial load
duke
parents:
diff changeset
   491
        EnumJvmMemPoolThreshdSupported =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   492
        new EnumJvmMemPoolThreshdSupport("supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   493
    private static final EnumJvmMemPoolThreshdSupport
90ce3da70b43 Initial load
duke
parents:
diff changeset
   494
        EnumJvmMemPoolThreshdUnsupported =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   495
        new EnumJvmMemPoolThreshdSupport("unsupported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   496
90ce3da70b43 Initial load
duke
parents:
diff changeset
   497
    private static final EnumJvmMemPoolCollectThreshdSupport
90ce3da70b43 Initial load
duke
parents:
diff changeset
   498
        EnumJvmMemPoolCollectThreshdSupported =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   499
        new EnumJvmMemPoolCollectThreshdSupport("supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   500
    private static final EnumJvmMemPoolCollectThreshdSupport
90ce3da70b43 Initial load
duke
parents:
diff changeset
   501
        EnumJvmMemPoolCollectThreshdUnsupported=
90ce3da70b43 Initial load
duke
parents:
diff changeset
   502
        new EnumJvmMemPoolCollectThreshdSupport("unsupported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   503
90ce3da70b43 Initial load
duke
parents:
diff changeset
   504
90ce3da70b43 Initial load
duke
parents:
diff changeset
   505
    static final MibLogger log = new MibLogger(JvmMemPoolEntryImpl.class);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   506
}