Cocoon
  1. Cocoon
  2. COCOON-2019

Make DefaultRunnableManager custom configurable

    Details

    • Type: Improvement Improvement
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.2
    • Fix Version/s: 2.2
    • Component/s: * Cocoon Core
    • Labels:
      None
    • Urgency:
      Normal
    • Other Info:
      Patch available

      Description

      Introduce data beans for configuration of the DefaultRunnableManager. This will give the chance to add customized configurations without the need of patch the configuration deployed with the jar file.
      The new way of configuration uses a bean-map to get the configurations -> Every bean implementing the interface ''org.apache.cocoon.components.thread.ThreadPoolConfiguration" will be taken as single thread-pool configuration. The two (already existing) configurations "default, daemon" will still be deployed with the jar.

        Activity

        Hide
        Felix Knecht added a comment -
        The patch
        Show
        Felix Knecht added a comment - The patch
        Hide
        Felix Knecht added a comment -
        After some discussions I think also, that Giacomos suggestion is a good
        way to go. So I will change
        https://issues.apache.org/jira/browse/COCOON-2019 to go in this direction.

        <snip />


        > > Giacomo Pati schrieb:
        >> >> I'd suggest instead of only breaking out the configuration of a
        >> >> thread pool, break out the hole thread pool itself into a bean.
        >> >> This would reduce the complexity of the RunnableManager and would
        >> >> make the ThreadPool beans have a little more responsability than
        >> >> just holding config values.
        > >
        Show
        Felix Knecht added a comment - After some discussions I think also, that Giacomos suggestion is a good way to go. So I will change https://issues.apache.org/jira/browse/COCOON-2019 to go in this direction. <snip /> > > Giacomo Pati schrieb: >> >> I'd suggest instead of only breaking out the configuration of a >> >> thread pool, break out the hole thread pool itself into a bean. >> >> This would reduce the complexity of the RunnableManager and would >> >> make the ThreadPool beans have a little more responsability than >> >> just holding config values. > >
        Hide
        Felix Knecht added a comment -
        Refactored ThreadPool. Break out the ThreadPool into a bean. This will
        make it easier to configure custom thread pools for the RunnableManager.
        The RunnableManager will load all thread pools implementing the interface
        'ThreadPool'.

        A new thread pool can be added by defining the custom thread pool to add
        in your spring configuration:

          <!--+
              | My thread pool
              +-->
          <bean name="org.apache.cocoon.components.thread.ThreadPool/myThreadPool" class="org.apache.cocoon.components.thread.DefaultThreadPool" scope="singleton">
            <property name="name" value="myThreadPool"/>
            <property name="poolPriority" value="NORM"/>
            <property name="daemon" value="true"/>
            <property name="queueSize" value="0"/>
            <property name="maxPoolSize" value="-1"/>
            <property name="minPoolSize" value="1"/>
            <property name="keepAliveTime" value="60000"/>
            <property name="blockPolicy" value="ABORT"/>
            <property name="shutdownGraceful" value="false"/>
            <property name="shutdownWaitTimeMs" value="-1"/>
            <property name="factory" ref="defaultThreadFactory"/>
          </bean>

        Show
        Felix Knecht added a comment - Refactored ThreadPool. Break out the ThreadPool into a bean. This will make it easier to configure custom thread pools for the RunnableManager. The RunnableManager will load all thread pools implementing the interface 'ThreadPool'. A new thread pool can be added by defining the custom thread pool to add in your spring configuration:   <!--+       | My thread pool       +-->   <bean name="org.apache.cocoon.components.thread.ThreadPool/myThreadPool" class="org.apache.cocoon.components.thread.DefaultThreadPool" scope="singleton">     <property name="name" value="myThreadPool"/>     <property name="poolPriority" value="NORM"/>     <property name="daemon" value="true"/>     <property name="queueSize" value="0"/>     <property name="maxPoolSize" value="-1"/>     <property name="minPoolSize" value="1"/>     <property name="keepAliveTime" value="60000"/>     <property name="blockPolicy" value="ABORT"/>     <property name="shutdownGraceful" value="false"/>     <property name="shutdownWaitTimeMs" value="-1"/>     <property name="factory" ref="defaultThreadFactory"/>   </bean>

          People

          • Assignee:
            Felix Knecht
            Reporter:
            Felix Knecht
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development