本文整理汇总了Java中com.sun.jmx.mbeanserver.Util类的典型用法代码示例。如果您正苦于以下问题:Java Util类的具体用法?Java Util怎么用?Java Util使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Util类属于com.sun.jmx.mbeanserver包,在下文中一共展示了Util类的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: updateCachedDatas
import com.sun.jmx.mbeanserver.Util; //导入依赖的package包/类
/**
* Update cahed datas.
* Obtains a {@link List} of raw datas by calling
* {@link #getRawDatas(Map,String) getRawDatas((Map)context,getRawDatasKey())}.<br>
* Then allocate a new {@link TreeMap} to serve as temporary map between
* names and indexes, and call {@link #updateCachedDatas(Object,List)}
* with that temporary map as context.<br>
* Finally replaces the {@link #names} TreeMap by the temporary
* TreeMap.
* @param context The request contextual cache allocated by the
* {@link JvmContextFactory}.
**/
protected SnmpCachedData updateCachedDatas(Object context) {
final Map<Object, Object> userData =
(context instanceof Map)?Util.<Map<Object, Object>>cast(context):null;
// Look for memory manager list in request contextual cache.
final List<?> rawDatas = getRawDatas(userData,getRawDatasKey());
log.debug("updateCachedDatas","rawDatas.size()=" +
((rawDatas==null)?"<no data>":""+rawDatas.size()));
TreeMap<String,SnmpOid> ctxt = new TreeMap<>();
final SnmpCachedData result =
super.updateCachedDatas(ctxt,rawDatas);
names = ctxt;
return result;
}
示例2: getMemoryPools
import com.sun.jmx.mbeanserver.Util; //导入依赖的package包/类
/**
* Get the list of memory pool associated with the
* given MemoryManagerMXBean.
**/
protected String[] getMemoryPools(Object userData,
MemoryManagerMXBean mmm, long mmarc) {
final String listTag =
"JvmMemManager." + mmarc + ".getMemoryPools";
String[] result=null;
if (userData instanceof Map) {
result = (String[])((Map)userData).get(listTag);
if (result != null) return result;
}
if (mmm!=null) {
result = mmm.getMemoryPoolNames();
}
if ((result!=null)&&(userData instanceof Map)) {
Map<Object, Object> map = Util.cast(userData);
map.put(listTag,result);
}
return result;
}
示例3: getClassPath
import com.sun.jmx.mbeanserver.Util; //导入依赖的package包/类
static String[] getClassPath(Object userData) {
final Map<Object, Object> m =
Util.cast((userData instanceof Map)?userData:null);
final String tag = "JvmRuntime.getClassPath";
// If the list is in the cache, simply return it.
//
if (m != null) {
final String[] cached = (String[])m.get(tag);
if (cached != null) return cached;
}
final String[] args = splitPath(getRuntimeMXBean().getClassPath());
if (m != null) m.put(tag,args);
return args;
}
示例4: getBootClassPath
import com.sun.jmx.mbeanserver.Util; //导入依赖的package包/类
static String[] getBootClassPath(Object userData) {
if (!getRuntimeMXBean().isBootClassPathSupported())
return new String[0];
final Map<Object, Object> m =
Util.cast((userData instanceof Map)?userData:null);
final String tag = "JvmRuntime.getBootClassPath";
// If the list is in the cache, simply return it.
//
if (m != null) {
final String[] cached = (String[])m.get(tag);
if (cached != null) return cached;
}
final String[] args = splitPath(getRuntimeMXBean().getBootClassPath());
if (m != null) m.put(tag,args);
return args;
}
示例5: getLibraryPath
import com.sun.jmx.mbeanserver.Util; //导入依赖的package包/类
static String[] getLibraryPath(Object userData) {
final Map<Object, Object> m =
Util.cast((userData instanceof Map)?userData:null);
final String tag = "JvmRuntime.getLibraryPath";
// If the list is in the cache, simply return it.
//
if (m != null) {
final String[] cached = (String[])m.get(tag);
if (cached != null) return cached;
}
final String[] args = splitPath(getRuntimeMXBean().getLibraryPath());
if (m != null) m.put(tag,args);
return args;
}
示例6: getInputArguments
import com.sun.jmx.mbeanserver.Util; //导入依赖的package包/类
static String[] getInputArguments(Object userData) {
final Map<Object, Object> m =
Util.cast((userData instanceof Map)?userData:null);
final String tag = "JvmRuntime.getInputArguments";
// If the list is in the cache, simply return it.
//
if (m != null) {
final String[] cached = (String[])m.get(tag);
if (cached != null) return cached;
}
final List<String> l = getRuntimeMXBean().getInputArguments();
final String[] args = l.toArray(new String[0]);
if (m != null) m.put(tag,args);
return args;
}
示例7: addListenerWithSubject
import com.sun.jmx.mbeanserver.Util; //导入依赖的package包/类
private Integer addListenerWithSubject(ObjectName name,
MarshalledObject<NotificationFilter> filter,
Subject delegationSubject,
boolean reconnect)
throws InstanceNotFoundException, IOException {
final boolean debug = logger.debugOn();
if (debug)
logger.debug("addListenerWithSubject",
"(ObjectName,MarshalledObject,Subject)");
final ObjectName[] names = new ObjectName[] {name};
final MarshalledObject<NotificationFilter>[] filters =
Util.cast(new MarshalledObject<?>[] {filter});
final Subject[] delegationSubjects = new Subject[] {
delegationSubject
};
final Integer[] listenerIDs =
addListenersWithSubjects(names,filters,delegationSubjects,
reconnect);
if (debug) logger.debug("addListenerWithSubject","listenerID="
+ listenerIDs[0]);
return listenerIDs[0];
}