public LockStore getLockStore() { LockStore lockStore = this.lockStore; if(lockStore == null) { synchronized (this) { lockStore = this.lockStore; if(lockStore == null) { this.lockStore = lockStore = new LockStore(); } } } return lockStore; } }
public LockedBean lock(final BeanIdentifier id) { LockStore lockStore = getLockStore(); if(lockStore == null) { //if the lockstore is null then no locking is necessary, as the underlying //context is single threaded return null; } return lockStore.lock(id); }
@Override public LockStore getLockStore() { LockStore lockStore = this.lockStore; if (lockStore == null) { lockStore = (LockStore) getAttribute(LOCK_STORE_KEY); if (lockStore == null) { synchronized (SessionMapBeanStore.class) { lockStore = (LockStore) getAttribute(LOCK_STORE_KEY); if (lockStore == null) { lockStore = new LockStore(); setAttribute(LOCK_STORE_KEY, lockStore); } } } this.lockStore = lockStore; } return lockStore; }