Previous Contents Index DocHome Next |
Process Manager 6.0 Programmer's Guide |
Chapter 4 Deployment Manager
The deployment manager is responsible for installing and removing applications from the cluster. The deployment manager is also responsible for changing the deployment state of a deployed application by changing its deployment descriptor when applicable.Process Manager clients can access the deployment manager by calling the getDeploymentManager() method on the cluster bean which is described in Chapter 3 "Cluster Management." Given the deployment manager, you can access the deployment descriptor for individual applications. Given a deployment descriptor, you can change the application's stage, status, mode and testing state. For explanations of these states, see the section "Deployment States". (Note however that you cannot programmatically install applications, they must be deployed from the Process Builder.)
This chapter has the following sections:
Deployment States
Note: You can find all the necessary classes in the pm60classes.jar file in the api directory on the Process Manager 6.0 CD.
Deployment States
The deployment descriptor for a deployed applications specifies the following states for the application:
STAGE
The application can be either in DEVELOPMENT stage or in PRODUCTION stage.
DEVELOPMENT stage -- the application can be completely rewritten from the Process Builder.
The stage can be changed programmatically. In the interface, the change from DEVELOPMENT to PRODUCTION can only done from the Process Builder and NOT from the Administrator UI.PRODUCTION stage -- only limited changes can be made from the Process Builder.
Note: An application in the production stage can be in the testing state which means that even though the changes that can be made from the Process Builder are restrictive all the work items can still be assigned to the creator of the process instance. This kind of a scenario is useful when an application has been deployed to production but a final pass is being made to make sure that everything is working.
MODE
The mode of the application can be either OPEN or CLOSED
OPEN mode -- new process instances can be created.
The mode can be changed programmatically. In the interface, administrators can change the MODE from OPEN to CLOSED and back to OPEN from the Administrator UI.CLOSED mode -- no new process instances can be created but old process instances can continue through the system to completion.
STATUS
The application STATUS can be either STARTED or STOPPED.
STARTED status -- the application can be accessed from the Express UI.
The stage can be changed programmatically. In the interface, administrators can change the STATUS from STARTED to STOPPED and back to STARTED from the Administrator UI.STOPPED status -- the application cannot be accessed through the Express UI.
TESTING
The TESTING state can be either TRUE or FALSE.
TRUE -- all work items are automatically assigned to the creator of the process instance.
The stage can be changed programmatically. In the interface, administrators can change the TESTING from TRUE to FALSE and back to FALSE from the Administrator UI.Note: An application in the production stage can be in the testing state which means that even though the changes that can be made from the Process Builder are restrictive all the wartimes can still be assigned to the creator of the process instance. This kind of a scenario is useful when an application has been deployed to production but a final pass is being made to make sure that everything is working.
IDeploymentManager Interface
Use the IDeploymentManager interface to remove an application and to get access to the deployment descriptors for installed applications. Given the deployment descriptor for an application, you can change deployment details, such as changing its stage, status, mode, and testing state.To get the IDeploymentManager for a cluster, call the getDeploymentManager() method on the relevant IPMCluster object. For an example of accessing the deployment manager, see the code sample in the section "IDeploymentDescriptor Interface."
Where are the Classes and Interfaces?
The cluster manager and all classes related to the cluster are in the com.netscape.pm.model package.The deployment manager and deployment descriptor classes are in the com.netscape.pm.dm package.
Method Reference
The methods of the IDeploymentManager interface are:
removeApplication
removeApplication
Removes an application.
void removeApplication ( String appName, boolean bDropTable )
Description. This method removes an application. Whether or not the backend database table is removed depends on the bDropTable argument.
getInstalledApplications
Gets a hashtable of deployment descriptors for all installed applications.
Hashtable getInstalledApplications ( )
Description. This returns a hashtable of deployment descriptors of installed applications. The hashtable is indexed by the names of the applications. The hashtable is keyed by the application name.
Given a deployment descriptor, you can test the stage, mode, status and testing state of an application.
For a coded example, see the next section.
IDeploymentDescriptor Interface
Given the deployment manager, clients can call getInstalledApplications() to get a hashtable of deployment descriptors for all installed applications. The hashtable is keyed by application name. You can then get access the hashtable to retrieve the deployment descriptor for an individual application.
Code Example
The following code example illustrates how to get the deployment descriptor for an application named myApp.
Each application has a deployment descriptor that contains the current settings for the mode, stage, status and testing state of the application. Clients can access the deployment descriptor of a particular application to manipulate these individual parameters.
Where are the Classes and Interfaces?
The cluster manager and all classes related to the cluster are in the com.netscape.pm.model package.The deployment manager and deployment descriptor classes are in the com.netscape.pm.dm package.
Method Reference
The IDeploymentDescriptor Interface has the following methods that can be performed on the deployment descriptor of a particular application:
isApplicationOff
Tests if the application is off.
Description. Returns true if the application's status is OFF otherwise returns false.
isApplicationOn
Tests if the application is on.
Description. Returns true if the application's status is ON otherwise returns false.
isModeClosed
Tests if the application's mode is CLOSED.
Description. Returns true if the mode is CLOSED otherwise returns false.
isModeOpen
Tests if the application's mode is OPEN.
Description. Returns true if the mode is OPEN otherwise returns false.
isStageDevelopment
Tests if the application is in the development stage.
Description. Returns true if the application is in the DEVELOPMENT stage otherwise returns false.
isStageProduction
Tests if the application is in the production stage.
Description. Returns true if the application is in the PRODUCTION stage otherwise returns false.
isTesting
Tests if the application is in the testing state.
Description. Returns true if the application is in the TESTING state otherwise returns false.
save
Saves the deployment descriptor.
Description. Saves changes to the deployment descriptor. Clients must call this method after calling any methods that change the deployment descriptor.
setApplicationOff
Sets the application to stopped.
Description. sets the STATUS of the application to STOPPED which means the application cannot be accessed through the Express UI .
Clients must call the save() method after calling this method.
setApplicationOn
Sets the application to STARTED.
Description. sets the STATUS of the application to STARTED which means the application can be accessed from the Express UI.
Clients must call the save() method after calling this method.
setModeClosed
Sets the application mode to closed.
Description. Sets the MODE of the application to CLOSED. This means that no new process instances can be created but old process instances can continue through the system to completion.
Clients must call the save() method after calling this method.
setModeOpen
Sets the application mode to open.
Description. sets the MODE of the application to OPEN. This means that new process instances can be created.
Clients must call the save() method after calling this method.
void setTesting (boolean yesNo)
if true, the application is in testing mode, if false it is not.
Description. Sets TESTING to TRUE or FALSE depending on the parameter .
TRUE -- all work items are automatically assigned to the creator of the process instance.
Clients must call the save() method after calling this method.
Previous Contents Index DocHome Next
Copyright © 2000 Sun Microsystems, Inc. Some preexisting portions Copyright © 2000 Netscape Communications Corp. All rights reserved.
Last Updated May 02, 2000