public static < E > BlockingQueue < E > getWaitingLimitedBlockingQueue ( long waitingMillis , int maxQueue ) { return new LinkedBlockingQueue < E > ( maxQueue ) { @ Override public boolean offer ( E e ) { if ( size ( ) >= maxQueue ) { sleep ( waitingMillis ) ; log . warn ( "Wait For {} ms And Blocking !!! - maxQueue = {}" , waitingMillis , maxQueue ) ; } return putInsteadOfOffer ( this , e ) ; } } ; }
Gets waiting limited blocking queue .