Auto-update mechanism written in java