JMXAccessorTask.java 文件源码

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

项目:lazycat 作者:
/**
 * Execute the specified command. This logic only performs the common
 * attribute validation required by all subclasses; it does not perform any
 * functional logic directly.
 * 
 * @exception BuildException
 *                if a validation error occurs
 */
@Override
public void execute() throws BuildException {
    if (testIfCondition() && testUnlessCondition()) {
        try {
            String error = null;

            MBeanServerConnection jmxServerConnection = getJMXConnection();
            error = jmxExecute(jmxServerConnection);
            if (error != null && isFailOnError()) {
                // exception should be thrown only if failOnError == true
                // or error line will be logged twice
                throw new BuildException(error);
            }
        } catch (Exception e) {
            if (isFailOnError()) {
                throw new BuildException(e);
            } else {
                handleErrorOutput(e.getMessage());
            }
        } finally {
            closeRedirector();
        }
    }
}
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号