Package com.sun.enterprise.deployment.backend

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


        } catch(Exception e) {
            if (e instanceof IASDeploymentException) {
                throw (IASDeploymentException)e;
            }
            else {
                throw new IASDeploymentException(e);
            }
        }
    }
View Full Code Here


    public DeploymentStatus deploy(File deployFile, File planFile,
        String archiveName, String moduleID, DeploymentProperties dProps,
        DeploymentCallback callback) throws IASDeploymentException {
        try {
            if (deployFile == null) {
                throw new IASDeploymentException(
                localStrings.getString("deployfile_not_specified"));
            }

            /*
             *Save the current time to use in preparing the audit info later so
             *the audit measurement includes all the logic below.
             */
            long startTime = System.currentTimeMillis();
            sLogger.log(Level.FINE, "mbean.begin_deploy", moduleID);
            DeployableObjectType type = null;
            if (dProps.getType() != null) {
                type = DeploymentServiceUtils.getDeployableObjectType(dProps.getType());
            } else {
                type = DeploymentServiceUtils.getTypeFromFile(
                            moduleID, deployFile.getAbsolutePath());
            }       

            InstanceEnvironment env =
                ApplicationServer.getServerContext().getInstanceEnvironment();
            DeploymentRequest req = new DeploymentRequest(
                                    env,
                                    type,
                                    DeploymentCommand.DEPLOY);
   
            DeploymentRequestRegistry.getRegistry().addDeploymentRequest(
                moduleID, req);

            req.setName(moduleID);
            boolean isRegistered = false;
            isRegistered = DeploymentServiceUtils.isRegistered(moduleID, type);
            // FIXME validation for new REDEPLOY property

            if (isRegistered) {
                DeploymentServiceUtils.validate(moduleID,type,REDEPLOY_ACTION, req);
            }

            req.setFileSource(deployFile);
            req.setDeploymentPlan(planFile);
            req.setForced(dProps.getForce());
            // Set the context Root for extension modules
            if(type.isWEB() || req.isExtensionModule()) {
                req.setDefaultContextRoot(dProps.getDefaultContextRoot(
                    archiveName));
                req.setContextRoot(dProps.getContextRoot());
            }
            req.setVerifying(dProps.getVerify());
            req.setPrecompileJSP(dProps.getPrecompileJSP());
            req.setGenerateRMIStubs(dProps.getGenerateRMIStubs());
            req.setAvailabilityEnabled(dProps.getAvailabilityEnabled());
            req.setStartOnDeploy(dProps.getEnable());
            req.setDescription(dProps.getDescription());
            req.setLibraries(dProps.getLibraries());
            req.setJavaWebStartEnabled(dProps.getJavaWebStartEnabled());
            req.setExternallyManagedPath(dProps.getExternallyManaged());
            req.setDeploymentCallback(callback);
            req.setIsRedeployInProgress(dProps.getRedeploy());
            DeploymentServiceUtils.setResourceOptionsInRequest(req, dProps);

            /*
             * The property option (name=value)[:name=value]* pair
             * is sent as String which is read here and converted to a Map.
             * The Map is sent in the request
             */
            Properties propOption= new Properties();
            Map<String, String> propMap = new HashMap();
            if(dProps != null)
            {
                for (Iterator itr = dProps.keySet().iterator(); itr.hasNext();) {
                    String propKey = (String) itr.next();
                    if(propKey.equals(PROPERTY)) {
                        String propValue = (String) dProps.get(propKey);
                        StringTokenizer tok = new StringTokenizer(propValue, ":");
                        while(tok.hasMoreElements()) {
                            StringTokenizer token = new StringTokenizer(tok.nextToken(), "=");
                               String key = token.nextToken();
                               String val = token.nextToken();
                               propMap.put(key, val);
                            
                        }
                    }
                }
            }
            propOption.put(PROPERTY, propMap);

            Properties optionalAttributes = new Properties();
            String virtualServers = dProps.getVirtualServers();
            if(virtualServers!=null) {
                optionalAttributes.put(ServerTags.VIRTUAL_SERVERS,
                    virtualServers);
            }
            req.setOptionalAttributes(optionalAttributes);

            req.addOptionalArguments(dProps.prune());
            req.addOptionalArguments(propOption);
            DeploymentServiceUtils.setHostAndPort(req);
            return deploy(req, createAuditInfoIfOn(req, AuditInfo.Operation.deploy, startTime));
        } catch(Exception e) {
            sLogger.log(Level.WARNING, "mbean.deploy_failed", e);
            if (e instanceof IASDeploymentException) {
                throw (IASDeploymentException)e;
            }
            else {
                throw new IASDeploymentException(e);
            }
        }
    }
View Full Code Here

            sLogger.log(Level.WARNING, msg);
            if (e instanceof IASDeploymentException) {
                throw (IASDeploymentException)e;
            }
            else {
                IASDeploymentException ias =
                    new IASDeploymentException(e.getLocalizedMessage());
                ias.initCause(e);
                throw ias;
            }
        }
    }
View Full Code Here

                config.flush();
            } else {
                // Server is initializing. Can not flush config changes.
            }
        } catch (ConfigException ce) {
            throw new IASDeploymentException(ce);
        }
  try {
      return DeploymentNotificationHelper.multicastEvent(eventType, entityName,
                                  moduleType, cascade, forceDeploy, loadUnloadAction, targetName);
  } catch (Throwable t) {
        IASDeploymentException iasEx = new IASDeploymentException(t.getMessage());
        iasEx.initCause(t);
        throw iasEx;
        }
        // unreachable
    }
View Full Code Here

            }
        } catch (Exception  e) {
            if (e instanceof IASDeploymentException) {
                throw (IASDeploymentException)e;
            } else {
                throw new IASDeploymentException(e);
            }
        }
    }
View Full Code Here

        try {
            ConfigBean module = getModule(appId, type);
            String location = module.getAttributeValue(ServerTags.LOCATION);
            return (new RelativePathResolver()).resolve(location);
        } catch (Exception e) {
            throw new IASDeploymentException(e);
        }
    }
View Full Code Here

        try {
            ConfigBean module = getModule(appId, type);
            String enabled = module.getAttributeValue(ServerTags.ENABLED);
            return Boolean.valueOf(enabled).booleanValue();
        } catch (Exception e) {
            throw new IASDeploymentException(e);
        }
    }
View Full Code Here

                }
            }

            return false;
        } catch (Exception e) {
            throw new IASDeploymentException(e);
        }
    }
View Full Code Here

            }
            ConfigBean module = getModule(appId, type);
            String objectType = module.getAttributeValue(ServerTags.OBJECT_TYPE);
            return objectType;
        } catch (Exception e) {
            throw new IASDeploymentException(e);
        }
    }
View Full Code Here

            if (contextRoot != null && contextRoot.length() > 0) {
                ConfigBean module = getModule(appId, type);
                module.setAttributeValue(ServerTags.CONTEXT_ROOT, contextRoot);
            }
        } catch (Exception e) {
            throw new IASDeploymentException(e);
        }
    }
View Full Code Here

TOP

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

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.