while (processesIter.hasNext()) { ProcessConfImpl other_pconf = processesIter.next(); QName other_pid = other_pconf.getProcessId(); __log.debug("other pid " + other_pid + " vs this pid " + pid); if (ProcessState.ACTIVE.equals(other_pconf.getState()) && pconf.getType().equals(other_pconf.getType()) && !pid.equals(other_pid)) setState(other_pconf.getProcessId(),ProcessState.RETIRED); final DeploymentUnitDir dudir = pconf.getDeploymentUnit(); pconf.setState(state); fireStateChange(pid, state, pconf.getDeploymentUnit().getName());
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); } }
for (ProcessConfImpl p : loaded) { try { fireStateChange(p.getProcessId(), p.getState(), p.getDeploymentUnit().getName()); } catch (Exception except) { __log.error("Error while activating process: pid=" + p.getProcessId() + " package="+p.getDeploymentUnit().getName(), except);
ProcessConfDAO newDao = dudao.createProcess(pc.getProcessId(), pc.getType(), pc.getVersion()); newDao.setState(pc.getState()); for (Map.Entry<QName, Node> prop : pc.getProcessProperties().entrySet()) { newDao.setProperty(prop.getKey(), DOMUtils.domToString(prop.getValue())); deployed.add(pc.getProcessId()); conn.setVersion(pc.getVersion()); } catch (Throwable e) { String errmsg = "Error persisting deployment record for " + pc.getProcessId() + "; process will not be available after restart!"; __log.error(errmsg, e);
ProcessConfImpl(QName pid, QName type, long version, DeploymentUnitDir du, TDeployment.Process pinfo, Date deployDate, Map<QName, Node> props, Cache<String, String> states, EndpointReferenceContext eprContext, File configDir, boolean generateProcessEventsAll) { _pid = pid; _version = version; _du = du; _pinfo = pinfo; _deployDate = deployDate; _configDir = configDir; _props = Collections.unmodifiableMap(props); _statesCache = states; _type = type; _inMemory = _pinfo.isSetInMemory() && _pinfo.getInMemory(); this.generateProcessEventsAll = generateProcessEventsAll; this.eprContext = eprContext; propertiesWatchDog = new WatchDog<Map<File, Long>, PropertiesObserver>(new PropertiesMutable(), new PropertiesObserver()); initLinks(); initMexInterceptors(); initEventList(); processCleanupConfImpl = new ProcessCleanupConfImpl(pinfo); initSchedules(); }
ProcessConfImpl pconf = new ProcessConfImpl(pid, processDD.getName(), version, du, processDD, deployDate, calcInitialProperties(du.getProperties(), processDD), _processStates, _eprContext, _configDir, generateProcessEventsAll); processes.add(pconf); __log.info(__msgs.msgProcessDeployed(du.getDeployDir(), process.getProcessId())); _processes.put(process.getProcessId(), process); fireEvent(new ProcessStoreEvent(ProcessStoreEvent.Type.DEPLOYED, process.getProcessId(), process.getDeploymentUnit() .getName())); fireStateChange(process.getProcessId(), process.getState(), process.getDeploymentUnit().getName());
ProcessConfImpl pconf = new ProcessConfImpl(p.getPID(), p.getType(), p.getVersion(), dud, pinfo, dudao .getDeployDate(), props, p.getState(), eprContext, _configDir, generateProcessEventsAll); version = p.getVersion(); _processes.put(pconf.getProcessId(), pconf); loaded.add(pconf);
final DeploymentUnitDir dudir = pconf.getDeploymentUnit(); pconf.setState(state); if (old != null && old != state) fireStateChange(pid, state, pconf.getDeploymentUnit().getName());
public void setProperty(final QName pid, final QName propName, final String value) { if (__log.isDebugEnabled()) __log.debug("Setting property " + propName + " on process " + pid); ProcessConfImpl pconf = _processes.get(pid); if (pconf == null) { String msg = __msgs.msgProcessNotFound(pid); __log.info(msg); throw new ContextException(msg); } final DeploymentUnitDir dudir = pconf.getDeploymentUnit(); exec(new ProcessStoreImpl.Callable<Object>() { public Object call(ConfStoreDAOConnection conn) { DeploymentUnitDAO dudao = conn.getDeploymentUnit(dudir.getName()); if (dudao == null) return null; ProcessConfDAO proc = dudao.getProcess(pid); if (proc == null) return null; proc.setProperty(propName, value); return null; } }); fireEvent(new ProcessStoreEvent(ProcessStoreEvent.Type.PROPERTY_CHANGED, pid, dudir.getName())); }
ProcessConfDAO newDao = dudao.createProcess(pc.getProcessId(), pc.getType(), pc.getVersion()); newDao.setState(pc.getState()); for (Map.Entry<QName, Node> prop : pc.getProcessProperties().entrySet()) { newDao.setProperty(prop.getKey(), DOMUtils.domToString(prop.getValue())); deployed.add(pc.getProcessId()); conn.setVersion(pc.getVersion()); } catch (Throwable e) { String errmsg = "Error persisting deployment record for " + pc.getProcessId() + "; process will not be available after restart!"; __log.error(errmsg, e);
ProcessConfImpl(QName pid, QName type, long version, DeploymentUnitDir du, TDeployment.Process pinfo, Date deployDate, Map<QName, Node> props, ProcessState pstate, EndpointReferenceContext eprContext, File configDir, boolean generateProcessEventsAll) { _pid = pid; _version = version; _du = du; _pinfo = pinfo; _deployDate = deployDate; _configDir = configDir; _props = Collections.unmodifiableMap(props); _state = pstate; _type = type; _inMemory = _pinfo.isSetInMemory() && _pinfo.getInMemory(); this.generateProcessEventsAll = generateProcessEventsAll; this.eprContext = eprContext; propertiesWatchDog = new WatchDog<Map<File, Long>, PropertiesObserver>(new PropertiesMutable(), new PropertiesObserver()); initLinks(); initMexInterceptors(); initEventList(); processCleanupConfImpl = new ProcessCleanupConfImpl(pinfo); initSchedules(); }
ProcessConfImpl pconf = new ProcessConfImpl(pid, processDD.getName(), version, du, processDD, deployDate, calcInitialProperties(du.getProperties(), processDD), calcInitialState(processDD), eprContext, _configDir, generateProcessEventsAll); processes.add(pconf); __log.info(__msgs.msgProcessDeployed(du.getDeployDir(), process.getProcessId())); _processes.put(process.getProcessId(), process); fireEvent(new ProcessStoreEvent(ProcessStoreEvent.Type.DEPLOYED, process.getProcessId(), process.getDeploymentUnit() .getName())); fireStateChange(process.getProcessId(), process.getState(), process.getDeploymentUnit().getName());
for (ProcessConfImpl p : loaded) { try { fireStateChange(p.getProcessId(), p.getState(), p.getDeploymentUnit().getName()); } catch (Exception except) { __log.error("Error while activating process: pid=" + p.getProcessId() + " package="+p.getDeploymentUnit().getName(), except);
ProcessConfImpl pconf = new ProcessConfImpl(p.getPID(), p.getType(), p.getVersion(), dud, pinfo, dudao .getDeployDate(), props, _processStates, _eprContext, _configDir, generateProcessEventsAll); version = p.getVersion(); _processes.put(pconf.getProcessId(), pconf); loaded.add(pconf);
public void setProperty(final QName pid, final QName propName, final String value) { if (__log.isDebugEnabled()) __log.debug("Setting property " + propName + " on process " + pid); ProcessConfImpl pconf = _processes.get(pid); if (pconf == null) { String msg = __msgs.msgProcessNotFound(pid); __log.info(msg); throw new ContextException(msg); } final DeploymentUnitDir dudir = pconf.getDeploymentUnit(); exec(new ProcessStoreImpl.Callable<Object>() { public Object call(ConfStoreConnection conn) { DeploymentUnitDAO dudao = conn.getDeploymentUnit(dudir.getName()); if (dudao == null) return null; ProcessConfDAO proc = dudao.getProcess(pid); if (proc == null) return null; proc.setProperty(propName, value); return null; } }); fireEvent(new ProcessStoreEvent(ProcessStoreEvent.Type.PROPERTY_CHANGED, pid, dudir.getName())); }
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); } }
public InputStream getCBPInputStream() { CBPInfo cbpInfo = _du.getCBPInfo(getType()); if (cbpInfo == null) throw new ContextException("CBP record not found for type " + getType()); try { return new FileInputStream(cbpInfo.cbp); } catch (FileNotFoundException e) { throw new ContextException("File Not Found: " + cbpInfo.cbp, e); } }
public InputStream getCBPInputStream() { CBPInfo cbpInfo = _du.getCBPInfo(getType()); if (cbpInfo == null) throw new ContextException("CBP record not found for type " + getType()); try { return new FileInputStream(cbpInfo.cbp); } catch (FileNotFoundException e) { throw new ContextException("File Not Found: " + cbpInfo.cbp, e); } }