jdk/src/share/classes/sun/management/snmp/jvminstr/JvmRuntimeImpl.java
author mchung
Tue, 17 Jan 2012 15:55:40 -0800
changeset 11530 a9d059c15b80
parent 5506 202f599c92aa
child 25186 63e1a2ec30f5
permissions -rw-r--r--
7117570: Warnings in sun.mangement.* and its subpackages Reviewed-by: mchung, dsamersoff Contributed-by: kurchi.subhra.hazra@oracle.com
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: 2
diff changeset
     2
 * Copyright (c) 2003, 2006, 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: 2
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: 2
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: 2
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
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 com.sun.jmx.mbeanserver.Util;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.io.Serializable;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.lang.management.RuntimeMXBean;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
import java.lang.management.ManagementFactory;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
import java.util.List;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.util.Map;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
// jmx imports
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
import javax.management.MBeanServer;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
import com.sun.jmx.snmp.SnmpString;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
import com.sun.jmx.snmp.SnmpStatusException;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
// jdmk imports
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
//
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
import com.sun.jmx.snmp.agent.SnmpMib;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
import sun.management.snmp.jvmmib.JvmRuntimeMBean;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
import sun.management.snmp.jvmmib.EnumJvmRTBootClassPathSupport;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
import sun.management.snmp.util.JvmContextFactory;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
 * The class is used for implementing the "JvmRuntime" group.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
