Java - automatically register delegates.