Contents |
iPlanet Process Manager, Version 6.5 Programmer's Guide |
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. 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"
- "IDeploymentManager Interface"
- "IDeploymentDescriptor Interface"
Note You can find all the necessary classes in the pm65classes.jar file in the api directory on the Process Manager 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.
- PRODUCTION stage -- only limited changes can be made 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.
MODE
The mode of the application can be either OPEN or CLOSED
- OPEN mode -- new process instances can be created.
- CLOSED mode -- no new process instances can be created but old process instances can continue through the system to completion.
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.
STATUS
The application STATUS can be either STARTED or STOPPED.
- STARTED status -- the application can be accessed from the Express UI.
- STOPPED status -- the application cannot be accessed through 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.
TESTING
The TESTING state can be either TRUE or FALSE.
- TRUE -- all work items are automatically assigned to the creator of the process instance.
- FALSE -- the work items are assigned to the real user.
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.
IDeploymentManager Interface
Use the IDeploymentManager interface to get access to the deployment descriptors for installed applications and to remove an application. 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.
All the classes are in the pm65classes.jar file. If you have installed the Process Manager Builder, you can find this jar file in the directory builder-root\support\sdk. You may also be able to find it on the CD.
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.
Given the deployment descriptor, you can call methods to find an application's stage, mode and status.
Code Example
The following code example illustrates how to get the deployment descriptor for an application named myApp.
// Get the cluster manager
IPMClusterManager myClusterManager = null;
try {
javax.naming.Context cxt = new javax.naming.InitialContext();
IPMClusterManagerHome clManagerHome = (IPMClusterManagerHome)
cxt.lookup(IPMClusterManager.JNDI_ROOT);
myClusterManager = clManagerHome.create();
}
catch( Exception e )
{
System.out.println("Cluster manager creation failed" + e);
}
// Get the default cluster
IPMCluster myCluster = myClusterManager.getCluster(
IPMCluster.DEFAULT);
// Get the deployment manager
IDeploymentManager myDepManager = myCluster.getDeploymentManager();
// Get a hastable of all installed apps
Hashtable appList = myDepManager.getInstalledApplications ( );
// Get the deployment descriptor for myapp
IDeploymentDescriptor myAppDD = appList.get ("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.
For more details, see the javadocs, which can be found in the support\sdk\docs directory of the Process Manager Builder installation.
Contents