org.apache.camel.util
Class AsyncProcessorHelper

java.lang.Object
  extended by org.apache.camel.util.AsyncProcessorHelper

public final class AsyncProcessorHelper
extends Object

Helper methods for AsyncProcessor objects.


Method Summary
static Future<Exchange> asyncProcess(ExecutorService executor, Processor processor, Exchange exchange)
          Deprecated. will be removed in Camel 2.5
static void process(AsyncProcessor processor, Exchange exchange)
          Calls the async version of the processor's process method and waits for it to complete before returning.
static boolean process(AsyncProcessor processor, Exchange exchange, AsyncCallback callback)
          Calls the async version of the processor's process method.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

process

public static boolean process(AsyncProcessor processor,
                              Exchange exchange,
                              AsyncCallback callback)
Calls the async version of the processor's process method.

This implementation supports transacted Exchanges which ensure those are run in a synchronous fashion. See more details at AsyncProcessor.

Parameters:
processor - the processor
exchange - the exchange
callback - the callback
Returns:
true to continue execute synchronously, false to continue being executed asynchronously

process

public static void process(AsyncProcessor processor,
                           Exchange exchange)
                    throws Exception
Calls the async version of the processor's process method and waits for it to complete before returning. This can be used by AsyncProcessor objects to implement their sync version of the process method.

Parameters:
processor - the processor
exchange - the exchange
Throws:
Exception - can be thrown if waiting is interrupted

asyncProcess

@Deprecated
public static Future<Exchange> asyncProcess(ExecutorService executor,
                                                       Processor processor,
                                                       Exchange exchange)
Deprecated. will be removed in Camel 2.5

Processes the exchange async.

Parameters:
executor - executor service
processor - the processor
exchange - the exchange
Returns:
a future handle for the task being executed asynchronously


Copyright © 2007-2010 IONA Open Source Community. All Rights Reserved.