org.apache.camel.model
Class ThreadDefinition

java.lang.Object
  extended by org.apache.camel.model.OptionalIdentifiedType<Type>
      extended by org.apache.camel.model.ProcessorDefinition<ProcessorDefinition>
          extended by org.apache.camel.model.ThreadDefinition
All Implemented Interfaces:
Block

public class ThreadDefinition
extends ProcessorDefinition<ProcessorDefinition>

Represents an XML <thread/> element

Version:
$Revision: 750806 $

Field Summary
 
Fields inherited from class org.apache.camel.model.OptionalIdentifiedType
nodeCounters
 
Constructor Summary
ThreadDefinition()
           
ThreadDefinition(Executor executor)
           
ThreadDefinition(int coreSize)
           
 
Method Summary
protected  void configureChild(ProcessorDefinition output)
           
 ThreadDefinition coreSize(int coreSize)
          Sets the core size
 Processor createProcessor(RouteContext routeContext)
           
 ThreadDefinition daemon(boolean daemon)
          Sets the deamon option
 ProcessorDefinition errorHandler(ErrorHandlerBuilder errorHandlerBuilder)
          Installs the given error handler builder.
 ThreadDefinition executor(Executor executor)
          Sets the execute to use
 Executor getExecutor()
           
 List<ProcessorDefinition> getOutputs()
           
 String getShortName()
          Returns a short name for this node which can be useful for ID generation or referring to related resources like images
 ThreadDefinition keepAliveTime(long keepAliveTime)
          Sets the keep alive time
 ThreadDefinition maxSize(int maxSize)
          Sets the max pool size
 ThreadDefinition name(String name)
          Sets the thread pool name
 ThreadDefinition priority(int priority)
          Sets the thread pool priority
 void setCoreSize(int coreSize)
           
 void setDaemon(boolean daemon)
           
 void setExecutor(Executor 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)
           
 ThreadDefinition stackSize(long stackSize)
          Sets the thread pool stack size
 ThreadDefinition taskQueue(BlockingQueue<Runnable> taskQueue)
          Sets the task queue
 ThreadDefinition threadGroup(ThreadGroup threadGroup)
          Sets the thread group
 String toString()
           
 
Methods inherited from class org.apache.camel.model.ProcessorDefinition
addInterceptor, addInterceptor, addOutput, addRoutes, aggregate, aggregate, aggregate, aggregate, aggregate, bean, bean, bean, bean, beanRef, beanRef, choice, clearOutput, convertBodyTo, convertBodyTo, createCompositeProcessor, createErrorHandlerBuilder, createOutputsProcessor, createOutputsProcessor, delay, delay, delay, delay, end, enrich, filter, filter, filter, filter, getErrorHandlerBuilder, getErrorHandlerRef, getInheritErrorHandlerFlag, getLabel, getNodeFactory, getParent, handleFault, idempotentConsumer, idempotentConsumer, idempotentConsumer, inheritErrorHandler, inOnly, inOnly, inOnly, inOnly, inOnly, inOnly, inOut, inOut, inOut, inOut, inOut, inOut, intercept, intercept, intercept, intercept, interceptor, interceptors, isInheritErrorHandler, isInheritErrorHandler, loadBalance, loop, loop, loop, makeProcessor, marshal, marshal, marshal, marshal, multicast, multicast, multicast, onException, pipeline, pipeline, pipeline, policies, policy, popBlock, proceed, process, processRef, pushBlock, recipientList, recipientList, removeFaultHeader, removeHeader, removeProperty, resequence, resequence, resequence, resequencer, routingSlip, routingSlip, setBody, setBody, setErrorHandlerBuilder, setErrorHandlerBuilderIfNull, setErrorHandlerRef, setExchangePattern, setFaultBody, setFaultHeader, setHeader, setHeader, setInheritErrorHandlerFlag, setNodeFactory, setOutHeader, setOutHeader, setParent, setProperty, setProperty, sort, sort, sortBody, sortBody, split, split, split, stop, thread, thread, throttle, throwFault, throwFault, to, to, to, to, to, to, to, to, to, to, transform, transform, tryBlock, unmarshal, unmarshal, unmarshal, unmarshal, wireTap, wrapInErrorHandler, wrapProcessor, wrapProcessorInInterceptors
 
