Examples of BasicThreadPool


Examples of org.jboss.util.threadpool.BasicThreadPool

   {
      synchronized (onewayThreadPoolLock)
      {
         if (onewayThreadPool == null)
         {
            BasicThreadPool pool = new BasicThreadPool("JBossRemoting Client Oneway");
            log.debug("created new thread pool: " + pool);
            Object param = configuration.get(MAX_NUM_ONEWAY_THREADS);
            if (param instanceof String)
            {
               try
               {
                  maxNumberThreads = Integer.parseInt((String) param);
               }
               catch (NumberFormatException  e)
               {
                  log.error("maxNumberThreads parameter has invalid format: " + param);
               }
            }
            else if (param != null)
            {
               log.error("maxNumberThreads parameter must be a string in integer format: " + param);
            }

            param = configuration.get(MAX_ONEWAY_THREAD_POOL_QUEUE_SIZE);

            if (param instanceof String)
            {
               try
               {
                  maxOnewayThreadPoolQueueSize = Integer.parseInt((String) param);
               }
               catch (NumberFormatException  e)
               {
                  log.error("maxOnewayThreadPoolQueueSize parameter has invalid format: " + param);
               }
            }
            else if (param != null)
            {
               log.error("maxOnewayThreadPoolQueueSize parameter must be a string in integer format: " + param);
            }

            pool.setMaximumPoolSize(maxNumberThreads);

            if (maxOnewayThreadPoolQueueSize > 0)
            {
               pool.setMaximumQueueSize(maxOnewayThreadPoolQueueSize);
            }
            pool.setBlockingMode(BlockingMode.RUN);
            onewayThreadPool = pool;
         }
      }
      return onewayThreadPool;
   }
View Full Code Here

Examples of org.jboss.util.threadpool.BasicThreadPool

         if (timeoutThreadPool == null)
         {
            int maxNumberThreads = MAX_NUM_TIMEOUT_THREADS_DEFAULT;
            int maxTimeoutQueueSize = -1;
           
            BasicThreadPool pool = new BasicThreadPool("HTTP timeout");
            log.debug("created new thread pool: " + pool);
            Object param = configuration.get(MAX_NUM_TIMEOUT_THREADS);
            if (param instanceof String)
            {
               try
               {
                  maxNumberThreads = Integer.parseInt((String) param);
               }
               catch (NumberFormatException  e)
               {
                  log.error("maxNumberThreads parameter has invalid format: " + param);
               }
            }
            else if (param != null)
            {
               log.error("maxNumberThreads parameter must be a string in integer format: " + param);
            }

            param = configuration.get(MAX_TIMEOUT_QUEUE_SIZE);

            if (param instanceof String)
            {
               try
               {
                  maxTimeoutQueueSize = Integer.parseInt((String) param);
               }
               catch (NumberFormatException  e)
               {
                  log.error("maxTimeoutQueueSize parameter has invalid format: " + param);
               }
            }
            else if (param != null)
            {
               log.error("maxTimeoutQueueSize parameter must be a string in integer format: " + param);
            }

            pool.setMaximumPoolSize(maxNumberThreads);

            if (maxTimeoutQueueSize > 0)
            {
               pool.setMaximumQueueSize(maxTimeoutQueueSize);
            }
            pool.setBlockingMode(BlockingMode.RUN);
            timeoutThreadPool = pool;
         }
      }
      return timeoutThreadPool;
   }
View Full Code Here

Examples of org.jboss.util.threadpool.BasicThreadPool

         Thread.sleep(1000);
         assertEquals(2, handler.startedCount);
        
         Field field = ServerInvoker.class.getDeclaredField("onewayThreadPool");
         field.setAccessible(true);
         BasicThreadPool pool = (BasicThreadPool) field.get(connector.getServerInvoker());
         assertEquals(3, pool.getMaximumPoolSize());
         assertEquals(5, pool.getMaximumQueueSize());
        
         field = Client.class.getDeclaredField("onewayThreadPool");
         field.setAccessible(true);
         pool = (BasicThreadPool) field.get(client);
         assertEquals(7, pool.getMaximumPoolSize());
         assertEquals(9, pool.getMaximumQueueSize());
        
         client.disconnect();
         connector.stop();
         log.info(getName() + " PASSES");
   }
View Full Code Here

Examples of org.jboss.util.threadpool.BasicThreadPool

      // Verify only one thread pool was created.
      Field field = Client.class.getDeclaredField("onewayThreadPool");
      field.setAccessible(true);
      Object pool = field.get(client);
      assertTrue(pool instanceof BasicThreadPool);
      BasicThreadPool basicThreadPool = (BasicThreadPool) pool;
      assertEquals(poolCounter, basicThreadPool.getPoolNumber());
     
      for (int i = 0; i < INVOCATIONS; i++)
      {
         assertTrue("failure in thread: " + i, threads[i].ok);
      }
View Full Code Here

Examples of org.jboss.util.threadpool.BasicThreadPool

      // Verify only one thread pool was created.
      Field field = Client.class.getDeclaredField("onewayThreadPool");
      field.setAccessible(true);
      Object pool = field.get(client);
      assertTrue(pool instanceof BasicThreadPool);
      BasicThreadPool basicThreadPool = (BasicThreadPool) pool;
      assertEquals(poolCounter, basicThreadPool.getPoolNumber());
     
      for (int i = 0; i < INVOCATIONS; i++)
      {
         assertTrue("failure in thread: " + i, threads[i].ok);
      }
View Full Code Here

Examples of org.jboss.util.threadpool.BasicThreadPool

      // Verify only one thread pool was created.
      Field field = ServerInvoker.class.getDeclaredField("onewayThreadPool");
      field.setAccessible(true);
      Object pool = field.get(connector.getServerInvoker());
      assertTrue(pool instanceof BasicThreadPool);
      BasicThreadPool basicThreadPool = (BasicThreadPool) pool;
      assertEquals(poolCounter, basicThreadPool.getPoolNumber());
     
      client.disconnect();
      connector.stop();
      log.info(getName() + " PASSES");
   }
View Full Code Here

Examples of org.jboss.util.threadpool.BasicThreadPool

         if(onewayThreadPool == null)
         {
            // if no thread pool class set, then use default BasicThreadPool
            if(onewayThreadPoolClass == null || onewayThreadPoolClass.length() == 0)
            {
               BasicThreadPool pool = new BasicThreadPool("JBossRemoting Server Oneway");
               pool.setMaximumPoolSize(maxNumberThreads);
               if (maxOnewayThreadPoolQueueSize > 0)
                  pool.setMaximumQueueSize(maxOnewayThreadPoolQueueSize);
               pool.setBlockingMode(BlockingMode.RUN);
               onewayThreadPool = pool;
               log.debug(this + " created new thread pool");
            }
            else
            {
View Full Code Here

Examples of org.jboss.util.threadpool.BasicThreadPool

   {
      synchronized (onewayThreadPoolLock)
      {
         if (onewayThreadPool == null)
         {
            BasicThreadPool pool = new BasicThreadPool("JBossRemoting Client Oneway");
            log.debug("created new thread pool: " + pool);
            Object param = configuration.get(MAX_NUM_ONEWAY_THREADS);
            if (param instanceof String)
            {
               try
               {
                  maxNumberThreads = Integer.parseInt((String) param);
               }
               catch (NumberFormatException  e)
               {
                  log.error("maxNumberThreads parameter has invalid format: " + param);
               }
            }
            else if (param != null)
            {
               log.error("maxNumberThreads parameter must be a string in integer format: " + param);
            }

            param = configuration.get(MAX_ONEWAY_THREAD_POOL_QUEUE_SIZE);

            if (param instanceof String)
            {
               try
               {
                  maxOnewayThreadPoolQueueSize = Integer.parseInt((String) param);
               }
               catch (NumberFormatException  e)
               {
                  log.error("maxOnewayThreadPoolQueueSize parameter has invalid format: " + param);
               }
            }
            else if (param != null)
            {
               log.error("maxOnewayThreadPoolQueueSize parameter must be a string in integer format: " + param);
            }

            pool.setMaximumPoolSize(maxNumberThreads);

            if (maxOnewayThreadPoolQueueSize > 0)
            {
               pool.setMaximumQueueSize(maxOnewayThreadPoolQueueSize);
            }
            pool.setBlockingMode(BlockingMode.RUN);
            onewayThreadPool = pool;
         }
      }
      return onewayThreadPool;
   }
View Full Code Here

Examples of org.jboss.util.threadpool.BasicThreadPool

   {
      synchronized (onewayThreadPoolLock)
      {
         if (onewayThreadPool == null)
         {
            BasicThreadPool pool = new BasicThreadPool("JBossRemoting Client Oneway");
            log.debug("created new thread pool: " + pool);
            Object param = configuration.get(MAX_NUM_ONEWAY_THREADS);
            if (param instanceof String)
            {
               try
               {
                  maxNumberThreads = Integer.parseInt((String) param);
               }
               catch (NumberFormatException  e)
               {
                  log.error("maxNumberThreads parameter has invalid format: " + param);
               }
            }
            else if (param != null)
            {
               log.error("maxNumberThreads parameter must be a string in integer format: " + param);
            }

            param = configuration.get(MAX_ONEWAY_THREAD_POOL_QUEUE_SIZE);

            if (param instanceof String)
            {
               try
               {
                  maxOnewayThreadPoolQueueSize = Integer.parseInt((String) param);
               }
               catch (NumberFormatException  e)
               {
                  log.error("maxOnewayThreadPoolQueueSize parameter has invalid format: " + param);
               }
            }
            else if (param != null)
            {
               log.error("maxOnewayThreadPoolQueueSize parameter must be a string in integer format: " + param);
            }

            pool.setMaximumPoolSize(maxNumberThreads);

            if (maxOnewayThreadPoolQueueSize > 0)
            {
               pool.setMaximumQueueSize(maxOnewayThreadPoolQueueSize);
            }
            pool.setBlockingMode(BlockingMode.RUN);
            onewayThreadPool = pool;
         }
      }
      return onewayThreadPool;
   }
View Full Code Here

Examples of org.jboss.util.threadpool.BasicThreadPool

         if(onewayThreadPool == null)
         {
            // if no thread pool class set, then use default BasicThreadPool
            if(onewayThreadPoolClass == null || onewayThreadPoolClass.length() == 0)
            {
               BasicThreadPool pool = new BasicThreadPool("JBossRemoting Server Oneway");
               pool.setMaximumPoolSize(maxNumberThreads);
               if (maxOnewayThreadPoolQueueSize > 0)
                  pool.setMaximumQueueSize(maxOnewayThreadPoolQueueSize);
               pool.setBlockingMode(BlockingMode.RUN);
               onewayThreadPool = pool;
               log.debug(this + " created new thread pool");
            }
            else
            {
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.