private void processInitialization ( ) { ExecutorService executorService = Executors . newFixedThreadPool ( this . maxThread ) ; this . postInitializingMethods . entrySet ( ) . stream ( ) . sorted ( Comparator . comparing ( Map . Entry :: getKey ) ) . forEach ( entry -> { log . debug ( "Found {} beans with max threads {} and order {}" , entry . getValue ( ) . size ( ) , this . maxThread , entry . getKey ( ) ) ; try { executorService . invokeAll ( entry . getValue ( ) ) ; } catch ( InterruptedException e ) { log . warn ( "Failed to invoke {} method(s) on executorService {}" , entry . getValue ( ) . size ( ) , executorService ) ; } } ) ; executorService . shutdown ( ) ; }
Launch the initialization of eligible beans