この規則により、以下のアプリケーション管理メソッドの使用にフラグを立てます。
-
com.ibm.websphere.management.application.AppManagement.moveModule()
-
com.ibm.websphere.management.application.AppManagementProxy.moveModule()
これらのメソッドは WebSphere Application Server バージョン 5.0 で非推奨となり、機能を提供しません。 これらは、以下の呼び出しに置き換えることができます。
setModuleInfo
同じクラス内のメソッド。
例えば、
moveModule
次のようになります。
< span class="Code">
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);
}
追加のクラス情報については、以下を参照してください。