1 16 package org.springframework.webflow.conversation.impl; 17 18 19 import org.springframework.core.NestedRuntimeException; 20 21 import EDU.oswego.cs.dl.util.concurrent.ReentrantLock; 22 23 31 class UtilConcurrentConversationLock implements ConversationLock { 32 33 36 private final ReentrantLock lock = new ReentrantLock(); 37 38 42 public void lock() { 43 try { 44 lock.acquire(); 45 } 46 catch (InterruptedException e) { 47 throw new SystemInterruptedException("Unable to acquire lock.", e); 48 } 49 } 50 51 54 public void unlock() { 55 lock.release(); 56 } 57 58 65 public static class SystemInterruptedException extends NestedRuntimeException { 66 67 71 public SystemInterruptedException(String msg) { 72 super(msg); 73 } 74 75 80 public SystemInterruptedException(String msg, Throwable cause) { 81 super(msg, cause); 82 } 83 } 84 } | Popular Tags |