Пример #1
0
 private void init() {
   CommandProcessorProvider.getInstance().setCommandProcessor(new DefaultCommandProcessor());
   Configure config = ConfigUtil.getConfigure(ConfigConstant.CONFIG_KEY_THREAD);
   fastThreadPool =
       new ThreadPoolExecutor(
           config.getInt("fast-thread-pool/corePoolSize", 16),
           config.getInt("fast-thread-pool/maximumPoolSize", 32),
           config.getInt("fast-thread-pool/keepAliveTime", 15),
           TimeUnit.MINUTES,
           new ArrayBlockingQueue<Runnable>(1024));
   slowThreadPool =
       new ThreadPoolExecutor(
           config.getInt("slow-thread-pool/corePoolSize", 16),
           config.getInt("slow-thread-pool/maximumPoolSize", 32),
           config.getInt("slow-thread-pool/keepAliveTime", 15),
           TimeUnit.MINUTES,
           new ArrayBlockingQueue<Runnable>(1024));
   thriftThreadPool =
       new ThreadPoolExecutor(
           config.getInt("thrift-thread-pool/corePoolSize", 16),
           config.getInt("thrift-thread-pool/maximumPoolSize", 32),
           config.getInt("thrift-thread-pool/keepAliveTime", 15),
           TimeUnit.MINUTES,
           new ArrayBlockingQueue<Runnable>(1024));
 }
Пример #2
0
 public CommandProcessor getCommandProcessor() {
   if (!started) {
     throw new java.lang.IllegalStateException("engine has not started.");
   }
   return CommandProcessorProvider.getInstance().getCommandProcessor();
 }