Package info.aduna.concurrent.locks

Examples of info.aduna.concurrent.locks.Lock


  }

  public void clearInferred(Resource... contexts)
    throws SailException
  {
    Lock conLock = getSharedConnectionLock();
    try {
      verifyIsOpen();

      Lock txnLock = getTransactionLock();
      try {
        autoStartTransaction();
        removeStatements(null, null, null, false, contexts);
      }
      finally {
        txnLock.release();
      }
    }
    finally {
      conLock.release();
    }
View Full Code Here


    throws SailException
  {
    if (isInitialized()) {
      logger.debug("Shutting down NativeStore...");

      Lock txnLock = getTransactionLock();
      try {
        Lock writeLock = getWriteLock();
        try {
          tripleStore.close();
          valueStore.close();
          namespaceStore.close();

          initialized = false;

          logger.debug("NativeStore shut down");
        }
        catch (IOException e) {
          throw new SailException(e);
        }
        finally {
          writeLock.release();
        }
      }
      finally {
        txnLock.release();
      }
View Full Code Here

   */
  public void clear()
    throws IOException
  {
    try {
      Lock writeLock = lockManager.getWriteLock();
      try {
        dataStore.clear();

        synchronized (valueCache) {
          valueCache.clear();
        }

        synchronized (valueIDCache) {
          valueIDCache.clear();
        }

        synchronized (namespaceCache) {
          namespaceCache.clear();
        }

        synchronized (namespaceIDCache) {
          namespaceIDCache.clear();
        }

        initBNodeParams();

        setNewRevision();
      }
      finally {
        writeLock.release();
      }
    }
    catch (InterruptedException e) {
      IOException ioe = new IOException("Failed to acquire write lock");
      ioe.initCause(e);
View Full Code Here

    }
  }
 
  public boolean addInferredStatement(Resource subj, URI pred, Value obj,
      Resource... contexts) throws SailException {
    Lock conLock = getSharedConnectionLock();
    try {
      verifyIsOpen();

      Lock txnLock = getTransactionLock();
      try {
        autoStartTransaction();
        addStatement(subj, pred, obj, false, contexts);
      }
      finally {
        txnLock.release();
      }
    }
    finally {
      conLock.release();
    }
View Full Code Here

    }
    return true;
  }

  public void clearInferred(Resource... contexts) throws SailException {
    Lock conLock = getSharedConnectionLock();
    try {
      verifyIsOpen();

      Lock txnLock = getTransactionLock();
      try {
        autoStartTransaction();
        removeStatements(null, null, null, false, contexts);
      }
      finally {
        txnLock.release();
      }
    }
    finally {
      conLock.release();
    }
View Full Code Here

    // no-op; changes are reported as soon as they come in
  }

  public boolean removeInferredStatement(Resource subj, URI pred, Value obj,
      Resource... contexts) throws SailException {
    Lock conLock = getSharedConnectionLock();
    try {
      verifyIsOpen();

      Lock txnLock = getTransactionLock();
      try {
        autoStartTransaction();
        int removeCount = removeStatements(subj, pred, obj, false, contexts);
        return removeCount > 0;
      }
      finally {
        txnLock.release();
      }
    }
    finally {
      conLock.release();
    }
View Full Code Here

TOP

Related Classes of info.aduna.concurrent.locks.Lock

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.