避免使用不推荐的命令管理器方法

此规则会标记下列不推荐的方法:

CommandMgrInitializer 方法在 WebSphere Application Server V 6.0中已不推荐使用,并且 CommandMgr 版本 7.0中不推荐使用此方法。 它们可能会在将来发行版中移除。

对于所有四种方法,请使用 CommandMgr.getCommandMgr(AdminClient) 而是

自动修复将把废弃方法改为首选方法。 如果类的导入 com.ibm.websphere.management.cmdframework.CommandMgr , 那么自动修复将使用简单类名 ( CommandMgr ) 进行替换。 如果未找到 import,那么将使用标准名称 (com.ibm.websphere.management.cmdframework.CommandMgr)。

例如:

import com.ibm.websphere.management.cmdframework.*;
public class MyClass {
// some code
CommandMgrInitializer.initializeLocalMode();
// some code
}

先前示例将更改为:

import com.ibm.websphere.management.cmdframework.*;
public class MyClass {
// some code
CommandMgr.getCommandMgr();
// some code
}

如果,上述示例中的 import 语句为: import com.ibm.websphere.management.cmdframework.CommandMgrInitializer; 那么更新后的代码将为:
import com.ibm.websphere.management.cmdframework.CommandMgrInitializer;
public class MyClass {
// some code
com.ibm.websphere.management.cmdframework.CommandMgr.getCommandMgr();
// some code
}

有关更多类信息,请参阅 Knowledge Center 中的下列内容:

在文档中。

文档中包含完整的 不推荐使用的 API 列表。