Examples of DeploymentUnitDir


Examples of org.apache.ode.store.DeploymentUnitDir

            activityType = InteractionType.TASK;
            log.warn(task.getLocalName() + " is not supported yet!");
            throw new RuntimeException(task.getLocalName() + " is not supported yet!");
        }

        du = new DeploymentUnitDir(new File(extensionContext.getDUDir()));
    }
View Full Code Here

Examples of org.apache.ode.store.DeploymentUnitDir

        }
    }

    private void undeploySpecificVersionOfBPELPackage(final String packageName,
                                                      final Collection<QName> undeployedProcesses) {
        DeploymentUnitDir du = deploymentUnits.remove(packageName);
        processesInDeploymentUnit.remove(packageName);
        if (du != null) {
            long version = du.getVersion();
            for (QName name : du.getProcessNames()) {
                QName pid = Utils.toPid(name, version);
                undeployedProcesses.add(pid);
                processes.remove(pid);
            }
        }
View Full Code Here

Examples of org.apache.ode.store.DeploymentUnitDir

        log.info("Starting deployment of processes from directory "
                + bpelPackage.getAbsolutePath());

        final Date deployDate = new Date();
        // Create the DU and compile/scan it before doing any other work.
        final DeploymentUnitDir du = new DeploymentUnitDir(bpelPackage);
        // Before coming to this stage, we create the bpel package directory with the static version
        // so we don't need to get the version from database. We can directly use static version
        // calculated from bpel package directory name.
        du.setVersion(du.getStaticVersion());

        try {
            du.compile();
        } catch (CompilationException ce) {
            String logMessage = "Deployment failed due to compilation issues.";
            log.error(logMessage, ce);
            throw new BPELDeploymentException(logMessage, ce);
        }

        du.scan();
        DeployDocument dd = du.getDeploymentDescriptor();
        List<ProcessConfigurationImpl> processConfs = new ArrayList<ProcessConfigurationImpl>();
        List<QName> processIds = new ArrayList<QName>();

        if (deploymentUnits.containsKey(du.getName())) {
            String logMessage = "Aborting deployment. Duplicate Deployment unit "
                    + du.getName() + ".";
            log.error(logMessage);
            throw new BPELDeploymentException(logMessage);
        }

        // Validate BPEL package partially before retiring old versions.
        validateBPELPackage(du);

        // Before updating a BPEL package we need to retire processes in old version
        retirePreviousPackageVersions(du);

        for (TDeployment.Process processDD : dd.getDeploy().getProcessList()) {
            QName processId = Utils.toPid(processDD.getName(), du.getVersion());

            processConfs.add(new ProcessConfigurationImpl(
                    tenantId,
                    processDD,
                    du,
                    deployDate,
                    parentProcessStore.getEndpointReferenceContext(),
                    tenantConfigContext));
            processIds.add(processId);
        }

        deploymentUnits.put(du.getName(), du);
        processesInDeploymentUnit.put(du.getName(), processIds);
        for (ProcessConfigurationImpl processConf : processConfs) {
            processes.put(processConf.getProcessId(), processConf);
            deploymentContext.addProcessId(processConf.getProcessId());
        }
        try {
            parentProcessStore.onBPELPackageDeployment(
                 tenantId,
                 du.getName(),
                 BPELPackageRepositoryUtils.getResourcePathForBPELPackageContent(deploymentContext),
                 processConfs);
        } catch (ContextException ce) {
            handleDeploymentErrorsAtODELayer(deploymentContext, du.getName());
            deploymentContext.setDeploymentFailureCause("BPEL Package deployment failed at " +
                    "ODE layer. Possible cause: " + ce.getMessage());
            deploymentContext.setStackTrace(ce);
            try {
                handleDeploymentError(deploymentContext);
View Full Code Here

Examples of org.apache.ode.store.DeploymentUnitDir

        if (bpelPackage == null || !bpelPackage.exists()) {
            throw new BPELDeploymentException("Deployed directory " +
                    (bpelPackage == null ? "(unknown)" : bpelPackage) + " no longer there!");
        }

        DeploymentUnitDir du = new DeploymentUnitDir(bpelPackage);
        du.setVersion(du.getStaticVersion());
        du.scan();

        List<ProcessConfigurationImpl> loaded = new ArrayList<ProcessConfigurationImpl>();
        List<QName> processIds = new ArrayList<QName>();

        for (ProcessConfDAO pConfDAO : duDAO.getProcesses()) {
            TDeployment.Process processDD = du.getProcessDeployInfo(pConfDAO.getType());
            if (processDD == null) {
                log.warn("Cannot load " + pConfDAO.getPID() + "; cannot find descriptor.");
                continue;
            }

            // TODO: update the props based on the values in the DB.

            ProcessConfigurationImpl pConf = new ProcessConfigurationImpl(
                    tenantId,
                    processDD,
                    du,
                    duDAO.getDeployDate(),
                    parentProcessStore.getEndpointReferenceContext(),
                    tenantConfigContext);
            pConf.setState(pConfDAO.getState());
            processIds.add(pConfDAO.getPID());
            processes.put(pConf.getProcessId(), pConf);
            loaded.add(pConf);
        }

        deploymentUnits.put(du.getName(), du);
        processesInDeploymentUnit.put(du.getName(), processIds);
        parentProcessStore.onBPELPackageReload(tenantId, du.getName(), loaded);
    }
View Full Code Here

Examples of org.apache.ode.store.DeploymentUnitDir

        }
    }

    private boolean validateBPELPackage(BPELDeploymentContext bpelDeploymentContext,
                                        boolean isExistingPackage) {
        DeploymentUnitDir du;
        try {
            du = new DeploymentUnitDir(bpelDeploymentContext.getBPELPackageContent());
        } catch (IllegalArgumentException e) {
            bpelDeploymentContext.setDeploymentFailureCause(e.getMessage());
            bpelDeploymentContext.setStackTrace(e);
            return false;
        }

        if (!isExistingPackage) {
            DeployDocument deployDocument = du.getDeploymentDescriptor();
            List<TDeployment.Process> processList = deployDocument.getDeploy().getProcessList();
            for (TDeployment.Process process : processList) {
                List<TProvide> provideList = process.getProvideList();
                for (TProvide provide : provideList) {
                    if (getDeployedServices().containsKey(provide.getService().getName())) {
View Full Code Here

Examples of org.apache.ode.store.DeploymentUnitDir

        private String callbackServicePort;
        private String serviceURI;

        LongRunningActivity (Element content) {
            this.content = content;
            du = new DeploymentUnitDir(new File(extensionContext.getDUDir()));
        }
View Full Code Here

Examples of org.apache.ode.store.DeploymentUnitDir

            return content.getAttribute("responseOperation");
        }

        public String getServiceEPR () throws FaultException {
            if (du == null) {
                du = new DeploymentUnitDir(new File(extensionContext.getDUDir()));
            }
            DeployDocument deployDocument = du.getDeploymentDescriptor();
            OProcess processModel = extensionContext.getProcessModel();
            TDeployment.Process myProcess = null;
            List<TDeployment.Process> processList = deployDocument.getDeploy().getProcessList();
View Full Code Here

Examples of org.apache.ode.store.DeploymentUnitDir

        return false;
    }

    public void validateBPELPackage(String directoryPath) throws Exception {
        DeploymentUnitDir du;
        try {
            du = new DeploymentUnitDir(new File(directoryPath));
        } catch (IllegalArgumentException iae) {
            log.error("BPEL Package Validation Failure.", iae);
            throw new Exception("BPEL Package Validation Failure.");
        }

        //check package for illegal charactors which registry does not support. (~!@#$;%^*()+={}[]|\<>)
        List<File> packageFiles = du.allFiles();
        for (File packageFile : packageFiles) {
            if (!packageFile.getName().matches("[^\\~\\!\\@\\#\\$\\;\\%\\^\\*\\(\\)\\+ /\\=\\{\\}\\[\\]\\\\|\\<\\>\"\\'\\`]+")) {
                  log.error("BPEL Package Validation Failure: one or many of the following illegal characters are in " +
                          "the package.\n ~!@#$;%^*()+={}[]| \\<>\"'`");
                  throw new Exception("BPEL Package Validation Failure: one or many of the following illegal characters " +
                          "are in the package. ~!@#$;%^*()+={}[]| \\<>\"'`");
            }
        }

        try {
            du.compile();
        } catch (RuntimeException ce) {
            log.error("BPEL Process Compilation Failure.", ce);
            throw new Exception("BPEL Compilation Failure!");
        } catch (Exception e) {
            log.error("BPEL Process Compilation Failure.", e);
            throw new Exception("BPEL Compilation Failure!");
        }

        du.scan();
        DeployDocument dd = du.getDeploymentDescriptor();
        for(TDeployment.Process processDD : dd.getDeploy().getProcessList()){
            QName processType = processDD.getType() != null ? processDD.getType() : processDD.getName();

            DeploymentUnitDir.CBPInfo cbpInfo = du.getCBPInfo(processType);
            if (cbpInfo == null) {
                //removeDeploymentArtifacts(deploymentContext, du);
                String logMessage = "Aborting deployment. Cannot find Process definition for type "
                        + processType + ".";
                log.error(logMessage);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.