5 Replies Latest reply on Nov 11, 2005 5:50 AM by thomas.diesler

    Custom parameter in wsdd

    jimwatkins

      I would like to insert a custom parameter into the wsdd file, specifically

      <parameter name="loadOnStartup" value="true"/>


      I'm unclear on how to go about this for a service. I have a Java Service Endpoint implemented using documentliteral, and everything works fine. Artifacts are of course available if they are relevant.

      thanks,
      jim

        • 1. Re: Custom parameter in wsdd
          thomas.diesler

          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.

          • 2. Re: Custom parameter in wsdd
            jimwatkins

            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.


            • 3. Re: Custom parameter in wsdd
              anders.hedstrom

              Have you looked at javax.xml.rpc.server.ServiceLifecycle?

              • 4. Re: Custom parameter in wsdd
                jimwatkins

                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.

                • 5. Re: Custom parameter in wsdd
                  thomas.diesler

                  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