org.apache.camel.processor
Class ThreadProcessor

java.lang.Object
  extended by org.apache.camel.processor.ThreadProcessor
All Implemented Interfaces:
AsyncProcessor, Processor, Service

public class ThreadProcessor
extends Object
implements AsyncProcessor, Service

A processor that forces async processing of the exchange using a thread pool.

Version:
$Revision: 36321 $

Constructor Summary
ThreadProcessor()
           
 
Method Summary
 int getCoreSize()
           
 ThreadPoolExecutor getExecutor()
           
 long getKeepAliveTime()
           
 int getMaxSize()
           
 String getName()
           
 int getPriority()
           
 long getStackSize()
           
 BlockingQueue<Runnable> getTaskQueue()
           
 ThreadGroup getThreadGroup()
           
 boolean isDaemon()
           
 void process(Exchange exchange)
          Processes the message exchange
 boolean process(Exchange exchange, AsyncCallback callback)
          Processes the message exchange.
 void setCoreSize(int coreSize)
           
 void setDaemon(boolean daemon)
           
 void setExecutor(ThreadPoolExecutor executor)
           
 void setKeepAliveTime(long keepAliveTime)
           
 void setMaxSize(int maxSize)
           
 void setName(String name)
           
 void setPriority(int priority)
           
 void setStackSize(long stackSize)
           
 void setTaskQueue(BlockingQueue<Runnable> taskQueue)
           
 void setThreadGroup(ThreadGroup threadGroup)
           
 void start()
          Starts the service
 void stop()
          Stops the service
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ThreadProcessor

public ThreadProcessor()
Method Detail

process

public void process(Exchange exchange)
             throws Exception
Description copied from interface: Processor
Processes the message exchange

Specified by:
process in interface Processor
Throws:
Exception - if an internal processing error has occurred.

process

public boolean process(Exchange exchange,
                       AsyncCallback callback)
Description copied from interface: AsyncProcessor
Processes the message exchange. Similar to Processor.process(org.apache.camel.Exchange), but the caller supports having the exchange asynchronously processed.

Specified by:
process in interface AsyncProcessor
Parameters:
exchange - the Exchange to process
callback - the AsyncCallback will be invoked when the processing of the exchange is completed. If the exchange is completed synchronously, then the callback is also invoked synchronously. The callback should therefore be careful of starting recursive loop.
Returns:
true if the processing was completed synchronously.

start

public void start()
           throws Exception
Description copied from interface: Service
Starts the service

Specified by:
start in interface Service
Throws:
Exception

stop

public void stop()
          throws Exception
Description copied from interface: Service
Stops the service

Specified by:
stop in interface Service
Throws:
Exception

getStackSize

public long getStackSize()

setStackSize

public void setStackSize(long stackSize)

getThreadGroup

public ThreadGroup getThreadGroup()

setThreadGroup

public void setThreadGroup(ThreadGroup threadGroup)

getPriority

public int getPriority()

setPriority

public void setPriority(int priority)

isDaemon

public boolean isDaemon()

setDaemon

public void setDaemon(boolean daemon)

getName

public String getName()

setName

public void setName(String name)

getKeepAliveTime

public long getKeepAliveTime()

setKeepAliveTime

public void setKeepAliveTime(long keepAliveTime)

getMaxSize

public int getMaxSize()

setMaxSize

public void setMaxSize(int maxSize)

getCoreSize

public int getCoreSize()

setCoreSize

public void setCoreSize(int coreSize)

getTaskQueue

public BlockingQueue<Runnable> getTaskQueue()

setTaskQueue

public void setTaskQueue(BlockingQueue<Runnable> taskQueue)

getExecutor

public ThreadPoolExecutor getExecutor()

setExecutor

public void setExecutor(ThreadPoolExecutor executor)


Copyright © 2008 IONA Open Source Community. All Rights Reserved.