Search in sources :

Example 1 with DFDeploymentProperties

use of org.glassfish.deployment.client.DFDeploymentProperties in project Payara by payara.

the class SunDeploymentManager method getRedeployOptions.

/**
 *Return deployment options for the DeploymentFacility preset for the needs of redeployment.
 *These properties will be merged with and will override the options set for normal deployment.
 *@return Properties with the conventional preset properties for redeployment
 */
private DFDeploymentProperties getRedeployOptions(String moduleID) {
    DFDeploymentProperties deplProps = new DFDeploymentProperties();
    deplProps.setForce(true);
    deplProps.setName(moduleID);
    deplProps.setRedeploy(true);
    return deplProps;
}
Also used : DFDeploymentProperties(org.glassfish.deployment.client.DFDeploymentProperties)

Example 2 with DFDeploymentProperties

use of org.glassfish.deployment.client.DFDeploymentProperties in project Payara by payara.

the class SunDeploymentManager method redeploy.

/**
 * (optional)
 * The redeploy method provides a means for updating currently
 * deployed J2EE applications.  This is an optional method for
 * vendor implementation.
 *
 * Redeploy replaces a currently deployed application with an
 * updated version.  The runtime configuration information for
 * the updated application must remain identical to the application
 * it is updating.
 *
 * When an application update is redeployed, all existing client
 * connections to the original running application must not be disrupted;
 * new clients will connect to the application update.
 *
 * This operation is valid for TargetModuleIDs that represent a
 * root module. A root TargetModuleID has no parent. A root
 * TargetModuleID module and all its child modules will be redeployed.
 * A child TargetModuleID module cannot be individually redeployed.
 * The redeploy operation is complete only when this action for
 * all the modules has completed.
 *
 * @param moduleIDList An array of designators of the applications
 *                      to be updated.
 * @param moduleArchive The input stream containing the application
 *                      archive to be disrtibuted.
 * @param deploymentPlan The input stream containing the runtime
 *                       configuration information associated with
 *                       this application archive.
 * @return ProgressObject an object that tracks and reports the
 *                       status of the redeploy operation.
 * @throws IllegalStateException is thrown when the method is
 *                    called when running in disconnected mode.
 * @throws UnsupportedOperationException this optional command
 *         is not supported by this implementation.
 */
public ProgressObject redeploy(TargetModuleID[] moduleIDList, InputStream moduleArchive, InputStream deploymentPlan) throws UnsupportedOperationException, IllegalStateException {
    try {
        /*
             *To support multiple different modules in the module ID list, use a TargetModuleIDCollection to
             *organize them and work on each module one at a time.  
             */
        TargetModuleIDCollection coll = new TargetModuleIDCollection(moduleIDList);
        for (Iterator it = coll.iterator(); it.hasNext(); ) {
            /*
                 *The iterator returns one work instance for each module present in the collection.
                 */
            DeploymentFacilityModuleWork work = (DeploymentFacilityModuleWork) it.next();
            /*
                 *Set the name in the properties according to the moduleID.  The module is the same for all the 
                 *targets represented by this single work object.
                 */
            DFDeploymentProperties dProps = getRedeployOptions(work.getModuleID());
            // type is not needed for v3 server code now
            // dProps.setType(deploymentFacility.getModuleType(work.getModuleID()));
            ProgressObject po = deploy(work.targets(), moduleArchive, deploymentPlan, dProps);
            /*
                 *The work instance needs to know about its own progress object, and the
                 *aggregate progress object needs to also.
                 */
            work.setProgressObject(po);
            coll.getProgressObjectSink().sinkProgressObject(po);
        }
        return coll.getProgressObjectSink();
    } catch (Throwable e) {
        return prepareErrorProgressObject(CommandType.REDEPLOY, e);
    }
}
Also used : Iterator(java.util.Iterator) ProgressObject(javax.enterprise.deploy.spi.status.ProgressObject) DFDeploymentProperties(org.glassfish.deployment.client.DFDeploymentProperties)

Example 3 with DFDeploymentProperties

use of org.glassfish.deployment.client.DFDeploymentProperties in project Payara by payara.

the class SunDeploymentManager method getProperties.

protected Properties getProperties() {
    // we don't set name from client side and will let server side
    // determine it
    DFDeploymentProperties dProps = new DFDeploymentProperties();
    dProps.setEnabled(false);
    return (Properties) dProps;
}
Also used : DFDeploymentProperties(org.glassfish.deployment.client.DFDeploymentProperties) Properties(java.util.Properties) DFDeploymentProperties(org.glassfish.deployment.client.DFDeploymentProperties)

Example 4 with DFDeploymentProperties

use of org.glassfish.deployment.client.DFDeploymentProperties in project Payara by payara.

the class SunDeploymentManager method distribute.

/**
 * The distribute method performs three tasks; it validates the
 * deployment configuration data, generates all container specific
 * classes and interfaces, and moves the fully baked archive to
 * the designated deployment targets.
 *
 * @param targetList   A list of server targets the user is specifying
 *                     this application be deployed to.
 * @param moduleType   The module type of this application archive.
 * @param moduleArchive The input stream containing the application
 *                      archive to be disrtibuted.
 * @param deploymentPlan The input stream containing the deployment
 *                       configuration information associated with
 *                       this application archive.
 * @throws IllegalStateException is thrown when the method is
 *                    called when running in disconnected mode.
 * @return ProgressObject an object that tracks and reports the
 *                       status of the distribution process.
 */
public ProgressObject distribute(Target[] targetList, ModuleType type, InputStream moduleArchive, InputStream deploymentPlan) throws IllegalStateException {
    DFDeploymentProperties dProps = new DFDeploymentProperties();
    dProps.setProperty("type", getTypeFromModuleType(type));
    return deploy(targetList, moduleArchive, deploymentPlan, (Properties) dProps);
}
Also used : DFDeploymentProperties(org.glassfish.deployment.client.DFDeploymentProperties)

Aggregations

DFDeploymentProperties (org.glassfish.deployment.client.DFDeploymentProperties)4 Iterator (java.util.Iterator)1 Properties (java.util.Properties)1 ProgressObject (javax.enterprise.deploy.spi.status.ProgressObject)1