1 Star 0 Fork 2

yxljava/Java8Source

forked from Stefan/Java8Source 
加入 Gitee
与超过 1400万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
QueryEval.java 1.79 KB
一键复制 编辑 原始数据 按行查看 历史
Stefan 提交于 2020-08-11 23:17 +08:00 . 初始化
/*
* Copyright (c) 1999, 2008, Oracle and/or its affiliates. All rights reserved.
* ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*
*/
package javax.management;
// java import
import java.io.Serializable;
/**
* Allows a query to be performed in the context of a specific MBean server.
*
* @since 1.5
*/
public abstract class QueryEval implements Serializable {
/* Serial version */
private static final long serialVersionUID = 2675899265640874796L;
private static ThreadLocal<MBeanServer> server =
new InheritableThreadLocal<MBeanServer>();
/**
* <p>Sets the MBean server on which the query is to be performed.
* The setting is valid for the thread performing the set.
* It is copied to any threads created by that thread at the moment
* of their creation.</p>
*
* <p>For historical reasons, this method is not static, but its
* behavior does not depend on the instance on which it is
* called.</p>
*
* @param s The MBean server on which the query is to be performed.
*
* @see #getMBeanServer
*/
public void setMBeanServer(MBeanServer s) {
server.set(s);
}
/**
* <p>Return the MBean server that was most recently given to the
* {@link #setMBeanServer setMBeanServer} method by this thread.
* If this thread never called that method, the result is the
* value its parent thread would have obtained from
* <code>getMBeanServer</code> at the moment of the creation of
* this thread, or null if there is no parent thread.</p>
*
* @return the MBean server.
*
* @see #setMBeanServer
*
*/
public static MBeanServer getMBeanServer() {
return server.get();
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Java
1
https://gitee.com/yxljava/Java8Source.git
git@gitee.com:yxljava/Java8Source.git
yxljava
Java8Source
Java8Source
master

搜索帮助