此规则会标记是否使用了下列应用程序管理方法:
WebSphere Application Server V5.0 中已不推荐使用这些方法,它们未提供任何功能。 可以将它们替换为对同一个类中 setModuleInfo 方法的调用。
例如,对 moveModule 的调用可能类似于以下内容:
|
appManagement.moveModule(appName, prefs, uniqueModuleURI, objectName, workspaceID);
|
通过使用许多相同的自变量,可以使用 setModuleInfo 方法对它进行编码。 以下显示的是一个样本:
|
int TARGET_COL = 2; String newTarget = null; // Get the new target from the ObjectName if (objectName.getKeyProperty("server")!=null) { newTarget = objectName.getKeyProperty("server"); } else if (objectName.getKeyProperty("cluster")!=null) { newTarget = objectName.getKeyProperty("cluster"); } if (newTarget!=null) { Vector taskVector = appManagement.getModuleInfo(appName, prefs, uniqueModuleURI, workspaceID); Iterator iter = taskVector.iterator(); // Loop through the task data while ( iter.hasNext()) { AppDeploymentTask task = (AppDeploymentTask) iter.next(); String taskName = task.getName().trim(); // Find the MapModulesToServers task if (taskName.equals("MapModulesToServers")) { String[][] taskData = task.getTaskData(); for (int i=1; i<taskData.length; i++) { // update the target taskData[i][TARGET_COL] = newTarget; } break; } } appManagement.setModuleInfo(appName, prefs, uniqueModuleURI, workspaceID, taskVector); } |
有关更多类信息,请参阅信息中心中的下列内容: