|
IBM WebSphere Application ServerTM Release 8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.websphere.management.application.client.AppDeploymentController
public class 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()); // One can also optionally put default binding generation options as follows. Properties props = new Properties(); tbl.put (AppConstants.APPDEPL_DFLTBNDG, props); // if not specified then default binding generation will not run // You can specify any of the following props.put (AppConstants.APPDEPL_DFLTLTBNDG_VHOST, "default_host"); props.put (AppConstants.APPDEPL_DFLTLTBNDG_DDSJNDI, "jdbc/MyDataSource"); props.put (AppConstants.APPDEPL_DFLTLTBNDG_DDSUSER, "username"); props.put (AppConstants.APPDEPL_DFLTLTBNDG_DDSPASS, "password"); props.put (AppConstants.APPDEPL_DFLTLTBNDG_EJBJNDIPREFIX, "ejb"); props.put (AppConstants.APPDEPL_DFLTLTBNDG_CFJNDI, "cf/MyFactory"); props.put (AppConstants.APPDEPL_DFLTLTBNDG_CFRESAUTH, "Container"); props.put (AppConstants.APPDEPL_DFLTLTBNDG_STRATEGY, "C:/mydir/strategy.xml"); props.put (AppConstants.APPDEPL_DFLTLTBNDG_FORCE, AppConstants.YES_KEY); 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 long |
_deploymentMode
|
protected AdminClient |
adminClient
|
protected java.util.List |
changedTaskProcessList
|
protected ConfigService |
configService
|
protected Session |
configSession
|
protected int |
currentTask
|
protected com.ibm.websphere.management.application.client.AppDeploymentInfo |
deploymentInfo
|
static int |
HIGHEST_CLIENT_MAJOR_VERSION
|
protected java.util.Hashtable |
preferences
|
protected java.util.ResourceBundle |
resBundle
|
protected java.util.Hashtable |
taskDataChangeListeners
|
static java.lang.String |
taskHelperSuffix
Deprecated. |
protected java.util.Vector<com.ibm.websphere.management.application.client.AppDeploymentTaskInfo> |
taskInfo
|
protected java.util.Vector<java.lang.String> |
taskNames
|
protected java.util.Vector<AppDeploymentTask> |
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 | |
---|---|
boolean |
checkIfEnhancedEar()
|
void |
checkIfSufficientlyDoneInTaskHelper(java.lang.String taskName)
|
void |
close(boolean bSave,
boolean bValidate,
boolean bClose)
Closes the archive and saves it optionally. |
void |
completeDefaultBindingTask(com.ibm.ws.management.application.client.DefaultBinding task)
Called by the client code to complete the DefaultBinding task. |
protected void |
createAppDeploymentTasks()
Create application deployment tasks. |
void |
createDeploymentPlan(java.io.OutputStream out)
|
AdminClient |
getAdminClient()
|
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. |
int |
getAppVersion()
|
int |
getAppVersion(boolean checkForFeature)
|
int |
getClientMajorVersion()
Returns the major version of the client code associated with this controller. |
ConfigService |
getConfigService()
|
Session |
getConfigSession()
|
com.ibm.ws.management.application.client.DataHolder |
getDataHolder()
|
com.ibm.ws.management.application.client.DefaultBinding |
getDefaultBindingTask(java.util.Hashtable prefs)
Called by the client code to return an instance of DefaultBinding task. |
protected void |
getDependencyTask(int i)
|
void |
getDependencyTask(java.lang.String taskName)
Executes the dependency resolver for the given task |
long |
getDeploymentMode()
|
org.eclipse.emf.ecore.resource.Resource |
getEnhancedEarDeploymentResource(java.lang.String resName)
|
AppDeploymentTask |
getFirstTask()
Returns the first Task object in the client side preparation process. |
java.lang.String[][] |
getModifiedTaskData(java.lang.String taskName,
java.lang.String[][] data)
|
AppDeploymentTask |
getNextTask()
Returns the next Task object in the client side preparation process. |
protected AppDeploymentTask |
getNthTask(int i)
|
int |
getRarVersion()
|
java.lang.String |
getSecurityPolicyData()
|
java.lang.String |
getSecurityPolicyWarning()
|
java.util.List |
getSelectedOptions()
|
java.util.Hashtable |
getServerTable()
|
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)
Returns task helper for task. |
protected com.ibm.websphere.management.application.client.AppDeploymentTaskHelper |
getTaskHelper(java.lang.String taskName)
Returns task helper for task. |
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 |
isClientModuleEnabled()
|
boolean |
isPartialDeploymentInfo()
Returns whether the archive for this AppDeploymentController is opened for editing/viewing. |
void |
postAllPrepareTask(com.ibm.websphere.management.application.client.AppDeploymentInfo appInstallInfo,
AppDeploymentTask task)
|
AppDeploymentTask |
preAllCompleteTask(AppDeploymentTask t)
|
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 |
readDeploymentPlan(java.io.File file)
|
void |
readDeploymentPlan(java.io.InputStream in)
|
void |
resetDataHolder()
|
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. |
protected void |
setDeploymentMode(java.util.Hashtable<java.lang.String,?> preferences)
|
void |
setVariableMap(java.util.Vector vtask)
|
java.lang.String[] |
validate()
Validates the task data. |
java.lang.String[] |
validateInTaskHelper(java.lang.String taskName)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
@Deprecated public static final java.lang.String taskHelperSuffix
public static final int HIGHEST_CLIENT_MAJOR_VERSION
protected java.util.Vector<com.ibm.websphere.management.application.client.AppDeploymentTaskInfo> taskInfo
protected java.util.Vector<java.lang.String> taskNames
protected java.util.Vector<AppDeploymentTask> tasks
protected int currentTask
protected java.util.Hashtable preferences
protected transient com.ibm.websphere.management.application.client.AppDeploymentInfo deploymentInfo
protected transient java.util.ResourceBundle resBundle
protected long _deploymentMode
protected ConfigService configService
protected Session configSession
protected AdminClient adminClient
protected java.util.Hashtable taskDataChangeListeners
protected java.util.List changedTaskProcessList
Constructor Detail |
---|
public AppDeploymentController(com.ibm.websphere.management.application.client.AppDeploymentInfo info, java.util.Hashtable prefs, java.util.Vector taskI) throws com.ibm.websphere.management.application.client.AppDeploymentException
info
- The application information objectprefs
- PreferencestaskI
- The task related information
com.ibm.websphere.management.application.client.AppDeploymentException
public AppDeploymentController(java.util.Vector tAll, java.util.Vector taskI, java.util.Hashtable prefs) throws com.ibm.websphere.management.application.client.AppDeploymentException
tAll
- All tasksprefs
- PreferencestaskI
- The task related information
com.ibm.websphere.management.application.client.AppDeploymentException
public AppDeploymentController(com.ibm.websphere.management.application.client.AppDeploymentInfo info, java.util.Vector tAll, java.util.Hashtable prefs, java.util.Vector taskI) throws com.ibm.websphere.management.application.client.AppDeploymentException
info
- The application information objecttAll
- All tasksprefs
- PreferencestaskI
- The task related information
com.ibm.websphere.management.application.client.AppDeploymentException
Method Detail |
---|
public static AppDeploymentController readArchive(java.lang.String ear, java.util.Hashtable preferences) throws com.ibm.websphere.management.application.client.AppDeploymentException
ear
- The application EAR file namepreferences
- The preferences table. The hashtable can have following
keys
AppConstants.APPDEPL_LOCALE | java.util.Locale |
com.ibm.websphere.management.application.client.AppDeploymentException
public static AppDeploymentController readArchive(java.lang.String ear, java.util.Hashtable preferences, java.util.Vector taskI) throws com.ibm.websphere.management.application.client.AppDeploymentException
ear
- The application EAR file namepreferences
- The preferences tabletaskI
- Should always be null
com.ibm.websphere.management.application.client.AppDeploymentException
protected void setDeploymentMode(java.util.Hashtable<java.lang.String,?> preferences) throws com.ibm.websphere.management.application.client.AppDeploymentException
com.ibm.websphere.management.application.client.AppDeploymentException
public long getDeploymentMode()
public int getClientMajorVersion()
protected void handlePreferences(java.util.Hashtable instPrefs) throws com.ibm.websphere.management.application.client.AppDeploymentException
com.ibm.websphere.management.application.client.AppDeploymentException
public com.ibm.ws.management.application.client.DefaultBinding getDefaultBindingTask(java.util.Hashtable prefs) throws com.ibm.websphere.management.application.client.AppDeploymentException
That is all client needs to do for default bindings.DefaultBinding task = appController.getDefaultBindingTask(optProps); // codes implemented by client to display the binding options // and inputs from user, or under the cover to set up the // values appController.completeDefaultBindingTask(task); AppDeploymentTask task = appController.getFirstTask(); ... ...
prefs
- perference table
com.ibm.websphere.management.application.client.AppDeploymentException
public void completeDefaultBindingTask(com.ibm.ws.management.application.client.DefaultBinding task) throws com.ibm.websphere.management.application.client.AppDeploymentException
getDefaultBindingTask(java.util.Hashtable)
for more information.
task
- an instance of DefaultBinding task
com.ibm.websphere.management.application.client.AppDeploymentException
protected void initializeEncoderDecoder() throws com.ibm.websphere.management.application.client.AppDeploymentException
com.ibm.websphere.management.application.client.AppDeploymentException
protected void createAppDeploymentTasks() throws com.ibm.websphere.management.application.client.AppDeploymentException
com.ibm.websphere.management.application.client.AppDeploymentException
protected com.ibm.websphere.management.application.client.AppDeploymentTaskHelper getTaskHelper(java.lang.String taskName) throws com.ibm.websphere.management.application.client.AppDeploymentException
taskName
-
com.ibm.websphere.management.application.client.AppDeploymentException
protected com.ibm.websphere.management.application.client.AppDeploymentTaskHelper getTaskHelper(int taskIndex) throws com.ibm.websphere.management.application.client.AppDeploymentException
taskIndex
-
com.ibm.websphere.management.application.client.AppDeploymentException
public java.lang.String[] getAppDeploymentTaskNames()
public AppDeploymentTask getFirstTask() throws com.ibm.websphere.management.application.client.AppDeploymentException
com.ibm.websphere.management.application.client.AppDeploymentException
protected AppDeploymentTask getNthTask(int i) throws com.ibm.websphere.management.application.client.AppDeploymentException
com.ibm.websphere.management.application.client.AppDeploymentException
protected void prepareTask(int i, AppDeploymentTask task) throws com.ibm.websphere.management.application.client.AppDeploymentException
com.ibm.websphere.management.application.client.AppDeploymentException
public AppDeploymentTask getNextTask() throws com.ibm.websphere.management.application.client.AppDeploymentException
com.ibm.websphere.management.application.client.AppDeploymentException
public AppDeploymentTask getTaskByName(java.lang.String taskName, boolean b) throws com.ibm.websphere.management.application.client.AppDeploymentException
taskName
- The task nameb
- The boolean that specifies if the returned task becomes the
current task in the preparation phase
com.ibm.websphere.management.application.client.AppDeploymentException
public java.util.Vector getAllTasks()
public AppDeploymentTask getTaskByName(java.lang.String taskName) throws com.ibm.websphere.management.application.client.AppDeploymentException
taskName
- The task name
com.ibm.websphere.management.application.client.AppDeploymentException
protected void getDependencyTask(int i) throws com.ibm.websphere.management.application.client.AppDeploymentException
com.ibm.websphere.management.application.client.AppDeploymentException
public void getDependencyTask(java.lang.String taskName) throws com.ibm.websphere.management.application.client.AppDeploymentException
taskName
- The task name
com.ibm.websphere.management.application.client.AppDeploymentException
public void close(boolean bSave, boolean bValidate, boolean bClose) throws com.ibm.websphere.management.application.client.AppDeploymentException
bSave
- Specifies if the task data should be savedbValidate
- Specifies if the task data should be validated
com.ibm.websphere.management.application.client.AppDeploymentException
public void saveAndClose() throws com.ibm.websphere.management.application.client.AppDeploymentException
com.ibm.websphere.management.application.client.AppDeploymentException
public java.lang.String[] validate() throws com.ibm.websphere.management.application.client.AppDeploymentException
com.ibm.websphere.management.application.client.AppDeploymentException
public java.lang.String[] validateInTaskHelper(java.lang.String taskName) throws com.ibm.websphere.management.application.client.AppDeploymentException
com.ibm.websphere.management.application.client.AppDeploymentException
public void checkIfSufficientlyDoneInTaskHelper(java.lang.String taskName) throws com.ibm.websphere.management.application.client.AppDeploymentException
com.ibm.websphere.management.application.client.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 com.ibm.websphere.management.application.client.AppDeploymentException
com.ibm.websphere.management.application.client.AppDeploymentException
public java.lang.String getSecurityPolicyWarning()
public void saveAsFile(java.lang.String moduleUri, java.lang.String fileUriInModule, java.io.InputStream inputStream) throws com.ibm.websphere.management.application.client.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
com.ibm.websphere.management.application.client.AppDeploymentException
public void createDeploymentPlan(java.io.OutputStream out) throws com.ibm.websphere.management.application.client.AppDeploymentException
com.ibm.websphere.management.application.client.AppDeploymentException
public void readDeploymentPlan(java.io.File file) throws com.ibm.websphere.management.application.client.AppDeploymentException
com.ibm.websphere.management.application.client.AppDeploymentException
public void readDeploymentPlan(java.io.InputStream in) throws com.ibm.websphere.management.application.client.AppDeploymentException
com.ibm.websphere.management.application.client.AppDeploymentException
public java.util.List getSelectedOptions()
public int getAppVersion()
public int getAppVersion(boolean checkForFeature)
public int getRarVersion() throws com.ibm.websphere.management.application.client.AppDeploymentException
com.ibm.websphere.management.application.client.AppDeploymentException
public java.util.Hashtable getServerTable() throws com.ibm.websphere.management.application.client.AppDeploymentException
com.ibm.websphere.management.application.client.AppDeploymentException
public AdminClient getAdminClient()
public Session getConfigSession()
public ConfigService getConfigService() throws java.lang.Exception
java.lang.Exception
public boolean checkIfEnhancedEar()
public org.eclipse.emf.ecore.resource.Resource getEnhancedEarDeploymentResource(java.lang.String resName)
public void postAllPrepareTask(com.ibm.websphere.management.application.client.AppDeploymentInfo appInstallInfo, AppDeploymentTask task)
public void setVariableMap(java.util.Vector vtask)
public AppDeploymentTask preAllCompleteTask(AppDeploymentTask t) throws com.ibm.websphere.management.application.client.AppDeploymentException
com.ibm.websphere.management.application.client.AppDeploymentException
public java.lang.String[][] getModifiedTaskData(java.lang.String taskName, java.lang.String[][] data)
public void resetDataHolder()
public com.ibm.ws.management.application.client.DataHolder getDataHolder()
public boolean isClientModuleEnabled()
|
IBM WebSphere Application ServerTM Release 8 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |