title: How to create a camel route that references a specific Java method?
body: <p>I want to write a Camel route that reads all xml files in a specific directory, then calls a process Java method of a class that implements Processor to do something and print the result to screen.</p>
  
  <p>For example the Java class is named ScriptProcessor, and it has a process method:</p>
  
  <pre><code>public class ScriptProcessor implements Processor{
  
      final Script script ;
  
  
      public ScriptProcessor(Script script){
          this.script = script;
      }
  
  
      @Override
      public void process(Exchange exchange) throws Exception {
         //do something ...
  
      }
  
  }
  </code></pre>
  
  <p>So, currently I have a camel context with a route like this:</p>
  
  <pre><code>   &lt;camelContext xmlns="http://camel.apache.org/schema/spring"&gt;
        &lt;route&gt;
          &lt;from uri="file:?noop=true"/&gt;
          &lt;to uri="mock:result"/&gt;
        &lt;/route&gt;
      &lt;/camelContext&gt;
  </code></pre>
  
  <p>I suppose that all xml files are in the same directory of the file with the Camel context definition ("from" tag), and I use mock element to specify the destination of route.
  I don't know how call the process method of the ScriptProcessor class inwards that Camel route. It's necessary a "process" tag or something similar?
  Can someone help me?</p>