1 Reply Latest reply on Sep 3, 2002 10:33 AM by adrian.brock

    thread stopping when undeploying

    vguna

      Hi.

      How can I stop a running thread, when undeploying my application?

      The problem is, that undeploying won't remove the thread I created when deploying the application. How can I be notified when the application will be undeployed?

      Now I "solve" the problem with a dirty-workaround: when the application is deployed, it will remove all "old" threads with a specific name. I'm searching for a better solution.

      Thanks for you help.

        • 1. Re: thread stopping when undeploying

          EJBs are not supposed to start new threads,
          directly or otherwise. Only callouts to the container
          should start new threads.

          For MBeans, implement a management operation with the
          action "stop".
          e.g. for standard mbeans
          public void stop()
          {
          //stop threads.
          }

          Regards,
          Adrian