Multithreaded message based application written in Java