Starting new Thread in a servlet?

Discussions

General J2EE: Starting new Thread in a servlet?

  1. Starting new Thread in a servlet? (2 messages)

    Hi,

    I have the following problem:
    In our produtive system we have to send Emails at a particular time. So I've written a class which loops, compares the time and if it's time starts the email sending. But my problem is, how to integrate that class in Websphere 3.0.2. My plan was to instantate the MailClass in the init()-method of an InitializationServlet, but unfortunately that method determines and my MailClass is "gone". Has anybody any suggestions how to implement such a task in an J2EE environment?
    Any help would be appreciated.

    Thanks in advance,

    Michael
  2. We are using a "Generic Server" in WAS 3.5.3. I'm not sure if that existed in 3.0.2 but I think so. The generic server can be started, stopped and kept alive in the same way as your application.

    Regards,

    Fredrik
  3. Hi Fredrik,

    I've found that feature also in WAS 3.0.2.4, but the documentation is a bit weak at that point. Could I use a normal Java class as a "Generic Server", do we need a runnable Java class (e.g. a main), or do we need a Thread ??

    It would be nice if you could help me.

    Thanks in advance,

    Michael

    Any help would be appreciated.