1 Reply Latest reply on Jun 18, 2008 6:25 AM by 666705

    Question regarding WorkManager and Work interfaces

    666705
      Hello,

      I have an application which needs to run on weblogic and it spawns threads. I am evaluating if I can use WorkManager and Work interfaces for spawing threads. Let's say I implement a class A that implements the Work interface. Now, "A.run" calls a method in another class say "B.xyz" which makes calls to class "C" which spawns a thread. Now, does C also need to implement "Work" interface ? Or, in this case, it's ok if C extrends Thread directly as C is run in the scope of A which is running in the weblogic workmanager ?

      Thanks in advance!
        • 1. Re: Question regarding WorkManager and Work interfaces
          666705
          Hi Tanyah,
          <p>
          As a thumb rule developed code should not spawn threads in a J2ee container. The workmanager was introduced to address this constraint. The workmanager explicitly consumes certain resources (based on fair share, minimum, maximum threads). The server administrators are aware of this and helps to keep the server manageable.
          </p>
          <p>
          To answer your question, leave the workmanager to generate all threads. Your development should be organized such that you only create 'work' items and pass it on to the workmanager for running.
          </p>
          <p>
          Do let me know your thoughts.
          </p>
          Regards,
          Anand.