Examples of readLock()


Examples of java.util.concurrent.locks.ReentrantReadWriteLock.readLock()

            throw new NullPointerException("lifecycleManagerRegistry");
        }
        this.lifecycleManagerRegistry = lifecycleManagerRegistry;
        this.cacheByClass = new HashMap<Class<?>, ResourceRecord>();
        ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
        readersLock = readWriteLock.readLock();
        writersLock = readWriteLock.writeLock();
    }

    /**
     * Gets a resource record from a cache of records for the specified resource
View Full Code Here

Examples of javax.swing.text.AbstractDocument.readLock()

     */
    public static final Element getParagraphElement(final Document doc,
                                                    final int p) {
        if (doc instanceof AbstractDocument) {
            AbstractDocument abstrDoc = (AbstractDocument) doc;
            abstrDoc.readLock();
            Element elem = null;
            int length = 0;
            boolean incorrectPosition = false;
            try {
                length = doc.getLength();
View Full Code Here

Examples of jersey.repackaged.jsr166e.StampedLock.readLock()

    }

    public boolean containsAll(Collection<?> c) {
        boolean ret;
        final StampedLock lock = this.lock;
        long stamp = lock.readLock();
        try {
            ret = internalContainsAll(c, 0, -1);
        } finally {
            lock.unlockRead(stamp);
        }
View Full Code Here

Examples of jsyntaxpane.SyntaxDocument.readLock()

  public void handle(int pos) {
    SyntaxDocument doc = ActionUtils.getSyntaxDocument(pane);
    if (doc != null) {
      try {
        doc.readLock();
        Token token = doc.getTokenAt(pos);
        if (token == null || !handle(doc, token)) {
          deHighlight();
        }
      }
View Full Code Here

Examples of lineage2.gameserver.instancemanager.commission.CommissionItemContainer.readLock()

    List<CommissionItemInfo> items = new ArrayList<>(10);
    Connection con = null;
    PreparedStatement statement = null;
    ResultSet rset = null;
    CommissionItemContainer container = CommissionShopManager.getInstance().getContainer();
    container.readLock();
    try
    {
      con = DatabaseFactory.getInstance().getConnection();
      statement = con.prepareStatement(SELECT_PLAYER_REGISTERED_ITEMS_SQL_QUERY);
      statement.setInt(1, player.getObjectId());
View Full Code Here

Examples of net.sf.hajdbc.lock.LockManager.readLock()

    when(balancer.size()).thenReturn(1);
    when(balancer.iterator()).thenReturn(Collections.singleton(database).iterator());
    when(balancer.next()).thenReturn(database);
    when(cluster.getExecutor()).thenReturn(Executors.newCachedThreadPool());
    when(cluster.getLockManager()).thenReturn(lockManager);
    when(lockManager.readLock(null)).thenReturn(mock(Lock.class));
    when(cluster.getDurability()).thenReturn(mock(Durability.class));
    when(cluster.getTransactionIdentifierFactory()).thenReturn(mock(TransactionIdentifierFactory.class));
   
    try
    {
View Full Code Here

Examples of org.apache.accumulo.fate.zookeeper.DistributedReadWriteLock.readLock()

    if (lock == null) {
      DistributedReadWriteLock locker = new DistributedReadWriteLock(qlock, lockData);
      if (writeLock)
        lock = locker.writeLock();
      else
        lock = locker.readLock();
    }
    return lock;
  }
 
  public static Lock getReadLock(String tableId, long tid) throws Exception {
View Full Code Here

Examples of org.apache.accumulo.server.zookeeper.DistributedReadWriteLock.readLock()

    data.write();
    data.read();
    QueueLock qlock = new MockQueueLock();
   
    final ReadWriteLock locker = new DistributedReadWriteLock(qlock, "locker1".getBytes());
    Lock readLock = locker.readLock();
    Lock writeLock = locker.writeLock();
    readLock.lock();
    readLock.unlock();
    writeLock.lock();
    writeLock.unlock();
View Full Code Here

Examples of org.apache.clerezza.rdf.utils.GraphNode.readLock()

    return AccessController.doPrivileged(new PrivilegedAction<UriRef>() {

      @Override
      public UriRef run() {
        GraphNode platformInstance = getPlatformInstance();
        Lock l = platformInstance.readLock();
        l.lock();
        try {
          Iterator<Resource> triples = platformInstance.getObjects(PLATFORM.defaultBaseUri);
          if (triples.hasNext()) {
            return (UriRef) triples.next();
View Full Code Here

Examples of org.apache.curator.framework.recipes.locks.InterProcessReadWriteLock.readLock()

            else {
                lockEntry = new InterProcessReadWriteLock(zk.getClient(), LOCKS_NODE + "/" + resource);
                zkLocks.put(resource, lockEntry);
            }
        }
        InterProcessMutex readLock = lockEntry.readLock();
        return acquireLock(wait, readLock, resource);
    }

    /**
     * Obtain a WRITE lock for a source.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.