Show Table of Contents
41.6. Initializing a Handler
Overview
When the runtime creates an instance of a handler, it creates all of the resources the hander needs to process messages. While you can place all of the logic for doing this in the handler's constructor, it may not be the most appropriate place. The handler framework performs a number of optional steps when it instantiates a handler. You can add resource injection and other initialization logic that will be executed during the optional steps.
Tip
You do not have to provide any initialization methods for a handler.
Order of initialization
The Apache CXF runtime initializes a handler in the following manner:
- The handler's constructor is called.
- Any resources that are specified by the
@Resourceannotation are injected. - The method decorated with
@PostConstructannotation, if it is present, is called.NoteMethods decorated with the@PostConstructannotation must have a void return type and have no parameters. - The handler is place in the
Readystate.

Where did the comment section go?
Red Hat's documentation publication system recently went through an upgrade to enable speedier, more mobile-friendly content. We decided to re-evaluate our commenting platform to ensure that it meets your expectations and serves as an optimal feedback mechanism. During this redesign, we invite your input on providing feedback on Red Hat documentation via the discussion platform.