Added bean lifecycle hooks.