List of usage examples for org.apache.commons.transaction.locking MultiLevelLock acquire
public boolean acquire(Object ownerId, int targetLockLevel, boolean wait, boolean reentrant, long timeoutMSecs) throws InterruptedException;
From source file:de.innovationgate.wgpublisher.WGPDeployer.java
public String locateTmlResource(WGTMLModule tmlLib, ServletRequest servletRequest) throws WGAPIException, DeployerException { DesignReference ref = WGADesignManager.createDesignReference(tmlLib); DeployedLayout layout = getDeployedLayout(tmlLib, ref); if (layout == null) { MultiLevelLock lock = _lockManager.atomicGetOrCreateLock(ref.toString()); try {/* w w w.ja v a 2 s. c o m*/ try { lock.acquire(Thread.currentThread(), 1, true, true, Long.MAX_VALUE); } catch (InterruptedException e) { } layout = getDeployedLayout(tmlLib, ref); if (layout == null) { servletRequest.setAttribute(REQATTRIB_TML_DEPLOYED, true); layout = deployTML(tmlLib); } } finally { lock.release(Thread.currentThread()); } } return layout.getResourcePath(); }