[ 
https://issues.apache.org/activemq/browse/SM-855?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_38622
 ] 

Guillaume Nodet commented on SM-855:
------------------------------------

Yeah, this would work.

If we want to use the executor, we need to write something like

{code:lang=java}
ThreadPoolExecutor tp = Executors.newFixedThreadPool(1);
executor = new org.apache.servicemix.executors.impl.ExecutorImpl(tp);
{code}

Maybe this would require creating a 
   Executor createExecutor() 
method in the parent class, so that we can override it with:

{code:lang=java}
Executor createExecutor() {
  if (concurrent) {
    return super.createExecutor();
  } else {
    ThreadPoolExecutor tp = Executors.newFixedThreadPool(1);
    executor = new org.apache.servicemix.executors.impl.ExecutorImpl(tp);
  }
}
{code}

This would allow to ensure that the executor will be properly shutdown / 
initialized
wrt to the component lifecycle.

Or maybe we should move the concurrent property on the parent class, so that 
all.

Also, we will have to report that on the servicemix-file component / 
servicemix-ftp, as you said.

> Non concurrent processing of files in LW FilePoller
> ---------------------------------------------------
>
>                 Key: SM-855
>                 URL: https://issues.apache.org/activemq/browse/SM-855
>             Project: ServiceMix
>          Issue Type: Improvement
>          Components: servicemix-components
>    Affects Versions: 3.1
>            Reporter: Juergen Mayrbaeurl
>             Fix For: 3.1.1, 3.2
>
>         Attachments: FilePoller.diff, FilePoller.diff
>
>
> LW FilePoller component always processes files concurrently. Sometimes it's 
> very important that files get processed in a defined sequence, because the 
> contents is depending on previously processed contents.
> I've extended the LW FilePoller class. It has a 'concurrent' property now 
> (default is true) and properties for sorting the incoming files (Sort by name 
> and last modification date, asc and desc)
> Maybe this functionality should be included in the LW FTP FilePoller and 
> servicemix-file BC, too.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to