public class JvmRuntimeImpl implements JvmRuntimeMBean {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
     * Variable for storing the value of "JvmRTBootClassPathSupport".
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
     * "Indicates whether the Java virtual machine supports the
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
     * boot class path mechanism used by the system class loader
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
     * to search for class files.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
     * See java.management.RuntimeMXBean.isBootClassPathSupported()
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
     * "
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
     *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    66
    static final EnumJvmRTBootClassPathSupport
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
        JvmRTBootClassPathSupportSupported =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    68
        new EnumJvmRTBootClassPathSupport("supported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
    static final EnumJvmRTBootClassPathSupport
90ce3da70b43 Initial load
duke
parents:
diff changeset
    70
        JvmRTBootClassPathSupportUnSupported =
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
        new EnumJvmRTBootClassPathSupport("unsupported");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    72
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    74
     * Constructor for the "JvmRuntime" group.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
     * If the group contains a table, the entries created through an SNMP SET
90ce3da70b43 Initial load
duke
parents:
diff changeset
    76
     * will not be registered in Java DMK.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    77
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    78
    public JvmRuntimeImpl(SnmpMib myMib) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
     * Constructor for the "JvmRuntime" group.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
     * If the group contains a table, the entries created through an SNMP SET
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
     * will be AUTOMATICALLY REGISTERED in Java DMK.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    87
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
    public JvmRuntimeImpl(SnmpMib myMib, MBeanServer server) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
90ce3da70b43 Initial load
duke
parents:
diff changeset
    92
    static RuntimeMXBean getRuntimeMXBean() {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
        return ManagementFactory.getRuntimeMXBean();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
    private static String validDisplayStringTC(String str) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
        return JVM_MANAGEMENT_MIB_IMPL.validDisplayStringTC(str);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
90ce3da70b43 Initial load
duke
parents:
diff changeset
   100
    private static String validPathElementTC(String str) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   101
        return JVM_MANAGEMENT_MIB_IMPL.validPathElementTC(str);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   102
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   103
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
    private static String validJavaObjectNameTC(String str) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   105
        return JVM_MANAGEMENT_MIB_IMPL.validJavaObjectNameTC(str);
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
    static String[] splitPath(String path) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
        final String[] items = path.split(java.io.File.pathSeparator);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
        // for (int i=0;i<items.length;i++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   112
        //    items[i]=validPathElementTC(items[i]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   113
        // }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   114
        return items;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   115
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
90ce3da70b43 Initial load
duke
parents:
diff changeset
   117
    static String[] getClassPath(Object userData) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   118
        final Map<Object, Object> m =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
                Util.cast((userData instanceof Map)?userData:null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
        final String tag = "JvmRuntime.getClassPath";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
        // If the list is in the cache, simply return it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   124
        if (m != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   125
            final String[] cached = (String[])m.get(tag);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   126
            if (cached != null) return cached;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   127
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
        final String[] args = splitPath(getRuntimeMXBean().getClassPath());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
        if (m != null) m.put(tag,args);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
        return args;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
    static String[] getBootClassPath(Object userData) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   136
        if (!getRuntimeMXBean().isBootClassPathSupported())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   137
        return new String[0];
90ce3da70b43 Initial load
duke
parents:
diff changeset
   138
90ce3da70b43 Initial load
duke
parents:
diff changeset
   139
        final Map<Object, Object> m =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
                Util.cast((userData instanceof Map)?userData:null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   141
        final String tag = "JvmRuntime.getBootClassPath";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   142
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
        // If the list is in the cache, simply return it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
        if (m != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
            final String[] cached = (String[])m.get(tag);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
            if (cached != null) return cached;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   148
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   149
90ce3da70b43 Initial load
duke
parents:
diff changeset
   150
        final String[] args = splitPath(getRuntimeMXBean().getBootClassPath());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   151
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
        if (m != null) m.put(tag,args);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   153
        return args;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   154
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
    static String[] getLibraryPath(Object userData) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
        final Map<Object, Object> m =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
                Util.cast((userData instanceof Map)?userData:null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
        final String tag = "JvmRuntime.getLibraryPath";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   160
90ce3da70b43 Initial load
duke
parents:
diff changeset
   161
        // If the list is in the cache, simply return it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   162
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   163
        if (m != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
            final String[] cached = (String[])m.get(tag);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   165
            if (cached != null) return cached;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   166
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
        final String[] args = splitPath(getRuntimeMXBean().getLibraryPath());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
        if (m != null) m.put(tag,args);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
        return args;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   172
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   173
90ce3da70b43 Initial load
duke
parents:
diff changeset
   174
    static String[] getInputArguments(Object userData) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   175
        final Map<Object, Object> m =
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
                Util.cast((userData instanceof Map)?userData:null);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   177
        final String tag = "JvmRuntime.getInputArguments";
90ce3da70b43 Initial load
duke
parents:
diff changeset
   178
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
        // If the list is in the cache, simply return it.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
        //
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
        if (m != null) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
            final String[] cached = (String[])m.get(tag);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
            if (cached != null) return cached;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   184
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   185
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
        final List<String> l = getRuntimeMXBean().getInputArguments();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   187
        final String[] args = l.toArray(new String[0]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
90ce3da70b43 Initial load
duke
parents:
diff changeset
   189
        if (m != null) m.put(tag,args);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   190
        return args;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
     * Getter for the "JvmRTSpecVendor" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
    public String getJvmRTSpecVendor() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
        return validDisplayStringTC(getRuntimeMXBean().getSpecVendor());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
     * Getter for the "JvmRTSpecName" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
    public String getJvmRTSpecName() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
        return validDisplayStringTC(getRuntimeMXBean().getSpecName());
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 "JvmRTVersion" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
    public String getJvmRTVMVersion() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   211
        return validDisplayStringTC(getRuntimeMXBean().getVmVersion());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
     * Getter for the "JvmRTVendor" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    public String getJvmRTVMVendor() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
        return validDisplayStringTC(getRuntimeMXBean().getVmVendor());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   219
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   220
90ce3da70b43 Initial load
duke
parents:
diff changeset
   221
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   222
     * Getter for the "JvmRTManagementSpecVersion" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   223
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   224
    public String getJvmRTManagementSpecVersion() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   225
        return validDisplayStringTC(getRuntimeMXBean().
90ce3da70b43 Initial load
duke
parents:
diff changeset
   226
                                    getManagementSpecVersion());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   227
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   228
90ce3da70b43 Initial load
duke
parents:
diff changeset
   229
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   230
     * Getter for the "JvmRTVMName" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   231
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   232
    public String getJvmRTVMName() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   233
        return validJavaObjectNameTC(getRuntimeMXBean().getVmName());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   234
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   235
90ce3da70b43 Initial load
duke
parents:
diff changeset
   236
90ce3da70b43 Initial load
duke
parents:
diff changeset
   237
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   238
     * Getter for the "JvmRTInputArgsCount" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   239
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   240
    public Integer getJvmRTInputArgsCount() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   241
90ce3da70b43 Initial load
duke
parents:
diff changeset
   242
        final String[] args = getInputArguments(JvmContextFactory.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   243
                                                getUserData());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   244
        return new Integer(args.length);
90ce3da70b43 Initial load
duke
parents:
diff changeset
   245
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   246
90ce3da70b43 Initial load
duke
parents:
diff changeset
   247
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   248
     * Getter for the "JvmRTBootClassPathSupport" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   249
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   250
    public EnumJvmRTBootClassPathSupport getJvmRTBootClassPathSupport()
90ce3da70b43 Initial load
duke
parents:
diff changeset
   251
        throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   252
        if(getRuntimeMXBean().isBootClassPathSupported())
90ce3da70b43 Initial load
duke
parents:
diff changeset
   253
            return JvmRTBootClassPathSupportSupported;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   254
        else
90ce3da70b43 Initial load
duke
parents:
diff changeset
   255
            return JvmRTBootClassPathSupportUnSupported;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   256
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   257
90ce3da70b43 Initial load
duke
parents:
diff changeset
   258
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   259
     * Getter for the "JvmRTUptimeMs" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   260
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   261
    public Long getJvmRTUptimeMs() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   262
        return new Long(getRuntimeMXBean().getUptime());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   263
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   264
90ce3da70b43 Initial load
duke
parents:
diff changeset
   265
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   266
     * Getter for the "JvmRTStartTimeMs" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   267
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   268
    public Long getJvmRTStartTimeMs() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   269
        return new Long(getRuntimeMXBean().getStartTime());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   270
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   271
90ce3da70b43 Initial load
duke
parents:
diff changeset
   272
    /**
90ce3da70b43 Initial load
duke
parents:
diff changeset
   273
     * Getter for the "JvmRTSpecVersion" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   274
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   275
    public String getJvmRTSpecVersion() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   276
        return validDisplayStringTC(getRuntimeMXBean().getSpecVersion());
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 "JvmRTName" variable.
90ce3da70b43 Initial load
duke
parents:
diff changeset
   281
     */
90ce3da70b43 Initial load
duke
parents:
diff changeset
   282
    public String getJvmRTName() throws SnmpStatusException {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   283
        return validDisplayStringTC(getRuntimeMXBean().getName());
90ce3da70b43 Initial load
duke
parents:
diff changeset
   284
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   285
90ce3da70b43 Initial load
duke
parents:
diff changeset
   286
}