protected synchronized void internalLock(String sessionId, String nodeIdentifier) throws LockException
{
CacheableSessionLockManager session = sessionLockManagers.get(sessionId);
if (session != null && session.containsPendingLock(nodeIdentifier))
{
LockData lockData = session.getPendingLock(nodeIdentifier);
Fqn<String> lockPath = makeLockFqn(lockData.getNodeIdentifier());
// addChild will add if absent or return old if present
Node<Serializable, Object> node = cache.getRoot().addChild(lockPath);
// this will return null if success. And old data if something exists...
LockData oldLockData = (LockData)node.putIfAbsent(LOCK_DATA, lockData);
if (oldLockData != null)
{
throw new LockException("Unable to write LockData. Node [" + lockData.getNodeIdentifier()
+ "] already has LockData!");