org.netbeans.modules.j2ee.deployment.plugins.api
Class IncrementalDeployment

java.lang.Object
  extended by org.netbeans.modules.j2ee.deployment.plugins.api.IncrementalDeployment

public abstract class IncrementalDeployment
extends Object

This interface replaces DeploymentManager calls deploy and redeploy during directory-based deployment. The calling sequence is as following:

Initially, j2eeserver will call getDirectoryForNewApplication() to request destination directory to deliver the being deployed application or stand-alone module. In case of J2EE applications, getDirectoryForNewModule() will be called for each child module.

After done with copying of files over to the destination, initialDeploy() will be called to signal the copying is done. Processing of the returned ProgressObject is the same as in DeploymentManager.distribute() call.

Subsequent deployments are incremental. For each root and child module the IDE will ask plugin for destination directory by calling getDirectoryForModule(). After delivering the changed files for all modules, the IDE then call incrementalDeploy with the description of what have changed since previous deployment.

For in-place file deployment, where the file copying step is skipped, method getDirectoryForNewApplication or getDirectoryForNewModule calls return null.

J2eeserver optain an instance of IncrementalDeployment from server integration plugin by calling OptionalDeploymentManagerFactory to optain an instance of IncrementalDeployment for each DeploymentManager instance.


Constructor Summary
IncrementalDeployment()
           
 
Method Summary
abstract  boolean canFileDeploy(javax.enterprise.deploy.spi.Target target, javax.enterprise.deploy.model.DeployableObject deployable)
          Whether the deployable object could be file deployed to the specified target
abstract  File getDirectoryForModule(javax.enterprise.deploy.spi.TargetModuleID module)
          Return absolute path to which the IDE will write the content changes of specified module.
 File getDirectoryForNewApplication(String deploymentName, javax.enterprise.deploy.spi.Target target, javax.enterprise.deploy.spi.DeploymentConfiguration configuration)
          Return absolute path the IDE will write the app or stand-alone module content to.
abstract  File getDirectoryForNewApplication(javax.enterprise.deploy.spi.Target target, javax.enterprise.deploy.model.DeployableObject app, javax.enterprise.deploy.spi.DeploymentConfiguration configuration)
          Return absolute path which the IDE will write the specified app or stand-alone module content to.
abstract  File getDirectoryForNewModule(File appDir, String uri, javax.enterprise.deploy.model.DeployableObject module, javax.enterprise.deploy.spi.DeploymentConfiguration configuration)
          Return absolute path to which the IDE will write the specified module content.
 String getModuleUrl(javax.enterprise.deploy.spi.TargetModuleID module)
          Get the URI pointing to location of child module inside a application archive.
abstract  javax.enterprise.deploy.spi.status.ProgressObject incrementalDeploy(javax.enterprise.deploy.spi.TargetModuleID module, AppChangeDescriptor changes)
          Before this method is called, the on-disk representation of TargetModuleID is updated.
abstract  javax.enterprise.deploy.spi.status.ProgressObject initialDeploy(javax.enterprise.deploy.spi.Target target, javax.enterprise.deploy.model.DeployableObject app, javax.enterprise.deploy.spi.DeploymentConfiguration configuration, File dir)
          First time deployment file distribution.
 void notifyDeployment(javax.enterprise.deploy.spi.TargetModuleID module)
          Inform the plugin that the specified module is being deployed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IncrementalDeployment

public IncrementalDeployment()
Method Detail

initialDeploy

public abstract javax.enterprise.deploy.spi.status.ProgressObject initialDeploy(javax.enterprise.deploy.spi.Target target,
                                                                                javax.enterprise.deploy.model.DeployableObject app,
                                                                                javax.enterprise.deploy.spi.DeploymentConfiguration configuration,
                                                                                File dir)
First time deployment file distribution. Before this method is called the module content files should be ready in the destination location.

Parameters:
target - target of deployment
app - the app to deploy
configuration - server specific data for deployment
dir - the destination directory for the given deploy app
Returns:
the object for feedback on progress of deployment

incrementalDeploy

public abstract javax.enterprise.deploy.spi.status.ProgressObject incrementalDeploy(javax.enterprise.deploy.spi.TargetModuleID module,
                                                                                    AppChangeDescriptor changes)
Before this method is called, the on-disk representation of TargetModuleID is updated.

Parameters:
module - the TargetModuleID of the deployed application or stand-alone module.
changes - AppChangeDescriptor describing what in the application changed.
Returns:
the ProgressObject providing feedback on deployment progress.

canFileDeploy

public abstract boolean canFileDeploy(javax.enterprise.deploy.spi.Target target,
                                      javax.enterprise.deploy.model.DeployableObject deployable)
Whether the deployable object could be file deployed to the specified target

Parameters:
target - target in question
deployable - the deployable object in question
Returns:
true if it is possible to do file deployment

getDirectoryForNewApplication

public abstract File getDirectoryForNewApplication(javax.enterprise.deploy.spi.Target target,
                                                   javax.enterprise.deploy.model.DeployableObject app,
                                                   javax.enterprise.deploy.spi.DeploymentConfiguration configuration)
Return absolute path which the IDE will write the specified app or stand-alone module content to.

Parameters:
target - target server of the deployment
app - the app or stand-alone module to deploy
configuration - server specific data for deployment
Returns:
absolute path root directory for the specified app or null if server can accept the deployment from an arbitrary directory.

getDirectoryForNewApplication

public File getDirectoryForNewApplication(String deploymentName,
                                          javax.enterprise.deploy.spi.Target target,
                                          javax.enterprise.deploy.spi.DeploymentConfiguration configuration)
Return absolute path the IDE will write the app or stand-alone module content to. Note: to use deployment name, implementation nees to override this.

Parameters:
deploymentName - name to use in deployment
target - target server of the deployment
configuration - server specific data for deployment
Returns:
absolute path root directory for the specified app or null if server can accept the deployment from an arbitrary directory.

getDirectoryForNewModule

public abstract File getDirectoryForNewModule(File appDir,
                                              String uri,
                                              javax.enterprise.deploy.model.DeployableObject module,
                                              javax.enterprise.deploy.spi.DeploymentConfiguration configuration)
Return absolute path to which the IDE will write the specified module content.

Parameters:
appDir - the root directory of containing application
uri - the URI of child module within the app
module - the child module object to deploy
configuration - server specific data for deployment
Returns:
absolute path root directory for the specified module.

getDirectoryForModule

public abstract File getDirectoryForModule(javax.enterprise.deploy.spi.TargetModuleID module)
Return absolute path to which the IDE will write the content changes of specified module.

Parameters:
module - id for the target module.
Returns:
absolute path root directory for the specified module.

getModuleUrl

public String getModuleUrl(javax.enterprise.deploy.spi.TargetModuleID module)
Get the URI pointing to location of child module inside a application archive.

Parameters:
module - TargetModuleID of the child module
Returns:
its relative path within application archive, returns null by default (for standalone module)

notifyDeployment

public void notifyDeployment(javax.enterprise.deploy.spi.TargetModuleID module)
Inform the plugin that the specified module is being deployed. Notification is sent even if there is really nothing needed to be deployed.

Parameters:
module - module which is being deployed.

 

Built on March 27 2006.  |  Portions Copyright 1997-2005 Sun Microsystems, Inc. All rights reserved.