この規則により、以下のアプリケーション管理メソッドの使用にフラグを立てます。
これらのメソッドは WebSphere Application Server バージョン 5.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); } |
追加のクラス情報については、以下を参照してください。