int blockIndex = 0;
synchronized( this ) {
if( contexts_.containsKey(context) ) {
Integer currentBlock = (Integer) contexts_.get(context);
blockIndex = currentBlock.intValue();
}
contexts_.put(context, Integer.valueOf(blockIndex + 1));
}
if( blockIndex >= NUM_BLOCKS_PER_CONTEXT ) {
throw new RemoteException("Block overflow");
}
if( debug ) {
/** IASRI 4660742
System.out.println("Returning block " + blockIndex +
" of size " + BLOCK_SIZE + " for context " +
context);
**/
// START OF IASRI 4660742
if (_logger.isLoggable(Level.FINE)) {
_logger.log(Level.FINE,"Returning block " + blockIndex +
" of size " + BLOCK_SIZE + " for context " + context);
}
// END OF IASRI 4660742
}
return new UniqueValueBlock((blockIndex * BLOCK_SIZE), BLOCK_SIZE);