Erik Weber at [EMAIL PROTECTED] wrote:
> Hello all.
>
> I have minimal experience with Tomcat, and didn't see any mention of this in
> looking over the docs.
>
> I am used to developing in WebLogic. WebLogic supports what are called startup
> classes. You register the name of the class in the server's properties file,
> and when the server starts, it instantiates that class with arguments included
> in the properties file.
>
> I have found this is a nice way to start up asynchronous subscribers to a
> messaging queue. Upon instantiation, which again is automatic, the various
> subscribers, in their constructors, simply register themselves as listeners
> with the queue.
>
> I was wondering if Tomcat supports a similar construct as this (startup
> classes). If not, perhaps I could implement my queue subscribers as Servlets,
> but this seems strange, considering mulitple threads should not be running
> through a single subscriber.
>
> Any thoughts or advice on this?
That's what you get when you rely on features specific to a specific Servlet
container... My advice would be to use all your object as is, and have a
servlet overriding the service() method throwing an HTTP error, and so use
the init() and destroy() methods in that servlets to instantiate all your
objects... You can use servlet properties to provide the class names and
mimic the behavior of Weblogic, but then your web application will be
portable to any compliant servlet container.
Oh, and, of course, remember to initialize the servlet at startup :)
Being "the" reference implementation, I wouldn't want to populate Tomcat's
core with unportable features. If it runs under Tomcat, it runs everywhere
:)
Pier