Package javax.resource.spi

Examples of javax.resource.spi.RetryableUnavailableException


               synchronized (cls)
               {
                  if (shutdown.get())
                  {
                     permits.release();
                     throw new RetryableUnavailableException(bundle.thePoolHasBeenShutdown());
                  }

                  int clsSize = cls.size();
                  if (clsSize > 0)
                  {
View Full Code Here


            {
               //Check shutdown
               if (this.shutdown.get())
               {
                  permits.release();
                  throw new RetryableUnavailableException("The pool has been shut down");
               }
              
               if (cls.size() > 0)
               {
                  connectionListener = this.cls.remove(this.cls.size() - 1);
View Full Code Here

      long startWait = System.currentTimeMillis();
      if (getAvailableConnections() > 0)
      {
         if (shutdown.get())
            throw new RetryableUnavailableException("The pool has been shutdown");
        
         cl = cls.peek();
         if (cl != null)
         {
            try
            {
               cl = cls.poll(poolConfiguration.getBlockingTimeout(), TimeUnit.MILLISECONDS);
            }
            catch (InterruptedException ie)
            {
               long end = System.currentTimeMillis() - startWait;
               throw new ResourceException("Interrupted while requesting connection! Waited " + end + " ms");
            }
         }
         else
         {
            try
            {
               // No, the pool was empty, so we have to make a new one.
               cl = createConnectionEventListener(subject, cri);

               // Started is atomic, so pool filler won't be scheduled twice
               if (!started.getAndSet(true))
               {
                  if (poolConfiguration.getMinSize() > 0)
                     PoolFiller.fillPool(this);
               }
              
               if (trace)
                  log.trace("supplying new ManagedConnection: " + cl);
              
               verifyConnectionListener = false;
            }
            catch (Throwable t)
            {
               log.warn("Throwable while attempting to get a new connection: " + cl, t);

               JBossResourceException.rethrowAsResourceException("Unexpected throwable while trying " +
                                                                 "to create a connection: " + cl, t);
            }
         }
      }
      else
      {
         try
         {
            cl = cls.poll(poolConfiguration.getBlockingTimeout(), TimeUnit.MILLISECONDS);

            if (shutdown.get())
               throw new RetryableUnavailableException("The pool has been shutdown");
         }
         catch (InterruptedException ie)
         {
            if (!poolConfiguration.isUseFastFail())
            {
View Full Code Here

               synchronized (cls)
               {
                  if (shutdown.get())
                  {
                     permits.release();
                     throw new RetryableUnavailableException("The pool has been shutdown");
                  }

                  int clsSize = cls.size();
                  if (clsSize > 0)
                  {
View Full Code Here

      long startWait = System.currentTimeMillis();
      if (cls.size() > 0)
      {
         if (shutdown.get())
            throw new RetryableUnavailableException(bundle.thePoolHasBeenShutdown());
        
         cl = cls.peek();
         if (cl != null)
         {
            try
            {
               cl = cls.poll(poolConfiguration.getBlockingTimeout(), TimeUnit.MILLISECONDS);
               statistics.deltaTotalBlockingTime(System.currentTimeMillis() - startWait);
            }
            catch (InterruptedException ie)
            {
               long end = System.currentTimeMillis() - startWait;
               throw new ResourceException(bundle.interruptedWhileRequestingConnection(end));
            }
         }
         else
         {
            try
            {
               // No, the pool was empty, so we have to make a new one.
               cl = createConnectionEventListener(subject, cri);

               if (trace)
                  log.trace("supplying new ManagedConnection: " + cl);
              
               verifyConnectionListener = false;
            }
            catch (Throwable t)
            {
               log.throwableWhileAttemptingGetNewGonnection(cl, t);

               throw new ResourceException(bundle.unexpectedThrowableWhileTryingCreateConnection(cl), t);
            }
         }
      }
      else
      {
         try
         {
            cl = cls.poll(poolConfiguration.getBlockingTimeout(), TimeUnit.MILLISECONDS);
            statistics.deltaTotalBlockingTime(System.currentTimeMillis() - startWait);

            if (shutdown.get())
               throw new RetryableUnavailableException(bundle.thePoolHasBeenShutdown());
         }
         catch (InterruptedException ie)
         {
            if (!poolConfiguration.isUseFastFail())
            {
View Full Code Here

               synchronized (cls)
               {
                  if (shutdown.get())
                  {
                     permits.release();
                     throw new RetryableUnavailableException(bundle.thePoolHasBeenShutdown());
                  }

                  int clsSize = cls.size();
                  if (clsSize > 0)
                  {
View Full Code Here

      long startWait = System.currentTimeMillis();
      if (cls.size() > 0)
      {
         if (shutdown.get())
            throw new RetryableUnavailableException(bundle.thePoolHasBeenShutdown());
        
         cl = cls.peek();
         if (cl != null)
         {
            try
            {
               cl = cls.poll(poolConfiguration.getBlockingTimeout(), TimeUnit.MILLISECONDS);
               statistics.deltaTotalBlockingTime(System.currentTimeMillis() - startWait);
            }
            catch (InterruptedException ie)
            {
               long end = System.currentTimeMillis() - startWait;
               throw new ResourceException(bundle.interruptedWhileRequestingConnection(end));
            }
         }
         else
         {
            try
            {
               // No, the pool was empty, so we have to make a new one.
               cl = createConnectionEventListener(subject, cri);

               if (trace)
                  log.trace("supplying new ManagedConnection: " + cl);
              
               verifyConnectionListener = false;
            }
            catch (Throwable t)
            {
               log.throwableWhileAttemptingGetNewGonnection(cl, t);

               throw new ResourceException(bundle.unexpectedThrowableWhileTryingCreateConnection(cl), t);
            }
         }
      }
      else
      {
         try
         {
            cl = cls.poll(poolConfiguration.getBlockingTimeout(), TimeUnit.MILLISECONDS);
            statistics.deltaTotalBlockingTime(System.currentTimeMillis() - startWait);

            if (shutdown.get())
               throw new RetryableUnavailableException(bundle.thePoolHasBeenShutdown());
         }
         catch (InterruptedException ie)
         {
            if (!poolConfiguration.isUseFastFail())
            {
View Full Code Here

               synchronized (cls)
               {
                  if (shutdown.get())
                  {
                     permits.release();
                     throw new RetryableUnavailableException(bundle.thePoolHasBeenShutdown());
                  }

                  int clsSize = cls.size();
                  if (clsSize > 0)
                  {
View Full Code Here

               synchronized (cls)
               {
                  if (shutdown.get())
                  {
                     permits.release();
                     throw new RetryableUnavailableException(
                        bundle.thePoolHasBeenShutdown(pool.getName(),
                                                      Integer.toHexString(System.identityHashCode(this))));
                  }

                  int clsSize = cls.size();
View Full Code Here

      long startWait = System.currentTimeMillis();
      if (getAvailableConnections() > 0)
      {
         if (shutdown.get())
            throw new RetryableUnavailableException(bundle.thePoolHasBeenShutdown());
        
         cl = cls.peek();
         if (cl != null)
         {
            try
            {
               cl = cls.poll(poolConfiguration.getBlockingTimeout(), TimeUnit.MILLISECONDS);
            }
            catch (InterruptedException ie)
            {
               long end = System.currentTimeMillis() - startWait;
               throw new ResourceException(bundle.interruptedWhileRequestingConnection(end));
            }
         }
         else
         {
            try
            {
               // No, the pool was empty, so we have to make a new one.
               cl = createConnectionEventListener(subject, cri);

               // Started is atomic, so pool filler won't be scheduled twice
               if (!started.getAndSet(true))
               {
                  if (poolConfiguration.getMinSize() > 0)
                     PoolFiller.fillPool(this);
               }
              
               if (trace)
                  log.trace("supplying new ManagedConnection: " + cl);
              
               verifyConnectionListener = false;
            }
            catch (Throwable t)
            {
               log.throwableWhileAttemptingGetNewGonnection(cl, t);

               throw new ResourceException(bundle.unexpectedThrowableWhileTryingCreateConnection(cl), t);
            }
         }
      }
      else
      {
         try
         {
            cl = cls.poll(poolConfiguration.getBlockingTimeout(), TimeUnit.MILLISECONDS);

            if (shutdown.get())
               throw new RetryableUnavailableException(bundle.thePoolHasBeenShutdown());
         }
         catch (InterruptedException ie)
         {
            if (!poolConfiguration.isUseFastFail())
            {
View Full Code Here

TOP

Related Classes of javax.resource.spi.RetryableUnavailableException

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.