I’m trying to use the restlet.org library to build a RESTful web interface, and I’ve noticed that unlike it’s servlet counterpart, it has no complement to GenericServlet.init().
Short of building another servlet to do my startup logic, is there any built-in way to avoid building my database factories and the like on the first request (and all the commensurate locking I’ll have to do to avoid multiple initializations)?
Are you wanting to run it in a servlet container? If not, the documentation shows you how to run it stand-alone:
You could certainly do the initialization there.
If you want to use the servlet approach, try writing a new servlet and extending theirs. Implement your init method and call the one for the super class.