LongRunningActivity(Element content) { this.content = content; du = new DeploymentUnitDir(new File(extensionContext.getDUDir())); }
public Definition getDefinitionForService(QName serviceName) { return _du.getDefinitionForService(serviceName); }
public List<File> getFiles() { return _du.allFiles(); }
final DeploymentUnitDir du = new DeploymentUnitDir(deploymentUnitDirectory); du.setExtensionValidators(_extensionValidators); if( duName != null ) { du.setName(duName); if (autoincrementVersion || du.getStaticVersion() == -1) { version = du.getStaticVersion(); du.setVersion(version); du.compile(); } catch (CompilationException ce) { String errmsg = __msgs.msgDeployFailCompileErrors(ce); du.scan(); final DeployDocument dd = du.getDeploymentDescriptor(); final ArrayList<ProcessConfImpl> processes = new ArrayList<ProcessConfImpl>(); Collection<QName> deployed; if (_deploymentUnits.containsKey(du.getName())) { String errmsg = __msgs.msgDeployFailDuplicateDU(du.getName()); __log.error(errmsg); throw new ContextException(errmsg); String errmsg = __msgs.msgDeployFailDuplicatePID(processDD.getName(), du.getName()); __log.error(errmsg); throw new ContextException(errmsg);
final DeploymentUnitDir deploymentUnitDir = new DeploymentUnitDir(bpelPackage); deploymentUnitDir.setVersion(deploymentUnitDir.getStaticVersion()); deploymentUnitDir.compile(); } catch (CompilationException ce) { String logMessage = "Deployment failed due to compilation issues. " + ce.getMessage(); deploymentUnitDir.scan(); DeployDocument deployDocument = deploymentUnitDir.getDeploymentDescriptor(); List<ProcessConfigurationImpl> processConfs = new ArrayList<ProcessConfigurationImpl>(); List<QName> processIds = new ArrayList<QName>(); if (deploymentUnits.containsKey(deploymentUnitDir.getName())) { String logMessage = "Aborting deployment. Duplicate Deployment unit " + deploymentUnitDir.getName() + "."; log.error(logMessage); deploymentContext.setFailed(true); QName processId = Utils.toPid(processDD.getName(), deploymentUnitDir.getVersion()); deploymentUnits.put(deploymentUnitDir.getName(), deploymentUnitDir); processesInDeploymentUnit.put(deploymentUnitDir.getName(), processIds); for (ProcessConfigurationImpl processConf : processConfs) { processConfigMap.put(processConf.getProcessId(), processConf); parentProcessStore.onBPELPackageDeployment( tenantId, deploymentUnitDir.getName(),
DeploymentUnitDir dud = new DeploymentUnitDir(dudir); dud.setName(dudao.getName()); dud.scan(); _deploymentUnits.put(dud.getName(), dud); TDeployment.Process pinfo = dud.getProcessDeployInfo(p.getType()); if (pinfo == null) { __log.warn("Cannot load " + p.getPID() + "; cannot find descriptor."); Map<QName, Node> props = calcInitialProperties(dud.getProperties(), pinfo); dud.setVersion(version); } finally { _rw.writeLock().unlock();
DeploymentUnitDir du = new DeploymentUnitDir(bpelPackage); du.setVersion(du.getStaticVersion()); du.scan(); TDeployment.Process processDD = du.getProcessDeployInfo(pConfDAO.getType()); if (processDD == null) { log.warn("Cannot load " + pConfDAO.getPID() + "; cannot find descriptor."); deploymentUnits.put(du.getName(), du); processesInDeploymentUnit.put(du.getName(), processIds); parentProcessStore.onBPELPackageReload(tenantId, du.getName(), loaded);
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; serviceWSDL = du.getDefinitionForService(serviceName);
private Integer getTenantId(ExtensionContext context) { DeploymentUnitDir du = new DeploymentUnitDir(new File(context.getDUDir())); QName processIdQname = new QName(context.getProcessModel().getQName().getNamespaceURI(), context.getProcessModel().getQName().getLocalPart() + "-" + du.getStaticVersion()); return AnalyticsPublisherServiceComponent.getBPELServer(). getMultiTenantProcessStore().getTenantId(processIdQname); }
DeploymentUnitDir du = new DeploymentUnitDir(bpelDUDirectory); for (File file : du.allFiles()) { if (file.getAbsolutePath().endsWith(".cbp") && !file.delete()) { log.warn("Unable to delete " + file); du.compile();
public String getPackage() { return _du.getName(); }
du = _deploymentUnits.remove(duName); if (du != null) { undeployed = toPids(du.getProcessNames(), du.getVersion()); fireEvent(new ProcessStoreEvent(ProcessStoreEvent.Type.UNDEPLOYED, pn, du.getName())); __log.info(__msgs.msgProcessUndeployed(pn));
/** * Check whether processes in this package are already available in the process store or check * whether processes are correctly compiled. * * @param du BPEL deployment unit * @throws BPELDeploymentException if there's a error in BPEL package */ private void validateBPELPackage(DeploymentUnitDir du) throws BPELDeploymentException { DeployDocument dd = du.getDeploymentDescriptor(); for (TDeployment.Process processDD : dd.getDeploy().getProcessList()) { QName processId = Utils.toPid(processDD.getName(), du.getVersion()); if (processConfigMap.containsKey(processId)) { String logMessage = "Aborting deployment. Duplicate process ID " + processId + "."; log.error(logMessage); throw new BPELDeploymentException(logMessage); } QName processType = Utils.getProcessType(processDD); 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); throw new BPELDeploymentException(logMessage); } } }
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())) { String errMsg = "Service: " + provide.getService().getName() + " already " + "used by another process. Try again with a different " + "service name"; bpelDeploymentContext.setDeploymentFailureCause(errMsg); return false; } } } } return true; }
public String getBpelDocument() { CBPInfo cbpInfo = _du.getCBPInfo(getType()); if (cbpInfo == null) throw new ContextException("CBP record not found for type " + getType()); try { String relative = getRelativePath(_du.getDeployDir(), cbpInfo.cbp).replaceAll("\\\\", "/"); if (!relative.endsWith(".cbp")) throw new ContextException("CBP file must end with .cbp suffix: " + cbpInfo.cbp); relative = relative.replace(".cbp", ".bpel"); File bpelFile = new File(_du.getDeployDir(), relative); if (!bpelFile.exists()) __log.warn("BPEL file does not exist: " + bpelFile); return relative; } catch (IOException e) { throw new ContextException("IOException in getBpelRelativePath: " + cbpInfo.cbp, e); } }
private Map<String, Object> prepareCompileProperties(File bpelFile) { List<Process> plist = getDeploymentDescriptor().getDeploy().getProcessList(); for (Process process : plist) { if (process.getFileName() == null || "".equals(process.getFileName())) continue; if (bpelFile.getName().equals(process.getFileName())) { Map<QName, Node> props = ProcessStoreImpl.calcInitialProperties(_properties, process); Map<String, Object> result = new HashMap<String, Object>(); result.put(BpelC.PROCESS_CUSTOM_PROPERTIES, props); return result; } } return null; }
public boolean equals(Object obj) { if (!(obj instanceof DeploymentUnitDir)) { return false; } return ((DeploymentUnitDir) obj).getDeployDir().getAbsolutePath().equals(getDeployDir().getAbsolutePath()); }
public void scan() { HashMap<QName, CBPInfo> processes = new HashMap<QName, CBPInfo>(); List<File> cbps = FileUtils.directoryEntriesInPath(_duDirectory, DeploymentUnitDir._cbpFilter); for (File file : cbps) { CBPInfo cbpinfo = loadCBPInfo(file); processes.put(cbpinfo.processName, cbpinfo); } _processes = processes; HashMap<QName, Process> processInfo = new HashMap<QName, TDeployment.Process>(); for (TDeployment.Process p : getDeploymentDescriptor().getDeploy().getProcessList()) { processInfo.put(p.getName(), p); } _processInfo = processInfo; }
private void readPackageConfiguration() { File depDir = du.getDeployDir(); List<TDeployment.Process> processList = du.getDeploymentDescriptor().getDeploy(). getProcessList(); for (TDeployment.Process process : processList) {
public long getCBPFileSize() { CBPInfo cbpInfo = _du.getCBPInfo(getType()); if (cbpInfo == null) throw new ContextException("CBP record not found for type " + getType()); return cbpInfo.cbp.length(); }