Package EDU.oswego.cs.dl.util.concurrent

Examples of EDU.oswego.cs.dl.util.concurrent.FIFOSemaphore


   private FIFOSemaphore wLock_;
   private NullSync rLock_; // Null lock will always return true

   public LockStrategyReadUncommitted()
   {
      wLock_ = new FIFOSemaphore(1);
      rLock_ = new NullSync();
   }
View Full Code Here


        this.next = next;
        this.maxSize = maxSize;
        this.minSize = minSize;
        this.blockingTimeoutMilliseconds = blockingTimeoutMilliseconds;
        setIdleTimeoutMinutes(idleTimeoutMinutes);
        permits = new FIFOSemaphore(maxSize);
    }
View Full Code Here

            resizeLock.writeLock().acquire();
            try {
                ResizeInfo resizeInfo = new ResizeInfo(this.minSize, (int)permits.permits(), connectionCount, newMaxSize);
                this.shrinkLater = resizeInfo.getShrinkLater();

                permits = new FIFOSemaphore(newMaxSize);
                //pre-acquire permits for the existing checked out connections that will not be closed when they are returned.
                for (int i = 0; i < resizeInfo.getTransferCheckedOut(); i++) {
                    permits.acquire();
                }
                //transfer connections we are going to keep
View Full Code Here

   throws Exception;

   protected void createService() throws Exception
   {
      if( this.isStrict == Boolean.TRUE )
         this.strictMaxSize = new FIFOSemaphore(this.maxSize);
   }
View Full Code Here

/* 118 */     this.poolParams = poolParams;
/* 119 */     this.maxSize = poolParams.maxSize;
/* 120 */     this.log = log;
/* 121 */     this.trace = log.isTraceEnabled();
/* 122 */     this.cls = new ArrayList(this.maxSize);
/* 123 */     this.permits = new FIFOSemaphore(this.maxSize);
/*     */
/* 125 */     if (poolParams.prefill)
/*     */     {
/* 127 */       PoolFiller.fillPool(this);
/*     */     }
View Full Code Here

/*     */
/*     */   public void initialize(Container container, int maxSize, long timeout)
/*     */   {
/*  79 */     super.initialize(container, maxSize, timeout);
/*  80 */     this.maxSize = maxSize;
/*  81 */     this.strictMaxSize = new FIFOSemaphore(maxSize);
/*  82 */     this.strictTimeout = timeout;
/*     */   }
View Full Code Here

/*     */   }
/*     */
/*     */   public void setMaxSize(int maxSize)
/*     */   {
/* 102 */     this.maxSize = maxSize;
/* 103 */     this.strictMaxSize = new FIFOSemaphore(maxSize);
/*     */   }
View Full Code Here

/*     */     }
/*     */
/* 312 */     String strictValue = MetaData.getElementContent(MetaData.getOptionalChild(element, "strictMaximumSize"));
/* 313 */     Boolean strictFlag = Boolean.valueOf(strictValue);
/* 314 */     if (strictFlag == Boolean.TRUE)
/* 315 */       this.strictMaxSize = new FIFOSemaphore(this.maxSize);
/* 316 */     String delay = MetaData.getElementContent(MetaData.getOptionalChild(element, "strictTimeout"));
/*     */     try
/*     */     {
/* 319 */       if (delay != null)
/* 320 */         this.strictTimeout = Long.parseLong(delay);
View Full Code Here

/*      */
/*      */ class FifoRNG extends SyncDelegatedRNG
/*      */ {
/*      */   public FifoRNG()
/*      */   {
/* 1963 */     super(new FIFOSemaphore(1L));
/*      */   }
View Full Code Here

      this.maxSize = this.poolParams.maxSize;

      this.log = log;
      this.trace = log.isTraceEnabled();
      cls = new ArrayList(this.maxSize);
      permits = new FIFOSemaphore(this.maxSize);

      if(poolParams.prefill)
      {
         PoolFiller.fillPool(this);
View Full Code Here

TOP

Related Classes of EDU.oswego.cs.dl.util.concurrent.FIFOSemaphore

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.