server io nio channels SelectionKey nio channels Selector nio channels spi SelectorProvider HashSet concurrent ArrayBlockingQueue concurrent BlockingQueue concurrent ExecutorService concurrent Executors concurrent LinkedBlockingQueue concurrent RejectedExecutionException concurrent TimeUnit transport TNonblockingServerTransport transport TNonblockingTransport transport TTransportException slf4j Logger slf4j LoggerFactory tthreadedselectorserver abstractnonblockingserver logger logger loggerfactory.getlogger tthreadedselectorserver.class.getname args abstractnonblockingserverargs args selectorthreads workerthreads stoptimeoutval timeunit stoptimeoutunit timeunit.seconds executorservice executorservice acceptqueuesizeperthread acceptpolicy fair_accept fast_accept acceptpolicy acceptpolicy acceptpolicy.fast_accept args tnonblockingservertransport transport transport args selectorthreads selectorthreads getselectorthreads selectorthreads args workerthreads workerthreads getworkerthreads workerthreads getstoptimeoutval stoptimeoutval args stoptimeoutval stoptimeoutval this.stoptimeoutval stoptimeoutval timeunit getstoptimeoutunit stoptimeoutunit args stoptimeoutunit timeunit stoptimeoutunit this.stoptimeoutunit stoptimeoutunit executorservice getexecutorservice executorservice args executorservice executorservice executorservice this.executorservice executorservice getacceptqueuesizeperthread acceptqueuesizeperthread args acceptqueuesizeperthread acceptqueuesizeperthread this.acceptqueuesizeperthread acceptqueuesizeperthread acceptpolicy getacceptpolicy acceptpolicy args acceptpolicy acceptpolicy acceptpolicy this.acceptpolicy acceptpolicy validate selectorthreads illegalargumentexception workerthreads illegalargumentexception acceptqueuesizeperthread illegalargumentexception stopped_ acceptthread acceptthread selectorthread selectorthreads hashset selectorthread executorservice invoker args tthreadedselectorserver args args.validate invoker args.executorservice createdefaultexecutor args.executorservice override startthreads args.selectorthreads selectorthreads.add selectorthread args.acceptqueuesizeperthread acceptthread acceptthread tnonblockingservertransport servertransport_ createselectorthreadloadbalancer selectorthreads stopped_ selectorthread thread selectorthreads thread.start acceptthread.start logger.error override waitforshutdown jointhreads interruptedexception logger.error gracefullyshutdowninvokerpool jointhreads interruptedexception acceptthread.join selectorthread thread selectorthreads thread.join override stop stopped_ stoplistening acceptthread acceptthread.wakeupselector selectorthreads selectorthread thread selectorthreads thread thread.wakeupselector gracefullyshutdowninvokerpool invoker.shutdown timeoutms args.stoptimeoutunit.tomillis args.stoptimeoutval system.currenttimemillis timeoutms invoker.awaittermination timeoutms timeunit.milliseconds interruptedexception ix newnow system.currenttimemillis timeoutms newnow newnow override requestinvoke framebuffer framebuffer invocation framebuffer invoker invoker.execute invocation rejectedexecutionexception rx logger.warn rx invocation.run framebuffer framebuffer invocation framebuffer executorservice createdefaultexecutor args options options.workerthreads executors.newfixedthreadpool options.workerthreads blockingqueue tnonblockingtransport createdefaultacceptqueue queuesize queuesize linkedblockingqueue tnonblockingtransport arrayblockingqueue tnonblockingtransport queuesize acceptthread tnonblockingservertransport servertransport selector acceptselector selectorthreadloadbalancer threadchooser acceptthread tnonblockingservertransport servertransport selectorthreadloadbalancer threadchooser this.servertransport servertransport this.threadchooser threadchooser this.acceptselector selectorprovider.provider openselector this.servertransport.registerselector acceptselector run stopped_ select logger.error tthreadedselectorserver.this.stop wakeupselector acceptselector.wakeup select acceptselector.select selectionkey selectedkeys acceptselector.selectedkeys iterator stopped_ selectedkeys.hasnext selectionkey key selectedkeys.next selectedkeys.remove key.isvalid key.isacceptable handleaccept logger.warn key.interestops logger.warn handleaccept tnonblockingtransport client doaccept client selectorthread targetthread threadchooser.nextthread args.acceptpolicy args.acceptpolicy.fast_accept invoker doaddaccept targetthread client invoker.submit run doaddaccept targetthread client rejectedexecutionexception rx logger.warn rx client.close tnonblockingtransport doaccept tnonblockingtransport servertransport.accept ttransportexception tte logger.warn tte doaddaccept selectorthread thread tnonblockingtransport client thread.addacceptedconnection client client.close selectorthread abstractselectthread blockingqueue tnonblockingtransport acceptedqueue selectorthread linkedblockingqueue tnonblockingtransport selectorthread maxpendingaccepts createdefaultacceptqueue maxpendingaccepts selectorthread blockingqueue tnonblockingtransport acceptedqueue this.acceptedqueue acceptedqueue addacceptedconnection tnonblockingtransport accepted acceptedqueue.put accepted interruptedexception logger.warn selector.wakeup run stopped_ select processacceptedconnections processinterestchanges selectionkey selectionkey selector.keys cleanupselectionkey selectionkey logger.error tthreadedselectorserver.this.stop select selector.select selectionkey selectedkeys selector.selectedkeys iterator stopped_ selectedkeys.hasnext selectionkey key selectedkeys.next selectedkeys.remove key.isvalid cleanupselectionkey key key.isreadable handleread key key.iswritable handlewrite key logger.warn key.interestops logger.warn processacceptedconnections stopped_ tnonblockingtransport accepted acceptedqueue.poll accepted registeraccepted accepted registeraccepted tnonblockingtransport accepted selectionkey clientkey clientkey accepted.registerselector selector selectionkey.op_read framebuffer framebuffer framebuffer accepted clientkey selectorthread.this clientkey.attach framebuffer logger.warn clientkey cleanupselectionkey clientkey accepted.close selectorthreadloadbalancer createselectorthreadloadbalancer selectorthread threads selectorthreadloadbalancer threads selectorthreadloadbalancer selectorthread threads selectorthread t selectorthread selectorthreadloadbalancer t threads threads.isempty illegalargumentexception this.threads collections.unmodifiablelist t threads this.threads.iterator selectorthread nextthreaditerator.hasnext threads.iterator