|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.websphere.management.application.client.AppDeploymentController
The AppDeploymentController instance is used to prepare an application
EAR file before installing it in WebSphere cell. The prparation phase involves
collecting WebSphere-specific information, collectively known as bindings,
that are used to tie deployment descriptors of application and its modules to
WebSphere runtime.
The AppDeploymentController instance is created using a static factory method.
It takes a local EAR file and creates a sequence of AppDeploymentTask objects (tasks)
that are used collect various pieces of information needed to prepare the application.
Once all the tasks are processed and the necessary information is collected, the
AppDeploymentController instance is saved which saves some of the task data back into
the EAR file and the rest to a hashtable. The updated EAR file and the hashtable returned by
the AppDeploymentController can be passed to the AppManagement MBean in its
installApplication API. The following sample code shows this operation -
// Create controller String earFile = "C:/temp/foo.ear"; // EAR file to be installed Hashtable tbl = new Hashtable(); tbl.put (AppConstants.APPDEPL_LOCALE, Locale.getDefault()); AppDeploymentController controller = AppDeploymentController.readArchive (earFile, tbl); // iterate through tasks AppDeploymentTask installTask = controller.getFirstTask(); while (installTask != null) { // display the task String[][] data = installTask.getTaskData(); // The task data is displayed in client specific manner. // Or it can be used to set specific task data by looking for a particular task name. installTask.setTaskData (data); // once it is changed installTask = controller.getNextTask(); } // save the data back into ear file and the options table owned by the controller controller.saveAndClose(); // get options saved by controller Hashtable options = controller.getAppOptions(); // use the ear file and options table to install the app AdminClient adminClient = // create admin client AppManagementProxy proxy = AppManagementProxy.getJMXProxyForClient (adminClient); proxy.installApplication (earFile, "SomeAppName", options, null);
Field Summary | |
---|---|
protected int |
currentTask
|
protected com.ibm.websphere.management.application.client.AppDeploymentInfo |
deploymentInfo
|
protected java.util.ResourceBundle |
resBundle
|
static java.lang.String |
taskHelperSuffix
|
protected java.util.Vector |
taskInfo
|
protected java.util.Vector |
taskNames
|
protected java.util.Vector |
tasks
|
Constructor Summary | |
---|---|
AppDeploymentController(com.ibm.websphere.management.application.client.AppDeploymentInfo info,
java.util.Hashtable prefs,
java.util.Vector taskI)
Returns a new AppDeploymentController instance. |
|
AppDeploymentController(com.ibm.websphere.management.application.client.AppDeploymentInfo info,
java.util.Vector tAll,
java.util.Hashtable prefs,
java.util.Vector taskI)
Returns a new AppDeploymentController instance. |
|
AppDeploymentController(java.util.Vector tAll,
java.util.Vector taskI,
java.util.Hashtable prefs)
Returns a new AppDeploymentController instance. |
Method Summary | |
---|---|
void |
close(boolean bSave,
boolean bValidate,
boolean bClose)
Closes the archive and saves it optionally. |
protected static java.util.Vector |
createAppDeploymentDependencyTaskHelpers()
|
protected static java.util.Vector |
createAppDeploymentTaskHelpers(java.util.Vector tNames)
|
protected static java.util.Vector |
createAppDeploymentTaskNames()
|
protected void |
createAppDeploymentTasks()
|
java.util.Vector |
getAllTasks()
Returns all tasks. |
java.util.Hashtable |
getAppDeploymentSavedResults()
Returns the saved results at the end of app preparation phase. |
java.lang.String[] |
getAppDeploymentTaskNames()
Returns the task names for all the tasks that should be executed during app preparation phase. |
java.util.Hashtable |
getAppOptions()
Returns the app deployment options from the AppDeploymentInfo instance. |
static java.util.Vector |
getDefaultTaskInfo(com.ibm.websphere.management.application.client.AppDeploymentInfo appInfo)
Deprecated. Returns the default task info objects that are used to create the default tasks during app preparation. |
static java.util.Vector |
getDefaultTaskInfo(com.ibm.websphere.management.application.client.AppDeploymentInfo appInfo,
java.util.Hashtable prefs)
Deprecated. Returns the default task info objects that are used to create the default tasks during app preparation. |
protected void |
getDependencyTask(int i)
|
void |
getDependencyTask(java.lang.String taskName)
Executes the dependency resolver for the given task |
AppDeploymentTask |
getFirstTask()
Returns the first Task object in the client side preparation process. |
AppDeploymentTask |
getNextTask()
Returns the next Task object in the client side preparation process. |
protected AppDeploymentTask |
getNthTask(int i)
|
java.lang.String |
getSecurityPolicyData()
|
java.lang.String |
getSecurityPolicyWarning()
|
AppDeploymentTask |
getTaskByName(java.lang.String taskName)
Returns the task with a given name |
AppDeploymentTask |
getTaskByName(java.lang.String taskName,
boolean b)
Returns the task with a given name |
protected com.ibm.websphere.management.application.client.AppDeploymentTaskHelper |
getTaskHelper(int taskIndex)
|
protected static com.ibm.websphere.management.application.client.AppDeploymentTaskHelper |
getTaskHelper(java.lang.String taskName)
|
com.ibm.websphere.management.application.client.AppDeploymentTaskInfo |
getTaskInfo()
Deprecated. Returns AppDeploymentTaskInfo instance for current task. |
com.ibm.websphere.management.application.client.AppDeploymentTaskInfo |
getTaskInfo(java.lang.String taskName)
Deprecated. Returns AppDeploymentTaskInfo instance for given task. |
protected void |
handlePreferences(java.util.Hashtable instPrefs)
|
protected void |
initializeEncoderDecoder()
|
boolean |
isPartialDeploymentInfo()
Returns whether the archive for this AppDeploymentController is opened for editing/viewing. |
protected void |
prepareTask(int i,
AppDeploymentTask task)
|
static AppDeploymentController |
readArchive(java.lang.String ear,
java.util.Hashtable preferences)
Creates a new instance of AppDeploymentController for a given application EAR file and a set of preferences. |
static AppDeploymentController |
readArchive(java.lang.String ear,
java.util.Hashtable preferences,
java.util.Vector taskI)
Creates a new instance of AppDeploymentController for a given application EAR file and a set of preferences. |
void |
saveAndClose()
Saves the task data back into application archive. |
void |
saveAsFile(java.lang.String moduleUri,
java.lang.String fileUriInModule,
java.io.InputStream inputStream)
Save the input stream as a file in the specified location |
void |
setAppOptions(java.util.Hashtable tbl)
Sets the app deployment options from the AppDeploymentInfo instance. |
java.lang.String[] |
validate()
Validates the task data. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final java.lang.String taskHelperSuffix
protected java.util.Vector taskInfo
protected java.util.Vector taskNames
protected java.util.Vector tasks
protected int currentTask
protected transient com.ibm.websphere.management.application.client.AppDeploymentInfo deploymentInfo
protected transient java.util.ResourceBundle resBundle
Constructor Detail |
public AppDeploymentController(com.ibm.websphere.management.application.client.AppDeploymentInfo info, java.util.Hashtable prefs, java.util.Vector taskI) throws AppDeploymentException
info
- The application information objectprefs
- PreferencestaskI
- The task related informationpublic AppDeploymentController(java.util.Vector tAll, java.util.Vector taskI, java.util.Hashtable prefs) throws AppDeploymentException
tAll
- All tasksprefs
- PreferencestaskI
- The task related informationpublic AppDeploymentController(com.ibm.websphere.management.application.client.AppDeploymentInfo info, java.util.Vector tAll, java.util.Hashtable prefs, java.util.Vector taskI) throws AppDeploymentException
info
- The application information objecttAll
- All tasksprefs
- PreferencestaskI
- The task related informationMethod Detail |
public static AppDeploymentController readArchive(java.lang.String ear, java.util.Hashtable preferences) throws AppDeploymentException
ear
- The application EAR file namepreferences
- The preferences table. The hashtable can have following
keys
AppConstants.APPDEPL_LOCALE | java.util.Locale |
public static AppDeploymentController readArchive(java.lang.String ear, java.util.Hashtable preferences, java.util.Vector taskI) throws AppDeploymentException
ear
- The application EAR file namepreferences
- The preferences tabletaskI
- Should always be nullpublic static java.util.Vector getDefaultTaskInfo(com.ibm.websphere.management.application.client.AppDeploymentInfo appInfo) throws AppDeploymentException
appInfo
- The AppDeploymentInfo instance that wraps the ear file
and the deployment optionspublic static java.util.Vector getDefaultTaskInfo(com.ibm.websphere.management.application.client.AppDeploymentInfo appInfo, java.util.Hashtable prefs) throws AppDeploymentException
appInfo
- The AppDeploymentInfo instance that wraps the ear file
and the deployment optionsprefs
- preferences where you can provide an entry to specify
the locale to create the AppDeploymentMessagesprotected static java.util.Vector createAppDeploymentTaskNames()
protected static java.util.Vector createAppDeploymentTaskHelpers(java.util.Vector tNames) throws AppDeploymentException
protected static java.util.Vector createAppDeploymentDependencyTaskHelpers()
protected void handlePreferences(java.util.Hashtable instPrefs) throws AppDeploymentException
protected void initializeEncoderDecoder() throws AppDeploymentException
protected void createAppDeploymentTasks() throws AppDeploymentException
protected static com.ibm.websphere.management.application.client.AppDeploymentTaskHelper getTaskHelper(java.lang.String taskName) throws AppDeploymentException
protected com.ibm.websphere.management.application.client.AppDeploymentTaskHelper getTaskHelper(int taskIndex) throws AppDeploymentException
public java.lang.String[] getAppDeploymentTaskNames()
public AppDeploymentTask getFirstTask() throws AppDeploymentException
protected AppDeploymentTask getNthTask(int i) throws AppDeploymentException
protected void prepareTask(int i, AppDeploymentTask task) throws AppDeploymentException
public AppDeploymentTask getNextTask() throws AppDeploymentException
public AppDeploymentTask getTaskByName(java.lang.String taskName, boolean b) throws AppDeploymentException
taskName
- The task nameb
- The boolean that specifies if the returned task becomes the
current task in the preparation phasepublic java.util.Vector getAllTasks()
public AppDeploymentTask getTaskByName(java.lang.String taskName) throws AppDeploymentException
taskName
- The task nameprotected void getDependencyTask(int i) throws AppDeploymentException
public void getDependencyTask(java.lang.String taskName) throws AppDeploymentException
taskName
- The task namepublic void close(boolean bSave, boolean bValidate, boolean bClose) throws AppDeploymentException
bSave
- Specifies if the task data should be savedbValidate
- Specifies if the task data should be validatedpublic void saveAndClose() throws AppDeploymentException
public java.lang.String[] validate() throws AppDeploymentException
public java.util.Hashtable getAppOptions()
public void setAppOptions(java.util.Hashtable tbl)
The
- app deployment optionspublic java.util.Hashtable getAppDeploymentSavedResults()
public com.ibm.websphere.management.application.client.AppDeploymentTaskInfo getTaskInfo()
public com.ibm.websphere.management.application.client.AppDeploymentTaskInfo getTaskInfo(java.lang.String taskName)
public boolean isPartialDeploymentInfo()
public java.lang.String getSecurityPolicyData() throws AppDeploymentException
public java.lang.String getSecurityPolicyWarning()
public void saveAsFile(java.lang.String moduleUri, java.lang.String fileUriInModule, java.io.InputStream inputStream) throws AppDeploymentException
moduleUri
- The name of the module file within the archivefileUriInModule
- The relative location and name of the file
to be saved as within the module fileinputStream
- The input stream to be saved
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |