Package org.jboss.util.threadpool

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 Client Oneway");
            pool.setMaximumPoolSize(maxNumberThreads);
            pool.setBlockingMode(BlockingMode.WAIT);
            onewayThreadPool = pool;
         }
         else
         {
            //first check to see if this is an ObjectName
View Full Code Here


      if(httpThreadPool == null)
      {
         // if no thread pool class set, then use default BasicThreadPool
         if(httpThreadPoolClass == null || httpThreadPoolClass.length() == 0)
         {
            BasicThreadPool basicthreadpool = new BasicThreadPool("JBossRemoting - HTTP Server Invoker");
            basicthreadpool.setBlockingMode(BlockingMode.RUN);
            basicthreadpool.setMaximumPoolSize(maxPoolSize);
            httpThreadPool = basicthreadpool;
         }
         else
         {
            //first check to see if this is an ObjectName
View Full Code Here

            {
               ServerInvokerCallbackHandler sich = (ServerInvokerCallbackHandler) callbackHandler;
               Client callbackClient = sich.getCallbackClient();
               Field field = Client.class.getDeclaredField("onewayThreadPool");
               field.setAccessible(true);
               BasicThreadPool threadPool = (BasicThreadPool) field.get(callbackClient);
               int size = threadPool.getMaximumPoolSize();
               return Integer.toString(size);
            }
            else if (test.equals(GET_QUEUE_SIZE))
            {
               ServerInvokerCallbackHandler sich = (ServerInvokerCallbackHandler) callbackHandler;
               Client callbackClient = sich.getCallbackClient();
               Field field = Client.class.getDeclaredField("onewayThreadPool");
               field.setAccessible(true);
               BasicThreadPool threadPool = (BasicThreadPool) field.get(callbackClient);
               int size = threadPool.getMaximumQueueSize();
               return Integer.toString(size);
            }
            else
            {
               log.error("unrecognized test: " + test);
View Full Code Here

         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

      if(httpThreadPool == null)
      {
         // if no thread pool class set, then use default BasicThreadPool
         if(httpThreadPoolClass == null || httpThreadPoolClass.length() == 0)
         {
            BasicThreadPool basicthreadpool = new BasicThreadPool("JBossRemoting - HTTP Server Invoker");
            basicthreadpool.setBlockingMode(BlockingMode.RUN);
            basicthreadpool.setMaximumPoolSize(maxPoolSize);
            httpThreadPool = basicthreadpool;
         }
         else
         {
            //first check to see if this is an ObjectName
View Full Code Here

         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

      // 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

      // 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

      // 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

         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

Related Classes of org.jboss.util.threadpool.BasicThreadPool

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.