Package com.sun.enterprise.deployment.backend

Examples of com.sun.enterprise.deployment.backend.DeploymentRequest


    public void runPhase(DeploymentPhaseContext phaseCtx)
    {
        DeploymentStatus status = phaseCtx.getDeploymentStatus();

        try {
            DeploymentRequest req = phaseCtx.getDeploymentRequest();
                                                                     
            prePhaseNotify(getPrePhaseEvent(req));
            doResourceOperation(req);
            postPhaseNotify(getPostPhaseEvent(req));
                                                                     
View Full Code Here


    /**
     *
     */
    public void prePhase(DeploymentPhaseContext phaseCtx)
    {
        DeploymentRequest req = phaseCtx.getDeploymentRequest();
        DeploymentStatus status = phaseCtx.getDeploymentStatus();
        DeploymentTarget target = (DeploymentTarget)req.getTarget();

        try {
            // retrieve and set virtual server value
            String virtualServers = (String)req.getOptionalAttributes().get(ServerTags.VIRTUAL_SERVERS);
            if (req.isRedeployInProgress()) {
                DeploymentContext.SavedApplicationRefInfo savedAppRefInfo =
                    deploymentCtx.getSavedAppRef(req.getName(),
                        target.getName());
                if (virtualServers == null && savedAppRefInfo.appRef().
                        getVirtualServers() != null) {
                    // if user does not specify virtual server in a redeployment
                    // preserve the value from last deployment
                    virtualServers = savedAppRefInfo.appRef().
                        getVirtualServers();

                    // also set it in request so subsequent retrieval
                    // will get the proper value
                    if (req.getOptionalAttributes() == null) {
                        Properties optionalAttributes = new Properties();
                        req.setOptionalAttributes(optionalAttributes);
                    }
                    req.getOptionalAttributes().put(ServerTags.VIRTUAL_SERVERS,
                        virtualServers);
                }
            }

            // check context root uniqueness
            String contextRootInConflict =
                ApplicationConfigHelper.checkContextRootUniqueness(
                    DeploymentServiceUtils.getConfigContext(), req.getName(),
                    req.getTarget().getName(), virtualServers);
            if (contextRootInConflict != null) {
                throw new IASDeploymentException(localStrings.getString(
                    "duplicate_context_root",
                    contextRootInConflict, req.getName(),
                    req.getTarget().getName()));
            }

            // only support directory deployment on DAS
            if (DeploymentServiceUtils.isDirectoryDeployed(req.getName(),
                req.getType())) {
                if (target != null && ServerHelper.isAServer(deploymentCtx.getConfigContext(), target.getTarget().getName()) && ServerHelper.isDAS(deploymentCtx.getConfigContext(), target.getTarget().getName())) {
                    return;
                } else {
                    throw new IASDeploymentException(localStrings.getString(
                        "dir_deploy_not_support"));
View Full Code Here

     * @param phaseCtx the DeploymentPhaseContext object    
     */
    public void runPhase(DeploymentPhaseContext phaseCtx)
    {
        try {
            DeploymentRequest req = phaseCtx.getDeploymentRequest();
            DeploymentTarget target = (DeploymentTarget)req.getTarget();
            if(target == null) {
                String msg = localStrings.getString("enterprise.deployment.phasing.association.targetnotspecified" );
                sLogger.log(Level.FINEST, msg);
                phaseCtx.getDeploymentStatus().setStageStatus(DeploymentStatus.WARNING);
                return;
            }
            prePhaseNotify(getPrePhaseEvent(req));
            String virtualServers = (String)req.getOptionalAttributes().get(ServerTags.VIRTUAL_SERVERS);

            /*
             *Add the app ref and send the event unless this is part of a
             *redeployment sequence and the attributes for the app ref did not change
             *as a result of the deployment, compared to their original values.
             */
            boolean needToAdd = true;
            DeploymentContext.SavedApplicationRefInfo savedAppRefInfo = null;
           
            if (req.isRedeployInProgress()) {
                /*
                 *Find the saved app ref info.
                 */
                savedAppRefInfo =
                        deploymentCtx.removeSavedAppRef(req.getName(), target.getName());
                if (savedAppRefInfo != null) {
                    needToAdd = savedAppRefInfo.isChanging();
                }
            }
            sLogger.fine("AssociationPhase for " + req.getName() + " on " + target.getName() +
                    "; isRedeployInProgress = " + req.isRedeployInProgress() +
                    ", savedAppRefInfo is " + (savedAppRefInfo != null ? savedAppRefInfo.toString() : "<null>" ) + "need to add = " + needToAdd);
            if (needToAdd) {
                sLogger.fine("AssociationPhase adding reference for " + req.getName() + " on " + target.getName());
                target.addAppReference(req.getName(), req.isStartOnDeploy(), virtualServers);
                /*
                 *See if there are saved non-default values for this app ref.
                 */
                if (savedAppRefInfo != null) {
                    /*
                     *Find the newly-created app ref. and assign the saved
                     *values.
                     */
                    ApplicationRef newAppRef = ApplicationReferenceHelper.findCurrentAppRef(
                            deploymentCtx,
                            target.getName(),
                            req.getName());
                    newAppRef.setLbEnabled(savedAppRefInfo.appRef().isLbEnabled());
                    newAppRef.setDisableTimeoutInMinutes(savedAppRefInfo.appRef().getDisableTimeoutInMinutes());
                }
                postPhaseNotify(getPostPhaseEvent(req));
            }
View Full Code Here

    public void runPhase(DeploymentPhaseContext phaseCtx)
    {
        DeploymentStatus status = phaseCtx.getDeploymentStatus();

        try {
            DeploymentRequest req = phaseCtx.getDeploymentRequest();
                                                                     
            prePhaseNotify(getPrePhaseEvent(req));
            doResourceOperation(req);
            postPhaseNotify(getPostPhaseEvent(req));
                                                                     
View Full Code Here

    public void runPhase(DeploymentPhaseContext phaseCtx) {
        DeploymentStatus status = phaseCtx.getDeploymentStatus();
       
        try {
            //get the app directory on target's cache deleted
            DeploymentRequest req = phaseCtx.getDeploymentRequest();
            DeploymentTarget target = (DeploymentTarget)req.getTarget();
           
            /*
             *Remove the app ref and send the event unless this is part of a
             *redeployment sequence of operations and the attributes for the app
             *ref will not change as a result of the deployment, compared to
             *their current values.
             */
            ApplicationRef ref = ApplicationReferenceHelper.findCurrentAppRef(
                    deploymentCtx, target.getName(), req.getName());
            boolean needToRemoveRef = true;
            DeploymentContext.SavedApplicationRefInfo info = null;
            if (req.isRedeployInProgress()) {
                /*
                 *Save a pointer to the existing app ref for use during the later
                 *disassociate phase.
                 */

                String virtualServers = null;
                Properties optionalAttrs = req.getOptionalAttributes();
                if (optionalAttrs != null) {
                    virtualServers = (String) optionalAttrs.get(ServerTags.VIRTUAL_SERVERS);
                }
                if (virtualServers == null && ref.getVirtualServers() != null) {
                    // if user does not specify virtual server in a redeployment
                    // preserve the value from last deployment
                    virtualServers = ref.getVirtualServers();

                    // also set it in request so subsequent retrieval
                    // will get the proper value
                    if (req.getOptionalAttributes() == null) {
                        Properties optionalAttributes = new Properties();
                        req.setOptionalAttributes(optionalAttributes);
                    }
                    req.getOptionalAttributes().put(ServerTags.VIRTUAL_SERVERS,
                        virtualServers);
                }

                info = deploymentCtx.saveAppRef(
                        req.getName(), target.getName(), ref, req);
                needToRemoveRef = info.isChanging();
            }
            sLogger.fine("DisassociationPhase for " + req.getName() + " on " + target.getName() +
                    "; isRedeployInProgress = " + req.isRedeployInProgress() +
                    ", savedAppRefInfo is " + (info != null ? info.toString() : "<null>" ) + "need to remove = " + needToRemoveRef);
            if (needToRemoveRef) {
                sLogger.fine("DisassociationPhase removing app ref for " + req.getName() + " on " + target.getName());
                target.removeAppReference(req.getName());
                sendDisassociateEvent(req);
            }
            status.setStageStatus(DeploymentStatus.SUCCESS);
        }catch(Throwable t){
            status.setStageStatus(DeploymentStatus.FAILURE);
View Full Code Here

    public boolean deploy(MonitorableEntry entry, File archive) {

        boolean status = false;

        try {
            DeploymentRequest req = deploy(archive);

            // load/reload deployed application/stand alone module

            // update the config context in server runtime
View Full Code Here

        } else if ( FileUtils.isRar(archive) ) {
            type = DeployableObjectType.CONN;
        }

        // constructs a deploy request with the given type
        DeploymentRequest req =
            new DeploymentRequest(env, type, DeploymentCommand.DEPLOY);

        // sets the archive that needs to be deployed
        req.setFileSource(archive);

        // application is registered with the name of the
        // archive without extension
        String fileName  = archive.getName();
        int dotIdx       = fileName.indexOf(fileName);
        String regName   = fileName.substring(0, dotIdx);
        req.setName(regName);

        // sets the web context root
        if (type.isWEB()) {
            req.setContextRoot(regName);
        }

        // redeploys the app if already deployed
        req.setForced(true);

        // does the actual deployment
        Deployer deployer = DeployerFactory.getDeployer(req);
        deployer.doRequest();
View Full Code Here

    public void runPhase(DeploymentPhaseContext phaseCtx)
    {
        DeploymentStatus status = phaseCtx.getDeploymentStatus();

        try {
            DeploymentRequest req = phaseCtx.getDeploymentRequest();
                                                                     
            prePhaseNotify(getPrePhaseEvent(req));
            doResourceOperation(req);
            postPhaseNotify(getPostPhaseEvent(req));
                                                                     
View Full Code Here

        boolean status = false;

        // redeploys the stand alone ejb module
        try {

            DeploymentRequest req = new DeploymentRequest(
                            this.configManager.getInstanceEnvironment(),
                            DeployableObjectType.EJB,
                            DeploymentCommand.DEPLOY);

            // monitored file points to $APP_ROOT/.reload
            req.setFileSource(entry.getMonitoredFile().getParentFile());

            // application registration name
            req.setName(moduleName);

            // we are always trying a redeployment
            req.setForced(true);

     AutoDirReDeployer deployer = new AutoDirReDeployer(req);
     status =  deployer.redeploy();

        } catch (IASDeploymentException de) {
View Full Code Here

        //String moduleName = entry.getId();
        String moduleName = entry.getDisplayName();
        boolean status = false;
       
        try {
            DeploymentRequest req = new DeploymentRequest(ienv, DeployableObjectType.WEB, DeploymentCommand.DEPLOY);
           
            // monitored file points to $APP_ROOT/.reload
            req.setFileSource(entry.getMonitoredFile().getParentFile());
           
            // application registration name
            req.setName(moduleName);
           
            // we are always trying a redeployment
            req.setForced(true);
                       
            AutoDirReDeployer deployer = new AutoDirReDeployer(req);
            status = deployer.redeploy();
           
        } catch (IASDeploymentException de) {
View Full Code Here

TOP

Related Classes of com.sun.enterprise.deployment.backend.DeploymentRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.