/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation. Oracle designates this
* particular file as subject to the "Classpath" exception as provided
* by Oracle in the LICENSE file that accompanied this code.
*
* This code is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
* version 2 for more details (a copy is included in the LICENSE file that
* accompanied this code).
*
* You should have received a copy of the GNU General Public License version
* 2 along with this work; if not, write to the Free Software Foundation,
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
*
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
* or visit www.oracle.com if you need additional information or have any
* questions.
*/
// java imports
//
// jmx imports
//
// jdmk imports
//
//java management imports
new MibLogger(JVM_MANAGEMENT_MIB_IMPL.class);
table = new JVM_MANAGEMENT_MIBOidTable();
return table;
}
table = new JVM_MANAGEMENT_MIBOidTable();
}
return table;
}
/**
* Handler waiting for memory <CODE>Notification</CODE>.
* Translate each JMX notification in SNMP trap.
*/
if (entryIndex == null) {
"Error: Can't find entry index for Memory Pool: "
"No trap emitted for " + type);
return;
}
try {
usedOid =
"." + entryIndex);
countOid =
+ "." + entryIndex);
resolveVarName("jvmLowMemoryPoolCollectNotif").
getOid());
usedOid =
"." + entryIndex);
countOid =
resolveVarName("jvmMemPoolCollectThreshdCount").
getOid() +
"." + entryIndex);
}
//Datas
"." + entryIndex);
poolName);
}catch(Exception e) {
"Exception occured : " + e);
}
}
}
}
/**
* List of notification targets.
*/
new ArrayList<NotificationTarget>();
/**
* Instantiate a JVM MIB intrusmentation.
* A <CODE>NotificationListener</CODE> is added to the <CODE>MemoryMXBean</CODE>
* <CODE>NotificationEmitter</CODE>
*/
public JVM_MANAGEMENT_MIB_IMPL() {
handler = new NotificationHandler();
}
final SnmpAdaptorServer adaptor =
return;
}
return;
}
try {
SnmpParameters p = new SnmpParameters();
}catch(Exception e) {
"Exception occured while sending trap to [" +
target + "]. Exception : " + e);
}
}
}
/**
* Add a notification target.
* @param target The target to add
* @throws IllegalArgumentException If target parameter is null.
*/
throws IllegalArgumentException {
throw new IllegalArgumentException("Target is null");
}
/**
* Remove notification listener.
*/
public void terminate() {
try {
}catch(ListenerNotFoundException e) {
}
}
/**
* Add notification targets.
* @param targets A list of
* <CODE>sun.management.snmp.jvminstr.NotificationTarget</CODE>
* @throws IllegalArgumentException If targets parameter is null.
*/
throws IllegalArgumentException {
throw new IllegalArgumentException("Target list is null");
}
/**
* Factory method for "JvmMemory" group MBean.
*
* You can redefine this method if you need to replace the default
* generated MBean class with your own customized class.
*
* @param groupName Name of the group ("JvmMemory")
* @param groupOid OID of this group
* @param groupObjname ObjectName for this group (may be null)
* @param server MBeanServer for this group (may be null)
*
* @return An instance of the MBean class generated for the
* "JvmMemory" group (JvmMemory)
*
* Note that when using standard metadata,
* the returned object must implement the "JvmMemoryMBean"
* interface.
**/
// Note that when using standard metadata,
// the returned object must implement the "JvmMemoryMBean"
// interface.
//
return new JvmMemoryImpl(this,server);
else
return new JvmMemoryImpl(this);
}
/**
* Factory method for "JvmMemory" group metadata class.
*
* You can redefine this method if you need to replace the default
* generated metadata class with your own customized class.
*
* @param groupName Name of the group ("JvmMemory")
* @param groupOid OID of this group
* @param groupObjname ObjectName for this group (may be null)
* @param server MBeanServer for this group (may be null)
*
* @return An instance of the metadata class generated for the
* "JvmMemory" group (JvmMemoryMeta)
*
**/
return new JvmMemoryMetaImpl(this, objectserver);
}
/**
* Factory method for "JvmThreading" group metadata class.
*
* You can redefine this method if you need to replace the default
* generated metadata class with your own customized class.
*
* @param groupName Name of the group ("JvmThreading")
* @param groupOid OID of this group
* @param groupObjname ObjectName for this group (may be null)
* @param server MBeanServer for this group (may be null)
*
* @return An instance of the metadata class generated for the
* "JvmThreading" group (JvmThreadingMeta)
*
**/
return new JvmThreadingMetaImpl(this, objectserver);
}
/**
* Factory method for "JvmThreading" group MBean.
*
* You can redefine this method if you need to replace the default
* generated MBean class with your own customized class.
*
* @param groupName Name of the group ("JvmThreading")
* @param groupOid OID of this group
* @param groupObjname ObjectName for this group (may be null)
* @param server MBeanServer for this group (may be null)
*
* @return An instance of the MBean class generated for the
* "JvmThreading" group (JvmThreading)
*
* Note that when using standard metadata,
* the returned object must implement the "JvmThreadingMBean"
* interface.
**/
// Note that when using standard metadata,
// the returned object must implement the "JvmThreadingMBean"
// interface.
//
return new JvmThreadingImpl(this,server);
else
return new JvmThreadingImpl(this);
}
/**
* Factory method for "JvmRuntime" group metadata class.
*
* You can redefine this method if you need to replace the default
* generated metadata class with your own customized class.
*
* @param groupName Name of the group ("JvmRuntime")
* @param groupOid OID of this group
* @param groupObjname ObjectName for this group (may be null)
* @param server MBeanServer for this group (may be null)
*
* @return An instance of the metadata class generated for the
* "JvmRuntime" group (JvmRuntimeMeta)
*
**/
return new JvmRuntimeMetaImpl(this, objectserver);
}
/**
* Factory method for "JvmRuntime" group MBean.
*
* You can redefine this method if you need to replace the default
* generated MBean class with your own customized class.
*
* @param groupName Name of the group ("JvmRuntime")
* @param groupOid OID of this group
* @param groupObjname ObjectName for this group (may be null)
* @param server MBeanServer for this group (may be null)
*
* @return An instance of the MBean class generated for the
* "JvmRuntime" group (JvmRuntime)
*
* Note that when using standard metadata,
* the returned object must implement the "JvmRuntimeMBean"
* interface.
**/
// Note that when using standard metadata,
// the returned object must implement the "JvmRuntimeMBean"
// interface.
//
return new JvmRuntimeImpl(this,server);
else
return new JvmRuntimeImpl(this);
}
/**
* Factory method for "JvmCompilation" group metadata class.
*
* You can redefine this method if you need to replace the default
* generated metadata class with your own customized class.
*
* @param groupName Name of the group ("JvmCompilation")
* @param groupOid OID of this group
* @param groupObjname ObjectName for this group (may be null)
* @param server MBeanServer for this group (may be null)
*
* @return An instance of the metadata class generated for the
* "JvmCompilation" group (JvmCompilationMeta)
*
**/
protected JvmCompilationMeta
// If there is no compilation system, the jvmCompilation will not
// be instantiated.
//
}
/**
* Factory method for "JvmCompilation" group MBean.
*
* You can redefine this method if you need to replace the default
* generated MBean class with your own customized class.
*
* @param groupName Name of the group ("JvmCompilation")
* @param groupOid OID of this group
* @param groupObjname ObjectName for this group (may be null)
* @param server MBeanServer for this group (may be null)
*
* @return An instance of the MBean class generated for the
* "JvmCompilation" group (JvmCompilation)
*
* Note that when using standard metadata,
* the returned object must implement the "JvmCompilationMBean"
* interface.
**/
// Note that when using standard metadata,
// the returned object must implement the "JvmCompilationMBean"
// interface.
//
return new JvmCompilationImpl(this,server);
else
return new JvmCompilationImpl(this);
}
/**
* Factory method for "JvmOS" group MBean.
*
* You can redefine this method if you need to replace the default
* generated MBean class with your own customized class.
*
* @param groupName Name of the group ("JvmOS")
* @param groupOid OID of this group
* @param groupObjname ObjectName for this group (may be null)
* @param server MBeanServer for this group (may be null)
*
* @return An instance of the MBean class generated for the
* "JvmOS" group (JvmOS)
*
* Note that when using standard metadata,
* the returned object must implement the "JvmOSMBean"
* interface.
**/
// Note that when using standard metadata,
// the returned object must implement the "JvmOSMBean"
// interface.
//
else
return new JvmOSImpl(this);
}
/**
* Factory method for "JvmClassLoading" group MBean.
*
* You can redefine this method if you need to replace the default
* generated MBean class with your own customized class.
*
* @param groupName Name of the group ("JvmClassLoading")
* @param groupOid OID of this group
* @param groupObjname ObjectName for this group (may be null)
* @param server MBeanServer for this group (may be null)
*
* @return An instance of the MBean class generated for the
* "JvmClassLoading" group (JvmClassLoading)
*
* Note that when using standard metadata,
* the returned object must implement the "JvmClassLoadingMBean"
* interface.
**/
// Note that when using standard metadata,
// the returned object must implement the "JvmClassLoadingMBean"
// interface.
//
return new JvmClassLoadingImpl(this,server);
else
return new JvmClassLoadingImpl(this);
}
}
else
return str;
}
}
else
return str;
}
}
else
return str;
}
}
else
return str;
}
/**
* WARNING: This should probably be moved to JvmMemPoolTableMetaImpl
**/
final SnmpMibTable meta =
getRegisteredTableMeta("JvmMemPoolTable");
if (! (meta instanceof JvmMemPoolTableMetaImpl)) {
"Bad metadata class for JvmMemPoolTable: " +
return null;
}
final JvmMemPoolTableMetaImpl memPoolTable =
}
/**
* WARNING: This should probably be moved to JvmMemPoolTableMetaImpl
**/
if (!(handler instanceof SnmpCachedData)) {
}
return -1;
}
}
return -1;
}
/**
* WARNING: This should probably be moved to JvmMemPoolTableMetaImpl
**/
}
poolName);
}
// cache validity
//
// Should we define a property for this? Should we have different
// cache validity periods depending on which table we cache?
//
public long validity() {
return DEFAULT_CACHE_VALIDITY_PERIOD;
}
// Defined in RFC 2579
}