public synchronized JsMessage [ ] getBatch ( int batchSize , short id ) throws SIResourceException , SIConnectionDroppedException , SIConnectionLostException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getBatch" , "" + batchSize ) ; int size ; synchronized ( queue ) { size = queue . size ( ) ; } if ( size > batchSize ) size = batchSize ; JsMessage [ ] retArray = new JsMessage [ size ] ; for ( int i = 0 ; i < retArray . length ; ++ i ) retArray [ i ] = get ( id ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getBatch" , retArray ) ; return retArray ; }
Gets a batch of several messages from the queue .