Basically I need a data structure to store the temporary chatting messages on the server side. It should be:
bounded: because I don\'t need store too many messa
You could utilize the Apache Commons CircularFifoBuffer. It meets your first and last criteria. To support concurrency, you can wrap the base buffer in it's synchronized version like so:
Buffer fifo = BufferUtils.synchronizedBuffer(new CircularFifoBuffer());
Good luck on the project.