protected void createLockOnNewProcessInstance(Long id, RuntimeEngine runtime) { if (!isUseLocking()) { logger.debug("Locking on runtime manager disabled"); return; } ReentrantLock newLock = new ReentrantLock(); ReentrantLock lock = engineLocks.putIfAbsent(id, newLock); if (lock == null) { lock = newLock; } lock.lock(); logger.debug("[on new process instance] Lock {} created and stored in list by {}", lock, runtime); }
protected void createLockOnGetEngine(Context<?> context, RuntimeEngine runtime) { if (!isUseLocking()) { logger.debug("Locking on runtime manager disabled"); return; } if (context instanceof ProcessInstanceIdContext) { Long piId = ((ProcessInstanceIdContext) context).getContextId(); createLockOnGetEngine(piId, runtime); } }
protected void createLockOnGetEngine(Long id, RuntimeEngine runtime) { if (!isUseLocking()) { logger.debug("Locking on runtime manager disabled"); return; } if (id != null) { ReentrantLock newLock = new ReentrantLock(); ReentrantLock lock = engineLocks.putIfAbsent(id, newLock); if (lock == null) { lock = newLock; logger.debug("New lock created as it did not exist before"); } else { logger.debug("Lock exists with {} waiting threads", lock.getQueueLength()); } logger.debug("Trying to get a lock {} for {} by {}", lock, id, runtime); lock.lock(); logger.debug("Lock {} taken for {} by {} for waiting threads by {}", lock, id, runtime, lock.hasQueuedThreads()); } }
protected void releaseAndCleanLock(RuntimeEngine runtime) { if (!isUseLocking()) { logger.debug("Locking on runtime manager disabled"); return; } if (((RuntimeEngineImpl)runtime).getContext() instanceof ProcessInstanceIdContext) { Long piId = ((ProcessInstanceIdContext) ((RuntimeEngineImpl)runtime).getContext()).getContextId(); if (piId != null) { releaseAndCleanLock(piId, runtime); } } }
protected void createLockOnNewProcessInstance(Long id, RuntimeEngine runtime) { if (!isUseLocking()) { logger.debug("Locking on runtime manager disabled"); return; } ReentrantLock newLock = new ReentrantLock(); ReentrantLock lock = engineLocks.putIfAbsent(id, newLock); if (lock == null) { lock = newLock; } lock.lock(); logger.debug("[on new process instance] Lock {} created and stored in list by {}", lock, runtime); }
protected void createLockOnGetEngine(Context<?> context, RuntimeEngine runtime) { if (!isUseLocking()) { logger.debug("Locking on runtime manager disabled"); return; } if (context instanceof ProcessInstanceIdContext) { Long piId = ((ProcessInstanceIdContext) context).getContextId(); createLockOnGetEngine(piId, runtime); } }
protected void createLockOnGetEngine(Long id, RuntimeEngine runtime) { if (!isUseLocking()) { logger.debug("Locking on runtime manager disabled"); return; } if (id != null) { ReentrantLock newLock = new ReentrantLock(); ReentrantLock lock = engineLocks.putIfAbsent(id, newLock); if (lock == null) { lock = newLock; logger.debug("New lock created as it did not exist before"); } else { logger.debug("Lock exists with {} waiting threads", lock.getQueueLength()); } logger.debug("Trying to get a lock {} for {} by {}", lock, id, runtime); lock.lock(); logger.debug("Lock {} taken for {} by {} for waiting threads by {}", lock, id, runtime, lock.hasQueuedThreads()); } }
protected void releaseAndCleanLock(RuntimeEngine runtime) { if (!isUseLocking()) { logger.debug("Locking on runtime manager disabled"); return; } if (((RuntimeEngineImpl)runtime).getContext() instanceof ProcessInstanceIdContext) { Long piId = ((ProcessInstanceIdContext) ((RuntimeEngineImpl)runtime).getContext()).getContextId(); if (piId != null) { releaseAndCleanLock(piId, runtime); } } }