What is the reason for that? AFAIK, the loadOnStartup loads the servlet before the request. Your service endoint impl is no servlet, so this would not have any effect.
Well I expiramented with the servlet tag in the web.xml
<servlet> <servlet-name>PafService</servlet-name> <servlet-class>com.palladium.paf.server.PafServiceProvider</servlet-class> <load-on-startup>1</load-on-startup> </servlet>
but that did nothing, to your point, it's not a servlet. But as part of the WSDD spec I came across the parameter
<parameter name="loadOnStartup" value="true"/>
I thought it might have different behavior.
As you might guess I'm just trying to get my web service to do a bunch of initialization and cache work before the 1st client. I recently came across a note that suggested writing a servlet to perform those tasks since itcould be forced to load on startup. I'm prepared for that, but am wondering what the "best" way is.
Have you looked at javax.xml.rpc.server.ServiceLifecycle?
I did give it a shot (after reading your note). Near as I can tell it doesn't buy me anything that a constructor doesn't already do for me in this situation. It's not called until the container decides to instantiate a service provider, basically upon 1st client request. For tracking number of instanced endpoints or somesuch it would be handy, but I don't think it works for this initialization scenario.
I've gone ahead with the servlet, which seems to work fine for what I need, but I feel I'm missing some aspect of the spec I should be able to take advantage of.
Java service endpoints are (currently) not pooled. In other words, there is a new endpoint impl object for every request.
If you have costly operations that need to be performed (once) in create the create step you would need to use an EJB endpoint impl. i.e a SLSB