Instead of MDB or an external vm you could also use the startup behavior of the product you are working with. JBoss, WLS and WAS ( I can't speak for other products ) provide a mechanism for work whose lifespan is more consistent with that of the application server rather than a bean or servlet. We write one class that is specific to the product that invokes the startup/shutdown behavior that we need.
Pay attention though, the time that the startup / shutdown code is called varies from product to product. WAS calls your start class before anything else happens. WLS calls your class when the server is more or less running. JBoss has the best of both worlds here. It gives you entry points at both times.
don.
-----Original Message-----
From: Justin Couch [mailto:[EMAIL PROTECTED]]
Sent: Thursday, March 07, 2002 1:56 PM
To: [EMAIL PROTECTED]
Subject: Re: JMS
Veguru Viswa Deep wrote:
> I have got one idea, What happens if I implement
> javax.jms.MessageListener interface in one servlet.
> Will this acts as client for JMS. Considering I can communicate my work
> flow from here.
I'm not sure why you would want to have a Servlet implement the JMS
listener. A servlet's role in life is to handle HTTP requests. They only
get invoked when your client application (say a web browser) makes a
request. Having a servlet respond to changes in a JMS message queue
doesn't make sense to me. I could understand if you had the servlet
posting messages to a queue, but reading them back off that queue seems
a bit weird.
What I was suggesting is that on one of your server machines you write a
complete, standalone application. That application would register itself
as a JMS message listener and then process the messages and communicate
with the EJBs as appropriate. This standalone app would have nothing to
do with the other middle teir "applications" like servlets/JSPs.
Basically, something that lives in your startup scripts and gets run
with the standard "java MyJMSBeanHandler" command line. I suggested
putting it on one of the middleware servers, just so that some random
client machine is not overloaded with the processing, and so that a user
doesn't accidently kill it. Servers are wonderful places to hide
applications that you don't want users to see :)
--
Justin Couch http://www.vlc.com.au/~justin/
Java Architect & Bit Twiddler http://www.yumetech.com/
Author, Java 3D FAQ Maintainer http://www.j3d.org/
-------------------------------------------------------------------
"Humanism is dead. Animals think, feel; so do machines now.
Neither man nor woman is the measure of all things. Every organism
processes data according to its domain, its environment; you, with
all your brains, would be useless in a mouse's universe..."
- Greg Bear, Slant
-------------------------------------------------------------------
===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST". For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".
