Package java.util.concurrent.locks

Examples of java.util.concurrent.locks.ReentrantReadWriteLock


        }
       
        if( rwLock == null )
        {
            // Create a ReadWrite lock from scratch
            rwLock = new ReentrantReadWriteLock();
        }
       
        try
        {
            String contextEntryId = getEntryId( getSuffixDn() );
View Full Code Here


        if (root == this) {
            // Adding a new root cell to the universe
            if (!isRoot) {
                // Fisrt time, so setup internal root cell structures
                readWriteLock = new ReentrantReadWriteLock(true);
                this.viewCacheSet = new ViewCacheSet();
                isRoot = true;
                spaces = new HashSet();
            }
               
View Full Code Here

    this.stdDevWeighted = stdDevWeighted == Weighting.WEIGHTED;
    this.compactAverages = compactAverages;
    this.maxEntries = maxEntries;
    this.averageDiffs = new FastByIDMap<FastByIDMap<RunningAverage>>();
    this.averageItemPref = new FastByIDMap<RunningAverage>();
    this.buildAverageDiffsLock = new ReentrantReadWriteLock();
    this.allRecommendableItemIDs = new FastIDSet(dataModel.getNumItems());
    this.refreshHelper = new RefreshHelper(new Callable<Object>() {
      @Override
      public Object call() throws TasteException {
        buildAverageDiffs();
View Full Code Here

  public ItemUserAverageRecommender(DataModel dataModel) {
    super(dataModel);
    this.itemAverages = new FastByIDMap<RunningAverage>();
    this.userAverages = new FastByIDMap<RunningAverage>();
    this.overallAveragePrefValue = new FullRunningAverage();
    this.buildAveragesLock = new ReentrantReadWriteLock();
    this.refreshHelper = new RefreshHelper(new Callable<Object>() {
      @Override
      public Object call() throws TasteException {
        buildAverageDiffs();
        return null;
View Full Code Here

  private final RefreshHelper refreshHelper;
 
  public ItemAverageRecommender(DataModel dataModel) {
    super(dataModel);
    this.itemAverages = new FastByIDMap<RunningAverage>();
    this.buildAveragesLock = new ReentrantReadWriteLock();
    this.refreshHelper = new RefreshHelper(new Callable<Object>() {
      @Override
      public Object call() throws TasteException {
        buildAverageDiffs();
        return null;
View Full Code Here

    this.dataFile = dataFile.getAbsoluteFile();
    this.lastModified = dataFile.lastModified();
    this.maxEntries = maxEntries;
    this.averageDiffs = new FastByIDMap<FastByIDMap<RunningAverage>>();
    this.allRecommendableItemIDs = new FastIDSet();
    this.buildAverageDiffsLock = new ReentrantReadWriteLock();
  }
View Full Code Here

  final ReadWriteLock                    _lock;
  final ConcurrentHashMap<String, ZNode> _cache;

  public Cache()
  {
    _lock = new ReentrantReadWriteLock();
    _cache = new ConcurrentHashMap<String, ZNode>();
  }
View Full Code Here

        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

  @Inject
  public HostImpl(@Assisted HostEntity hostEntity,
      @Assisted boolean persisted, Injector injector) {
    this.stateMachine = stateMachineFactory.make(this);
    rwLock = new ReentrantReadWriteLock();
    this.readLock = rwLock.readLock();
    this.writeLock = rwLock.writeLock();

    this.hostEntity = hostEntity;
    this.persisted = persisted;
View Full Code Here

    Lock readLock = lock.readLock();
    acquireLock( key, timeout, readLock );
  }

  private ReadWriteLock getLock(EntityKey key) {
    ReadWriteLock newLock = new ReentrantReadWriteLock();
    ReadWriteLock previous = dataLocks.putIfAbsent( key, newLock );
    return previous != null ? previous : newLock;
  }
View Full Code Here

TOP

Related Classes of java.util.concurrent.locks.ReentrantReadWriteLock

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.