Esempio n. 1
0
  /** Called when the block is removed from the cache. */
  private void freeImpl() {
    if (_useCount.get() > 0) throw new IllegalStateException("freeImpl");

    // save();

    if (toDestroy()) {
      byte[] buffer = _buffer;
      _buffer = null;

      if (buffer != null && _isFreeBuffer) {
        _freeBuffers.free(buffer);
      }

      ReadWriteLock lock = _rwLock;
      _rwLock = null;

      if (lock != null) {
        /*
        if (lock.getReadLockCount() == 0
            && lock.getReadHoldCount() == 0
            && ! lock.isWriteLocked()) {
          _freeLocks.free(lock);
        }
        */
        _freeLocks.free(lock);
      }
    }
  }
  private void freeEntityManager(EntityManager em) {
    em.clear();

    if (!_idleEntityManagerPool.free(em)) em.close();
  }
Esempio n. 3
0
 public static void free(QueryContext cxt) {
   _freeList.free(cxt);
 }
Esempio n. 4
0
  public static void free(ToCharResponseAdapter resAdapt) {
    resAdapt.free();

    _freeList.free(resAdapt);
  }