Questa regola contrassegna l'utilizzo dei seguenti metodi di gestione dell'applicazione:
Tali metodi sono stati resi obsoleti in WebSphere Application Server Versione 5.0 e non forniscono alcuna funzionalità. Possono essere sostituiti con chiamate al metodo setModuleInfo nella stessa classe.
Ad esempio, una chiamata a moveModule potrebbe essere simile a quella riportata di seguito:
|
appManagement.moveModule(appName, prefs, uniqueModuleURI, objectName, workspaceID);
|
Utilizzando molti degli stessi argomenti, può essere codificata utilizzando il metodo setModuleInfo. Di seguito viene visualizzato un esempio:
|
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); } |
Per ulteriori informazioni sulla classe, consultare