1 13 package org.jahia.services.lock; 14 15 import java.util.HashMap ; 16 17 import org.jahia.services.usermanager.JahiaUser; 18 19 26 public class DummyLockRegistry extends LockService { 27 28 31 private DummyLockRegistry() { 32 logger.debug("Lock registry has been instanciated"); 33 } 34 35 private static DummyLockRegistry lockRegistryInstance; 36 37 private static org.apache.log4j.Logger logger = 38 org.apache.log4j.Logger.getLogger(DummyLockRegistry.class); 39 40 46 public synchronized static DummyLockRegistry getInstance() { 47 if (lockRegistryInstance == null) { 48 lockRegistryInstance = new DummyLockRegistry(); 49 } 50 return lockRegistryInstance; 51 } 52 53 63 public synchronized boolean acquire(LockKey lockKey, JahiaUser owner, 64 String lockID, int timeout) { 65 return true; 66 } 67 68 77 public synchronized boolean isAcquireable(LockKey lockKey, JahiaUser owner, 78 String lockID) { 79 return true; 80 } 81 82 95 public synchronized boolean reserve(LockKey lockKey, JahiaUser owner, 96 String lockID, int timeout, int delay) { 97 return false; 98 } 99 100 107 public synchronized void release(LockKey lockKey, JahiaUser owner, 108 String lockID) { 109 } 110 111 117 public synchronized HashMap getInfo(LockKey lockKey) { 118 HashMap lockInfo = new HashMap (); 119 return lockInfo; 120 } 121 122 128 public synchronized Long getTimeRemaining(LockKey lockKey) { 129 return new Long (0); 130 } 131 132 141 public synchronized void steal(LockKey lockKey, JahiaUser newOwner, 142 String lockID) { 143 } 144 145 156 public synchronized void nuke(LockKey lockKey, JahiaUser owner, String lockID) { 157 } 158 159 165 public boolean isStealed(LockKey lockKey) { 166 return true; 167 } 168 169 175 public synchronized boolean isAlreadyAcquired(LockKey lockKey) { 176 return false; 177 } 178 179 187 public synchronized boolean isStealedInContext(LockKey lockKey, JahiaUser owner, String lockID) { 188 return false; 189 } 190 191 200 public synchronized boolean isAlreadyAcquiredInContext(LockKey lockKey, 201 JahiaUser owner, String lockID) { 202 return false; 203 } 204 205 213 public synchronized boolean canRelease(LockKey lockKey, JahiaUser owner, 214 String lockID) { 215 return true; 216 } 217 218 225 public synchronized boolean hasAdminRights(LockKey lockKey, JahiaUser owner) { 226 return true; 227 } 228 229 235 public void purgeLocks() { 236 } 237 238 } | Popular Tags |