4 Replies Latest reply on Sep 11, 2008 12:15 PM by dmlloyd

    Thread pool deployer?

    dmlloyd

      Is there a deployer (that I can't find) for setting up threadpool-related POJOs?

      I'm picturing something where you define ThreadGroups, ThreadFactories which use the ThreadGroups, and Executors which use the ThreadFactories. I think the "next generation" of services and components will expect things like Executors to be injected from the container so I would hope that there is an easy way to define them similar to this.

        • 1. Re: Thread pool deployer?
          dmlloyd

          Here's some imaginary XML:

          <threading>
           <thread-group name="MyServiceThreads" daemon="false" max-priority="10"/>
          
           <thread-factory name="MyServiceThreadFactory">
           <thread-group name="MyServiceThreads"/>
           <thread-name pattern="%s-%d">
           <param type="thread-group-name"/>
           <param type="thread-number"/>
           </thread-name>
           </thread-factory>
          
           <cached-thread-pool-executor name="MyServiceExecutor">
           <thread-factory name="MyServiceThreadFactory"/>
           </cached-thread-pool-executor>
          </threading>
          


          Or something like that. Then you inject the executor into your POJO the usual way. It's always nice to have the container control all this crap...

          • 2. Re: Thread pool deployer?
            alesj

            Dunno what exactly do you mean? :-)

            I have this in the pipe-line:
            - https://jira.jboss.org/jira/browse/JBMICROCONT-327
            If this is what you want / mean?

            • 3. Re: Thread pool deployer?
              alesj

               

              "david.lloyd@jboss.com" wrote:

              Or something like that. Then you inject the executor into your POJO the usual way. It's always nice to have the container control all this crap...

              Aha, I see.
              But this is just to simplify thread-pool pojos config. ;-)

              Afaik there is no such deployer yet out there.
              Which doesn't mean you can't create one. :-)
              We just need to think of some proper place,
              as varia is considered dead now. ;-)

              • 4. Re: Thread pool deployer?
                dmlloyd

                 

                "alesj" wrote:

                But this is just to simplify thread-pool pojos config. ;-)


                Exactly! :-)

                "alesj" wrote:

                Afaik there is no such deployer yet out there.
                Which doesn't mean you can't create one. :-)
                We just need to think of some proper place,
                as varia is considered dead now. ;-)


                Good riddance to varia. Probably a separate mini-project would be good. Maybe I'll start a jboss-threading project in my sandbox repository, in my copious amounts of free time.