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:

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.

  • 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.

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.

  • 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.

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

Removes an application.

Syntax.

   void removeApplication ( String appName, boolean bDropTable )

Parameters.

  • appName

is the name of the application that is to be removed from the cluster

  • bDropTable

indicates whether the backend database table is to be dropped or not. If this is TRUE, the database table is dropped. If it is FALSE, the database table is not dropped.

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.

Syntax.

   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.


// 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.


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.

Syntax.

   boolean isApplicationOff ()

Description. Returns true if the application's status is OFF otherwise returns false.


isApplicationOn

Tests if the application is on.

Syntax.

   boolean isApplicationOn ()

Description. Returns true if the application's status is ON otherwise returns false.


isModeClosed

Tests if the application's mode is CLOSED.

Syntax.

   boolean isModeClosed ()

Description. Returns true if the mode is CLOSED otherwise returns false.


isModeOpen

Tests if the application's mode is OPEN.

Syntax.

   boolean isModeOpen ()

Description. Returns true if the mode is OPEN otherwise returns false.


isStageDevelopment

Tests if the application is in the development stage.

Syntax.

   boolean isStageDevelopment ()

Description. Returns true if the application is in the DEVELOPMENT stage otherwise returns false.


isStageProduction

Tests if the application is in the production stage.

Syntax.

   boolean isStageProduction ()

Description. Returns true if the application is in the PRODUCTION stage otherwise returns false.


isTesting

Tests if the application is in the testing state.

Syntax.

   boolean isTesting ()

Description. Returns true if the application is in the TESTING state otherwise returns false.


save

Saves the deployment descriptor.

Syntax.

   void save ( )

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.

Syntax.

   void setApplicationOff()

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.

Syntax.

   void setApplicationOn ()

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.

Syntax.

   void setModeClosed()

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.

Syntax.

   void setModeOpen ()

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.


setTesting

Syntax.

   void setTesting (boolean yesNo)

Parameters.

  • 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.

  • FALSE -- the work items are assigned to the real user.

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