/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
// jmx imports
//
// jdmk imports
//
/**
* The class is used for implementing the "JvmMemory" group.
*/
/**
* Variable for storing the value of "JvmMemoryGCCall".
*
* "This object makes it possible to remotelly trigger the
* Garbage Collector in the JVM.
*
* This object's syntax is an enumeration which defines:
*
* * Two state values, that can be returned from a GET request:
*
* unsupported(1): means that remote invocation of gc() is not
* supported by the SNMP agent.
* supported(2) : means that remote invocation of gc() is supported
* by the SNMP agent.
*
* * One action value, that can be provided in a SET request to
* trigger the garbage collector:
*
* start(3) : means that a manager wishes to trigger
* garbage collection.
*
* * Two result value, that will be returned as a result of a
* SET request when remote invocation of gc is supported
* by the SNMP agent:
*
* started(4) : means that garbage collection was
* successfully triggered. It does not mean
* however that the action was successfullly
* completed: gc might still be running when
* this value is returned.
* failed(5) : means that garbage collection couldn't be
* triggered.
*
* * If remote invocation is not supported by the SNMP agent, then
* unsupported(1) will always be returned as a result of either
* a GET request, or a SET request with start(3) as input value.
*
* * If a SET request with anything but start(3) is received, then
* the agent will return a wrongValue error.
*
* See java.management.MemoryMXBean.gc()
* "
*
*/
= new EnumJvmMemoryGCCall("supported");
= new EnumJvmMemoryGCCall("start");
= new EnumJvmMemoryGCCall("failed");
= new EnumJvmMemoryGCCall("started");
/**
* Variable for storing the value of "JvmMemoryGCVerboseLevel".
*
* "State of the -verbose:gc state.
*
* verbose: if the -verbose:gc flag is on,
* silent: otherwise.
*
* See java.management.MemoryMXBean.isVerbose(),
* java.management.MemoryMXBean.setVerbose()
* "
*
*/
new EnumJvmMemoryGCVerboseLevel("verbose");
new EnumJvmMemoryGCVerboseLevel("silent");
/**
* Constructor for the "JvmMemory" group.
* If the group contains a table, the entries created through an
* SNMP SET will not be registered in Java DMK.
*/
}
/**
* Constructor for the "JvmMemory" group.
* If the group contains a table, the entries created through an
* SNMP SET will be AUTOMATICALLY REGISTERED in Java DMK.
*/
// no entry will be registered since the table is virtual.
}
} else {
}
}
try {
if (m != null) {
m.get(nonHeapMemoryTag);
"jvmMemory.getNonHeapMemoryUsage found in cache.");
return cached;
}
// getNonHeapMemoryUsage() never returns null.
//
// if (u == null) u=MemoryUsage.INVALID;
m.put(nonHeapMemoryTag,u);
return u;
}
// Should never come here.
// Log error!
"ERROR: should never come here!");
} catch (RuntimeException x) {
"Failed to get NonHeapMemoryUsage: " + x);
throw x;
}
}
try {
if (m != null) {
"jvmMemory.getHeapMemoryUsage found in cache.");
return cached;
}
// getHeapMemoryUsage() never returns null.
//
// if (u == null) u=MemoryUsage.INVALID;
m.put(heapMemoryTag,u);
return u;
}
// Should never come here.
// Log error!
} catch (RuntimeException x) {
"Failed to get HeapMemoryUsage: " + x);
throw x;
}
}
/**
* Getter for the "JvmMemoryNonHeapMaxSize" variable.
*/
throws SnmpStatusException {
else return Long0;
}
/**
* Getter for the "JvmMemoryNonHeapCommitted" variable.
*/
else return Long0;
}
/**
* Getter for the "JvmMemoryNonHeapUsed" variable.
*/
else return Long0;
}
/**
* Getter for the "JvmMemoryNonHeapInitSize" variable.
*/
else return Long0;
}
/**
* Getter for the "JvmMemoryHeapMaxSize" variable.
*/
else return Long0;
}
/**
* Getter for the "JvmMemoryGCCall" variable.
*/
throws SnmpStatusException {
if (m != null) {
final EnumJvmMemoryGCCall cached
}
return JvmMemoryGCCallSupported;
}
/**
* Setter for the "JvmMemoryGCCall" variable.
*/
throws SnmpStatusException {
try {
}
return;
}
}
/**
* Checker for the "JvmMemoryGCCall" variable.
*/
throws SnmpStatusException {
}
/**
* Getter for the "JvmMemoryHeapCommitted" variable.
*/
else return Long0;
}
/**
* Getter for the "JvmMemoryGCVerboseLevel" variable.
*/
throws SnmpStatusException {
return JvmMemoryGCVerboseLevelVerbose;
else
return JvmMemoryGCVerboseLevelSilent;
}
/**
* Setter for the "JvmMemoryGCVerboseLevel" variable.
*/
throws SnmpStatusException {
else
}
/**
* Checker for the "JvmMemoryGCVerboseLevel" variable.
*/
throws SnmpStatusException {
// Nothing to check...
}
/**
* Getter for the "JvmMemoryHeapUsed" variable.
*/
else return Long0;
}
/**
* Getter for the "JvmMemoryHeapInitSize" variable.
*/
else return Long0;
}
/**
* Getter for the "JvmMemoryPendingFinalCount" variable.
*/
throws SnmpStatusException {
// Should never happen... but stay safe all the same.
//
else return new Long(0);
}
}