@PostConstruct
is your friend.
As long as your class is registered with Jersey, a method annotated with @PostConstruct
will be called after the the class is instantiated and the injections are completed and before any service calls are executed.
This isn't called out specifically in the Jersey docs that I'm aware of but there are some mentions of it on Google. It does make sense since with any injection framework, injections need to occur after object creation and they all use the @PostConstruct
annotation to provide a place to do initialization after injection is complete.