Acquires an edge lock.

@param edge the edge to lock
@param mode the mode to lock in
@return a lock resource which must be closed to release the lock
501853
public LockResource lockEdge(Edge edge, LockMode mode) {
    return mEdgeLocks.get(edge, mode);
  }
1066559
public void detachEdge(SquareEdge edge) {

		edge.a.edges[edge.sideA] = null;
		edge.b.edges[edge.sideB] = null;
		edge.distance = 0;

		edgeManager.recycleInstance(edge);
	}
158091
public LockedInodePath lockFinalEdgeWrite() throws InvalidPathException {
    Preconditions.checkState(!fullPathExists());

    LockedInodePath newPath =
        new LockedInodePath(mUri, this, mPathComponents, LockPattern.WRITE_EDGE);
    newPath.traverse();
    return newPath;
  }
250050
public void lockRootEdge(LockMode mode) {
    Preconditions.checkState(mEntries.isEmpty());

    mEntries.add(new EdgeEntry(mInodeLockManager.lockEdge(ROOT_EDGE, mode), ROOT_EDGE));
    mLockMode = mode;
  }
278392
Lockable<SharedBufferNode> getEntry(NodeId nodeId) {
		return entryCache.computeIfAbsent(nodeId, id -> {
			try {
				return entries.get(id);
			} catch (Exception ex) {
				throw new WrappingRuntimeException(ex);
			}
		});
	}
1353788
@CheckForNull
    public static LockingStrategy create( @Nullable final LockingMode lockingMode, @Nullable final Pattern uriPattern,
            @Nullable final StorageClient storage, @Nonnull final MemcachedSessionService manager,
            @Nonnull final MemcachedNodesManager memcachedNodesManager,
            @Nonnull final LRUCache<String, Boolean> missingSessionsCache, final boolean storeSecondaryBackup,
            @Nonnull final Statistics stats,
            @Nonnull final CurrentRequest currentRequest ) {
        if ( lockingMode == null || storage == null ) {
            return null;
        }
        switch ( lockingMode ) {
        case ALL:
            return new LockingStrategyAll( manager, memcachedNodesManager, storage, missingSessionsCache, storeSecondaryBackup, stats, currentRequest );
        case AUTO:
            return new LockingStrategyAuto( manager, memcachedNodesManager, storage, missingSessionsCache, storeSecondaryBackup, stats, currentRequest );
        case URI_PATTERN:
            return new LockingStrategyUriPattern( manager, memcachedNodesManager, uriPattern, storage, missingSessionsCache, storeSecondaryBackup,
                    stats, currentRequest );
        case NONE:
            return new LockingStrategyNone( manager, memcachedNodesManager, storage, missingSessionsCache, storeSecondaryBackup, stats, currentRequest );
        default:
            throw new IllegalArgumentException( "LockingMode not yet supported: " + lockingMode );
        }
    }
1318518
def acquire(self, *args, **kwargs):
        
        if not self.field.lockable:
            return
        if self.already_locked_by_model:
            self.sub_lock_mode = True
            return
        self.already_locked_by_model = True
        super(FieldLock, self).acquire(*args, **kwargs)
1185099
public boolean add(TypedEdge<T> e) {
        if (e.from() == rootVertex) 
            return add(edges, e.to(), e.edgeType());
        else if (e.to() == rootVertex) 
            return add(edges, e.from(), e.edgeType());
        return false;
    }
93491
private ODocument getEdgeWithPossibleId(String start, String end, List<String> ids) {
        List<ODocument> edges = getEdgesBetweenModels(start, end);
        for (ODocument edge : edges) {
            if (ids.contains(OrientModelGraphUtils.getIdFieldValue(edge))) {
                return edge;
            }
        }
        return edges.size() != 0 ? edges.get(0) : null;
    }
1125508
public @CheckForNull
    IsNullValue getDecision(int edgeType) {
        switch (edgeType) {
        case EdgeTypes.IFCMP_EDGE:
            return ifcmpDecision;
        case EdgeTypes.FALL_THROUGH_EDGE:
            return fallThroughDecision;
        default:
            throw new IllegalArgumentException("Bad edge type: " + edgeType);
        }
    }
997889
@Override
    public void lock(Object entity, LockModeType lockMode)
    {
        ivEm.lock(entity, lockMode);
    }
650931
public static PortletMode getPortletMode(String mode) {
        if (mode == null) {
            return null;
        }

        final PortletMode portletMode = PORTLET_MODES.get(mode);
        if (portletMode != null) {
            return portletMode;
        }

        return new PortletMode(mode);
    }
420320
@Override
  public boolean deleteFlowEdge(String edgeId) {
    try {
      rwLock.writeLock().lock();
      return flowEdgeMap.containsKey(edgeId) && deleteFlowEdge(flowEdgeMap.get(edgeId));
    } finally {
      rwLock.writeLock().unlock();
    }
  }
795821
public String getHighwayAsString(EdgeIteratorState edge) {
        int val = getHighway(edge);
        for (Entry<String, Integer> e : highwayMap.entrySet()) {
            if (e.getValue() == val)
                return e.getKey();
        }
        return null;
    }
464893
@Override
    public void lock(Object entity, LockModeType lockMode)
    {
        if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled())
            Tr.debug(tc, "em.lock(" + entity + ',' + lockMode + ");\n" + toString());

        getEMInvocationInfo(true).lock(entity, lockMode);
    }
761259
public Model addEdge(Edge edge) {
    edges.add(edge);
    if (isNotNull(edge.getSourceVertex()) && !vertices.contains(edge.getSourceVertex())) {
      vertices.add(edge.getSourceVertex());
    }
    if (isNotNull(edge.getTargetVertex()) && !vertices.contains(edge.getTargetVertex())) {
      vertices.add(edge.getTargetVertex());
    }
    return this;
  }
873942
@Override
  public Object getLock() {
    ResourceSet resourceSet = this.getResourceSet();
    if ((resourceSet instanceof ISynchronizable<?>)) {
      return ((ISynchronizable<?>) resourceSet).getLock();
    }
    return this;
  }