users@jersey.java.net

[Jersey] ResourceConfig lifecycle

From: Louis Crandell <crandell.louis_at_gmail.com>
Date: Tue, 15 Jul 2014 13:07:03 +0200

We are bootstraping our web application configuration by extending a
ResourceConfig.
Is it expected the constructor of this class is invoked for each resource
request or not?
I'm asking this as I register a new AnnotationConfigApplicationContext,
the SpringWebApplicationInitializer, the SpringLifecycleListener and
the SpringComponentProvider and I'm a bit puzzled whether the context is
actually re-used between requests or are we bootstrapping it all the time.
What is the actual behaviour for spring managed beans and contexts?
Can I inject in a ResourceConfig a @Context ApplicationContext? Can this be
a singleton and final (I guess no to final).

Cheers,
Srdan