core/src/main/java/com/orientechnologies/common/collection/closabledictionary/OClosableLinkedContainer.java
public OClosableEntry<K, V> acquire(K key) throws InterruptedException {
    checkOpenFilesLimit();

    final OClosableEntry<K, V> entry = data.get(key);

    if (entry == null)
      return null;

    boolean logOpen = false;
    entry.acquireStateLock();
    try {
      if (entry.isRetired() || entry.isDead()) {
        return null;
      } else if (entry.isClosed()) {
        entry.makeAcquiredFromClosed(entry.get());
        logOpen = true;
      } else if (entry.isOpen()) {
        entry.makeAcquiredFromOpen();
      } else {
        entry.incrementAcquired();
      }
    } finally {
      entry.releaseStateLock();
    }

    if (logOpen) {
      logOpen(entry);
    } else {
      logAcquire(entry);
    }

    assert entry.get().isOpen();
    return entry;
  }
public OClosableEntry<K, V> acquire(K key) throws InterruptedException {
    checkOpenFilesLimit();

    final OClosableEntry<K, V> entry = data.get(key);

    if (entry == null)
      return null;

    boolean logOpen = false;
    entry.acquireStateLock();
    try {
      if (entry.isRetired() || entry.isDead()) {
        return null;
      } else if (entry.isClosed()) {
        entry.makeAcquiredFromClosed(entry.get());
        logOpen = true;
      } else if (entry.isOpen()) {
        entry.makeAcquiredFromOpen();
      } else {
        entry.incrementAcquired();
      }
    } finally {
      entry.releaseStateLock();
    }

    if (logOpen) {
      logOpen(entry);
    } else {
      logAcquire(entry);
    }

    assert entry.get().isOpen();
    return entry;
  }
public OClosableEntry < K , V > acquire ( K key ) throws InterruptedException { checkOpenFilesLimit ( ) ; final OClosableEntry < K , V > entry = data . get ( key ) ; if ( entry == null ) return null ; boolean logOpen = false ; entry . acquireStateLock ( ) ; try { if ( entry . isRetired ( ) || entry . isDead ( ) ) { return null ; } else if ( entry . isClosed ( ) ) { entry . makeAcquiredFromClosed ( entry . get ( ) ) ; logOpen = true ; } else if ( entry . isOpen ( ) ) { entry . makeAcquiredFromOpen ( ) ; } else { entry . incrementAcquired ( ) ; } } finally { entry . releaseStateLock ( ) ; } if ( logOpen ) { logOpen ( entry ) ; } else { logAcquire ( entry ) ; } assert entry . get ( ) . isOpen ( ) ; return entry ; }
Acquires item associated with passed in key in container.
It is guarantied that item will not be closed if limit of open items will be exceeded and container will close rarely used
items.

@param key Key associated with item

@return Acquired item if key exists into container or <code>null</code> if there is no item associated with given container
Acquires item associated with passed in key in container . It is guarantied that item will not be closed if limit of open items will be exceeded and container will close rarely used items .