Examples of writeLock()


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

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

  /**
   * Acquires a read lock on a specific key.
View Full Code Here

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

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

    this.jobCredentials = jobCredentials;
    this.jobTokenSecretManager = jobTokenSecretManager;

    this.aclsManager = new JobACLsManager(conf);
View Full Code Here

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

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

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

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

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

        }
        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
     * class. If there is no record in the cache, then a new record is created
View Full Code Here

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

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

  /**
   * Acquires a read lock on a specific key.
View Full Code Here

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

                             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) {
        if (cls == null) {
View Full Code Here

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

        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.writeLock()

        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.writeLock()

        }
        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
     * class. If there is no record in the cache, then a new record is created
View Full Code Here

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

        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.