Java implementation of Slots and Signals