public long getCurrentVersion() { long version = exec(new Callable<Long>() { public Long call(ConfStoreConnection conn) { return conn.getNextVersion(); } }); return version; }
public long getCurrentVersion() { long version = exec(new Callable<Long>() { public Long call(ConfStoreDAOConnection conn) { return conn.getNextVersion(); } }); return version; }
protected long calculateVersion(File deploymentUnitDirectory) { long version=0; int index=deploymentUnitDirectory.getName().lastIndexOf('-'); if (index != -1) { try { String ver=deploymentUnitDirectory.getName().substring(index+1); if (ver.endsWith(".jar")) { ver = ver.substring(0, ver.length()-4); } version = Long.valueOf(ver); } catch(Exception e) { __log.warn("Unable to infer process version from deployment unit '"+ deploymentUnitDirectory.getName()+"'", e); } } if (version == 0) { // Process and DU use a monotonically increased single version number. version = exec(new Callable<Long>() { public Long call(ConfStoreDAOConnection conn) { return conn.getNextVersion(); } }); } return(version); }
/** * Make sure that the deployment unit is loaded. * * @param duName * deployment unit name */ protected boolean load(final String duName) { _rw.writeLock().lock(); try { if (_deploymentUnits.containsKey(duName)) return true; } finally { _rw.writeLock().unlock(); } try { return exec(new Callable<Boolean>() { public Boolean call(ConfStoreDAOConnection conn) { DeploymentUnitDAO dudao = conn.getDeploymentUnit(duName); if (dudao == null) return false; load(dudao); return true; } }); } catch (Exception ex) { __log.error("Error loading deployment unit: " + duName); return false; } }
/** * Make sure that the deployment unit is loaded. * * @param duName * deployment unit name */ protected boolean load(final String duName) { _rw.writeLock().lock(); try { if (_deploymentUnits.containsKey(duName)) return true; } finally { _rw.writeLock().unlock(); } try { return exec(new Callable<Boolean>() { public Boolean call(ConfStoreConnection conn) { DeploymentUnitDAO dudao = conn.getDeploymentUnit(duName); if (dudao == null) return false; load(dudao); return true; } }); } catch (Exception ex) { __log.error("Error loading deployment unit: " + duName); return false; } }
public Collection<QName> undeploy(final String duName) { try { exec(new Callable<Collection<QName>>() { public Collection<QName> call(ConfStoreDAOConnection conn) { DeploymentUnitDAO dudao = conn.getDeploymentUnit(duName);
public Collection<QName> undeploy(final String duName) { try { exec(new Callable<Collection<QName>>() { public Collection<QName> call(ConfStoreConnection conn) { DeploymentUnitDAO dudao = conn.getDeploymentUnit(duName);
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())); }
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())); }
ProcessState old = exec(new Callable<ProcessState>() { public ProcessState call(ConfStoreConnection conn) { DeploymentUnitDAO dudao = conn.getDeploymentUnit(dudir.getName());
ProcessState old = exec(new Callable<ProcessState>() { public ProcessState call(ConfStoreDAOConnection conn) { DeploymentUnitDAO dudao = conn.getDeploymentUnit(dudir.getName());
exec(new Callable<Object>() { public Object call(ConfStoreConnection conn) { Collection<DeploymentUnitDAO> dus = conn.getDeploymentUnits();
exec(new Callable<Object>() { public Object call(ConfStoreDAOConnection conn) { Collection<DeploymentUnitDAO> dus = conn.getDeploymentUnits();