Examples of readLock()


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

   * @param key The key to lock
   * @param timeout in milliseconds; -1 means wait indefinitely, 0 means no wait.
   */
  public void readLock(EntityKey key, int timeout) {
    ReadWriteLock lock = getLock( key );
    Lock readLock = lock.readLock();
    acquireLock( key, timeout, readLock );
  }

  private ReadWriteLock getLock(EntityKey key) {
    ReadWriteLock newLock = new ReentrantReadWriteLock();
View Full Code Here

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

    this.newApiCommitter = newApiCommitter;

    this.taskAttemptListener = taskAttemptListener;
    this.eventHandler = eventHandler;
    ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
    this.readLock = readWriteLock.readLock();
    this.writeLock = readWriteLock.writeLock();

    this.jobCredentials = jobCredentials;
    this.jobTokenSecretManager = jobTokenSecretManager;
View Full Code Here

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

    // Initialize reportedStatus
    reportedStatus = new TaskAttemptStatus();
    initTaskAttemptStatus(reportedStatus);

    ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
    readLock = readWriteLock.readLock();
    writeLock = readWriteLock.writeLock();

    this.credentials = credentials;
    this.jobToken = jobToken;
    this.eventHandler = eventHandler;
View Full Code Here

Examples of java.util.concurrent.locks.ReadWriteLock.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 java.util.concurrent.locks.ReadWriteLock.readLock()

   * @param key The key to lock
   * @param timeout in milliseconds; -1 means wait indefinitely, 0 means no wait.
   */
  public void readLock(EntityKey key, int timeout) {
    ReadWriteLock lock = getLock( key );
    Lock readLock = lock.readLock();
    acquireLock( key, timeout, readLock );
  }

  private ReadWriteLock getLock(EntityKey key) {
    ReadWriteLock newLock = new ReentrantReadWriteLock();
View Full Code Here

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

    public ProvidersRegistry(LifecycleManagersRegistry factoryRegistry,
                             ApplicationValidator applicationValidator) {
        this.factoryFactoryRegistry = factoryRegistry;
        this.applicationValidator = applicationValidator;
        ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
        readersLock = readWriteLock.readLock();
        writersLock = readWriteLock.writeLock();
    }

    @SuppressWarnings("unchecked")
    public boolean addProvider(Class<?> cls, double priority) {
View Full Code Here

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

        this.applicationValidator = applicationValidator;
        rootResources = new LinkedList<ResourceRecord>();
        dirty = false;
        resourceRecordsFactory = new ResourceRecordFactory(factoryRegistry);
        ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
        readersLock = readWriteLock.readLock();
        writersLock = readWriteLock.writeLock();
    }

    /**
     * Add a resource as an object to the registry
View Full Code Here

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

                            ApplicationValidator applicationValidator) {
        this.applicationValidator = applicationValidator;
        rootResources = new LinkedList<ResourceRecord>();
        resourceRecordsFactory = new ResourceRecordFactory(factoryRegistry);
        ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
        readersLock = readWriteLock.readLock();
        writersLock = readWriteLock.writeLock();
        uriToResourceCache.put(Boolean.TRUE,
                               new SoftConcurrentMap<String, ArrayList<ResourceRecord>>());
        uriToResourceCache.put(Boolean.FALSE,
                               new SoftConcurrentMap<String, ArrayList<ResourceRecord>>());
View Full Code Here

Examples of java.util.concurrent.locks.ReadWriteLock.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 java.util.concurrent.locks.ReentrantReadWriteLock.readLock()

        locks = new Lock[capacity];
        for(int j = 0; j < locks.length; j++) {
            locks[j] = new ReentrantLock();
        }
        ReadWriteLock rwLock = new ReentrantReadWriteLock();
        readLock = rwLock.readLock();
        writeLock = rwLock.writeLock();
    }

    /**
     * double the set size
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.