Examples of ReadWriteLock


Examples of java.util.concurrent.locks.ReadWriteLock

                } finally {
                    callContext.setCurrentOperation(originalOperation);
                }
            }

            ReadWriteLock lock;
            if (beanContext.isBeanManagedConcurrency()){
                // Bean-Managed Concurrency
                lock = new BeanManagedLock();
            } else {
                // Container-Managed Concurrency
View Full Code Here

Examples of java.util.concurrent.locks.ReadWriteLock

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

Examples of java.util.concurrent.locks.ReadWriteLock

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

Examples of java.util.concurrent.locks.ReadWriteLock

                    Method create = deploymentInfo.getCreateMethod();
                    interceptorStack = new InterceptorStack(bean, create, Operation.CREATE, new ArrayList<InterceptorData>(), new HashMap());
                    interceptorStack.invoke();
                }

                ReadWriteLock lock;
                if (deploymentInfo.isBeanManagedConcurrency()){
                    // Bean-Managed Concurrency
                    lock = new BeanManagedLock();
                } else {
                    // Container-Managed Concurrency
View Full Code Here

Examples of java.util.concurrent.locks.ReadWriteLock

    public ResourceRegistry(LifecycleManagersRegistry factoryRegistry,
                            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

        if (lifecycleManagerRegistry == null) {
            throw new NullPointerException("lifecycleManagerRegistry");
        }
        this.lifecycleManagerRegistry = lifecycleManagerRegistry;
        this.cacheByClass = new HashMap<Class<?>, ResourceRecord>();
        ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
        readersLock = readWriteLock.readLock();
        writersLock = readWriteLock.writeLock();
    }
View Full Code Here

Examples of java.util.concurrent.locks.ReadWriteLock

    this.resource = containerTokenIdentifier.getResource();
    this.diagnostics = new StringBuilder();
    this.credentials = creds;
    this.metrics = metrics;
    user = containerTokenIdentifier.getApplicationSubmitter();
    ReadWriteLock readWriteLock = new ReentrantReadWriteLock();
    this.readLock = readWriteLock.readLock();
    this.writeLock = readWriteLock.writeLock();

    stateMachine = stateMachineFactory.make(this);
  }
View Full Code Here

Examples of java.util.concurrent.locks.ReadWriteLock

    this.committer = committer;
    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;

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

Examples of java.util.concurrent.locks.ReadWriteLock

   * @see net.sf.hajdbc.lock.LockManager#writeLock(java.lang.String)
   */
  @Override
  public Lock writeLock(String object)
  {
    ReadWriteLock readWriteLock = this.getReadWriteLock(null);
   
    return (object == null) ? readWriteLock.writeLock() : new GlobalLock(readWriteLock.readLock(), this.getReadWriteLock(object).writeLock());
  }
View Full Code Here

Examples of java.util.concurrent.locks.ReadWriteLock

  private synchronized ReadWriteLock getReadWriteLock(String object)
  {
    // CHM cannot use a null key
    String key = (object != null) ? object : "";
   
    ReadWriteLock lock = this.lockMap.get(key);
   
    if (lock == null)
    {
      lock = new SemaphoreReadWriteLock(new Semaphore(Integer.MAX_VALUE, this.fair));

      ReadWriteLock existing = this.lockMap.putIfAbsent(key, lock);
     
      if (existing != null)
      {
        lock = existing;
      }
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.