MBeanClientInterceptor.java 文件源码

java
阅读 31 收藏 0 点赞 0 评论 0

项目:lams 作者:
/**
 * Ensures that an {@code MBeanServerConnection} is configured and attempts
 * to detect a local connection if one is not supplied.
 */
public void prepare() {
    synchronized (this.preparationMonitor) {
        if (this.server != null) {
            this.serverToUse = this.server;
        }
        else {
            this.serverToUse = null;
            this.serverToUse = this.connector.connect(this.serviceUrl, this.environment, this.agentId);
        }
        this.invocationHandler = null;
        if (this.useStrictCasing) {
            // Use the JDK's own MBeanServerInvocationHandler,
            // in particular for native MXBean support on Java 6.
            if (JmxUtils.isMXBeanSupportAvailable()) {
                this.invocationHandler =
                        new MBeanServerInvocationHandler(this.serverToUse, this.objectName,
                                (this.managementInterface != null && JMX.isMXBeanInterface(this.managementInterface)));
            }
            else {
                this.invocationHandler = new MBeanServerInvocationHandler(this.serverToUse, this.objectName);
            }
        }
        else {
            // Non-strict casing can only be achieved through custom
            // invocation handling. Only partial MXBean support available!
            retrieveMBeanInfo();
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号