Methods inherited from class org.apache.camel.model.OptionalIdentifiedType
createId, description, getDescription, getId, getNodeCounter, idOrCreate, setDescription, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ThreadDefinition

public ThreadDefinition()

ThreadDefinition

public ThreadDefinition(int coreSize)

ThreadDefinition

public ThreadDefinition(Executor executor)
Method Detail

getOutputs

public List<ProcessorDefinition> getOutputs()
Specified by:
getOutputs in class ProcessorDefinition<ProcessorDefinition>

toString

public String toString()
Overrides:
toString in class Object

getShortName

public String getShortName()
Description copied from class: OptionalIdentifiedType
Returns a short name for this node which can be useful for ID generation or referring to related resources like images

Overrides:
getShortName in class OptionalIdentifiedType<ProcessorDefinition>
Returns:
defaults to "node" but derived nodes should overload this to provide a unique name

createProcessor

public Processor createProcessor(RouteContext routeContext)
                          throws Exception
Overrides:
createProcessor in class ProcessorDefinition<ProcessorDefinition>
Throws:
Exception

configureChild

protected void configureChild(ProcessorDefinition output)
Overrides:
configureChild in class ProcessorDefinition<ProcessorDefinition>

errorHandler

public ProcessorDefinition errorHandler(ErrorHandlerBuilder errorHandlerBuilder)
Description copied from class: ProcessorDefinition
Installs the given error handler builder.

Overrides:
errorHandler in class ProcessorDefinition<ProcessorDefinition>
Parameters:
errorHandlerBuilder - the error handler to be used by default for all child routes
Returns:
the current builder with the error handler configured

coreSize

public ThreadDefinition coreSize(int coreSize)
Sets the core size

Parameters:
coreSize - the core size
Returns:
the builder

daemon

public ThreadDefinition daemon(boolean daemon)
Sets the deamon option

Parameters:
daemon - deamon option
Returns:
the builder

keepAliveTime

public ThreadDefinition keepAliveTime(long keepAliveTime)
Sets the keep alive time

Parameters:
keepAliveTime - keep alive time in millis
Returns:
the builder

maxSize

public ThreadDefinition maxSize(int maxSize)
Sets the max pool size

Parameters:
maxSize - the max pool size
Returns:
the builder

name

public ThreadDefinition name(String name)
Sets the thread pool name

Parameters:
name - the name
Returns:
the builder

priority

public ThreadDefinition priority(int priority)
Sets the thread pool priority

Parameters:
priority - the priority
Returns:
the builder

stackSize

public ThreadDefinition stackSize(long stackSize)
Sets the thread pool stack size

Parameters:
stackSize - the stack size
Returns:
the builder

taskQueue

public ThreadDefinition taskQueue(BlockingQueue<Runnable> taskQueue)
Sets the task queue

Parameters:
taskQueue - the task queue
Returns:
the builder

threadGroup

public ThreadDefinition threadGroup(ThreadGroup threadGroup)
Sets the thread group

Parameters:
threadGroup - the thread group
Returns:
the builder

executor

public ThreadDefinition executor(Executor executor)
Sets the execute to use

Parameters:
executor - the executor
Returns:
the builder

setCoreSize

public void setCoreSize(int coreSize)

setDaemon

public void setDaemon(boolean daemon)

setKeepAliveTime

public void setKeepAliveTime(long keepAliveTime)

setMaxSize

public void setMaxSize(int maxSize)

setName

public void setName(String name)

setPriority

public void setPriority(int priority)

setStackSize

public void setStackSize(long stackSize)

setTaskQueue

public void setTaskQueue(BlockingQueue<Runnable> taskQueue)

setThreadGroup

public void setThreadGroup(ThreadGroup threadGroup)

getExecutor

public Executor getExecutor()

setExecutor

public void setExecutor(Executor executor)


Copyright © 2009 Apache Software Foundation. All Rights Reserved.