Hi Steve,
I don't have a complete answer, but....
The behavior is defined in Jetty. It looks like
ServletHolder.setInitOrder(0) is the programmatic way of forcing a servlet
to initialize during startup.
The XML you see below....
/
com.peoplepattern.streams.execution.api.RootResources
/*
...is equivalent to calling...
servletContextHandler.addServlet("
com.peoplepattern.streams.execution.api.RootResources", "/*");
There is a 2nd method on ServletContextHandler that allows you to pass in a
ServletHolder...
addServlet(ServletHolder servlet, java.lang.String pathSpec)
So just taking a stab at it, maybe something like this would work? (I'm no
expert on the jetty.xml files, so I have no idea if this is valid
syntax)....
/
com.peoplepattern.streams.execution.api.RootResources
0
/*
On Thu, Mar 29, 2018 at 12:16 PM, Steve Blackmon
wrote:
> I’m trying to configure Juneau to ensure that initialization of my
> resources occurs as the server comes up.
>
> I’m using @RestHook(INIT) and @RestHook(POST_INIT_CHILD_FIRST) to
> annotate methods which instantiate helper classes, and confirm that
> everything is healthy, respectively.
>
> I’m finding however that those methods are not called until the first
> request comes in.
>
> My RootResources class extends ResourceGroup and has RestHook annotated
> methods. It also defines ~10 sub-resources which have them as well.
>
> I’ve attached my microservice.cfg and jetty.xml files.
>
> Any advice would be greatly appreciated!
>
> Steve
>
>
>