Distributed work in Java