org.apache.camel.model
Class WireTapDefinition<Type extends ProcessorDefinition<Type>>

java.lang.Object
  extended by org.apache.camel.model.OptionalIdentifiedDefinition<Type>
      extended by org.apache.camel.model.ProcessorDefinition<Type>
          extended by org.apache.camel.model.NoOutputDefinition<WireTapDefinition<Type>>
              extended by org.apache.camel.model.WireTapDefinition<Type>
All Implemented Interfaces:
ExecutorServiceAware, Block, ExecutorServiceAwareDefinition<WireTapDefinition<Type>>, NamedNode

public class WireTapDefinition<Type extends ProcessorDefinition<Type>>
extends NoOutputDefinition<WireTapDefinition<Type>>
implements ExecutorServiceAwareDefinition<WireTapDefinition<Type>>

Represents an XML <wireTap/> element


Field Summary
protected  Endpoint endpoint
           
protected  String ref
           
protected  String uri
           
 
Fields inherited from class org.apache.camel.model.ProcessorDefinition
inheritErrorHandler, log
 
Constructor Summary
WireTapDefinition()
           
WireTapDefinition(Endpoint endpoint)
           
WireTapDefinition(String uri)
           
 
Method Summary
 void addOutput(ProcessorDefinition<?> output)
          Adds the given definition as output to this block
 WireTapDefinition<Type> copy()
          Uses a copy of the original exchange
 WireTapDefinition<Type> copy(boolean copy)
          Uses a copy of the original exchange
 Processor createProcessor(RouteContext routeContext)
          Override this in definition class and implement logic to create the processor based on the definition model.
protected  String description()
           
 Type end()
          Ends the current block
 WireTapDefinition<Type> executorService(ExecutorService executorService)
          Uses a custom thread pool
 WireTapDefinition<Type> executorServiceRef(String executorServiceRef)
          Uses a custom thread pool
 Boolean getCopy()
           
 Endpoint getEndpoint()
           
 ExecutorService getExecutorService()
          Gets the executor service
 String getExecutorServiceRef()
          Gets the reference to lookup in the Registry for the executor service to be used.
 List<SetHeaderDefinition> getHeaders()
           
 String getLabel()
          Returns a label to describe this node such as the expression if some kind of expression node
 ExpressionSubElementDefinition getNewExchangeExpression()
           
 Processor getNewExchangeProcessor()
           
 String getNewExchangeProcessorRef()
           
 Processor getOnPrepare()
           
 String getOnPrepareRef()
           
 ExchangePattern getPattern()
           
 String getRef()
           
 String getShortName()
          Returns a short name for this node which can be useful for ID generation or referring to related resources like images
 String getUri()
           
 boolean isCopy()
           
 WireTapDefinition<Type> newExchange(Expression expression)
          Deprecated. will be removed in Camel 3.0 Instead use newExchangeBody(org.apache.camel.Expression)
 WireTapDefinition<Type> newExchange(Processor processor)
          Sends a new Exchange, instead of tapping an existing, using ExchangePattern.InOnly
 WireTapDefinition<Type> newExchangeBody(Expression expression)
          Sends a new Exchange, instead of tapping an existing, using ExchangePattern.InOnly
 WireTapDefinition<Type> newExchangeHeader(String headerName, Expression expression)
          Sets a header on the new Exchange, instead of tapping an existing, using ExchangePattern.InOnly.
 WireTapDefinition<Type> newExchangeRef(String ref)
          Sends a new Exchange, instead of tapping an existing, using ExchangePattern.InOnly
 WireTapDefinition<Type> onPrepare(Processor onPrepare)
          Uses the Processor when preparing the Exchange to be send.
 WireTapDefinition<Type> onPrepareRef(String onPrepareRef)
          Uses the Processor when preparing the Exchange to be send.
 Endpoint resolveEndpoint(RouteContext context)
           
 void setCopy(Boolean copy)
           
 void setEndpoint(Endpoint endpoint)
           
 void setExecutorService(ExecutorService executorService)
          Sets the executor service to be used.
 void setExecutorServiceRef(String executorServiceRef)
          Sets a reference to lookup in the Registry for the executor service to be used.
 void setHeaders(List<SetHeaderDefinition> headers)
           
 void setNewExchangeExpression(Expression expression)
           
 void setNewExchangeExpression(ExpressionSubElementDefinition expression)
           
 void setNewExchangeProcessor(Processor processor)
           
 void setNewExchangeProcessorRef(String ref)
           
 void setOnPrepare(Processor onPrepare)
           
 void setOnPrepareRef(String onPrepareRef)
           
 void setRef(String ref)
           
 void setUri(String uri)
           
 String toString()
           
 
Methods inherited from class org.apache.camel.model.NoOutputDefinition
getOutputs, isOutputSupported
 
Methods inherited from class org.apache.camel.model.ProcessorDefinition
addInterceptStrategies, addInterceptStrategy, addRoutes, aggregate, aggregate, aggregate, aggregate, aop, attribute, bean, bean, bean, bean, beanRef, beanRef, choice, clearOutput, configureChild, convertBodyTo, convertBodyTo, createChannel, createChildProcessor, createCompositeProcessor, createOutputsProcessor, createOutputsProcessor, delay, delay, delay, doTry, dynamicRouter, dynamicRouter, endChoice, endDoTry, endParent, enrich, enrich, enrichRef, filter, filter, filter, filter, getInterceptStrategies, getNodeFactory, getOtherAttributes, getParent, id, idempotentConsumer, idempotentConsumer, idempotentConsumer, inheritErrorHandler, inOnly, inOnly, inOnly, inOnly, inOnly, inOnly, inOut, inOut, inOut, inOut, inOut, inOut, isAbstract, isInheritErrorHandler, loadBalance, loadBalance, log, log, log, log, loop, loop, loop, makeProcessor, markRollbackOnly, markRollbackOnlyLast, marshal, marshal, marshal, marshal, multicast, multicast, multicast, onCompletion, onException, onException, pipeline, pipeline, pipeline, pipeline, placeholder, policy, policy, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrich, pollEnrichRef, preCreateProcessor, process, processRef, recipientList, recipientList, recipientList, recipientList, removeFaultHeader, removeHeader, removeHeaders, removeHeaders, removeProperty, resequence, resequence, resolveKnownConstantFields, resolvePropertyPlaceholders, rollback, rollback, routeId, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, routingSlip, sample, sample, sample, setBody, setBody, setExchangePattern, setFaultBody, setFaultHeader, setHeader, setHeader, setInheritErrorHandler, setNodeFactory, setOtherAttributes, setOutHeader, setOutHeader, setParent, setProperty, setProperty, sort, sort, sort, split, split, split, stop, threads, threads, threads, threads, throttle, throttle, throwException, to, to, to, to, to, to, to, to, to, to, toF, transacted, transacted, transform, transform, unmarshal, unmarshal, unmarshal, unmarshal, validate, validate, validate, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wireTap, wrapChannel, wrapInErrorHandler, wrapProcessor
 
Methods inherited from class org.apache.camel.model.OptionalIdentifiedDefinition
description, getDescription, getDescriptionText, getId, hasCustomIdAssigned, idOrCreate, setDescription, setId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

uri

protected String uri

ref

protected String ref

endpoint

protected Endpoint endpoint
Constructor Detail

WireTapDefinition

public WireTapDefinition()

WireTapDefinition

public WireTapDefinition(String uri)

WireTapDefinition

public WireTapDefinition(Endpoint endpoint)
Method Detail

createProcessor

public Processor createProcessor(RouteContext routeContext)
                          throws Exception
Description copied from class: ProcessorDefinition
Override this in definition class and implement logic to create the processor based on the definition model.

Overrides:
createProcessor in class ProcessorDefinition<WireTapDefinition<Type extends ProcessorDefinition<Type>>>
Throws:
Exception

getPattern

public ExchangePattern getPattern()

toString

public String toString()
Overrides:
toString in class Object

description

protected String description()

getShortName

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

Specified by:
getShortName in interface NamedNode
Overrides:
getShortName in class OptionalIdentifiedDefinition<WireTapDefinition<Type extends ProcessorDefinition<Type>>>
Returns:
defaults to "node" but derived nodes should overload this to provide a unique name

getLabel

public String getLabel()
Description copied from class: ProcessorDefinition
Returns a label to describe this node such as the expression if some kind of expression node

Overrides:
getLabel in class ProcessorDefinition<WireTapDefinition<Type extends ProcessorDefinition<Type>>>

end

public Type end()
Description copied from class: ProcessorDefinition
Ends the current block

Overrides:
end in class ProcessorDefinition<WireTapDefinition<Type extends ProcessorDefinition<Type>>>
Returns:
the builder

addOutput

public void addOutput(ProcessorDefinition<?> output)
Description copied from interface: Block
Adds the given definition as output to this block

Specified by:
addOutput in interface Block
Overrides:
addOutput in class ProcessorDefinition<WireTapDefinition<Type extends ProcessorDefinition<Type>>>
Parameters:
output - the processor definition

resolveEndpoint

public Endpoint resolveEndpoint(RouteContext context)

executorService

public WireTapDefinition<Type> executorService(ExecutorService executorService)
Uses a custom thread pool

Specified by:
executorService in interface ExecutorServiceAwareDefinition<WireTapDefinition<Type extends ProcessorDefinition<Type>>>
Parameters:
executorService - a custom ExecutorService to use as thread pool for sending tapped exchanges
Returns:
the builder

executorServiceRef

public WireTapDefinition<Type> executorServiceRef(String executorServiceRef)
Uses a custom thread pool

Specified by:
executorServiceRef in interface ExecutorServiceAwareDefinition<WireTapDefinition<Type extends ProcessorDefinition<Type>>>
Parameters:
executorServiceRef - reference to lookup a custom ExecutorService to use as thread pool for sending tapped exchanges
Returns:
the builder

copy

public WireTapDefinition<Type> copy()
Uses a copy of the original exchange

Returns:
the builder

copy

public WireTapDefinition<Type> copy(boolean copy)
Uses a copy of the original exchange

Parameters:
copy - if it is true camel will copy the original exchange, if it is false camel will not copy the original exchange
Returns:
the builder

newExchange

@Deprecated
public WireTapDefinition<Type> newExchange(Expression expression)
Deprecated. will be removed in Camel 3.0 Instead use newExchangeBody(org.apache.camel.Expression)


newExchangeBody

public WireTapDefinition<Type> newExchangeBody(Expression expression)
Sends a new Exchange, instead of tapping an existing, using ExchangePattern.InOnly

Parameters:
expression - expression that creates the new body to send
Returns:
the builder
See Also:
newExchangeHeader(String, org.apache.camel.Expression)

newExchangeRef

public WireTapDefinition<Type> newExchangeRef(String ref)
Sends a new Exchange, instead of tapping an existing, using ExchangePattern.InOnly

Parameters:
ref - reference to the Processor to lookup in the Registry to be used for preparing the new exchange to send
Returns:
the builder

newExchange

public WireTapDefinition<Type> newExchange(Processor processor)
Sends a new Exchange, instead of tapping an existing, using ExchangePattern.InOnly

Parameters:
processor - processor preparing the new exchange to send
Returns:
the builder
See Also:
newExchangeHeader(String, org.apache.camel.Expression)

newExchangeHeader

public WireTapDefinition<Type> newExchangeHeader(String headerName,
                                                 Expression expression)
Sets a header on the new Exchange, instead of tapping an existing, using ExchangePattern.InOnly.

Use this together with the newExchange(org.apache.camel.Expression) or newExchange(org.apache.camel.Processor) methods.

Parameters:
headerName - the header name
expression - the expression setting the header value
Returns:
the builder

onPrepare

public WireTapDefinition<Type> onPrepare(Processor onPrepare)
Uses the Processor when preparing the Exchange to be send. This can be used to deep-clone messages that should be send, or any custom logic needed before the exchange is send.

Parameters:
onPrepare - the processor
Returns:
the builder

onPrepareRef

public WireTapDefinition<Type> onPrepareRef(String onPrepareRef)
Uses the Processor when preparing the Exchange to be send. This can be used to deep-clone messages that should be send, or any custom logic needed before the exchange is send.

Parameters:
onPrepareRef - reference to the processor to lookup in the Registry
Returns:
the builder

getUri

public String getUri()

setUri

public void setUri(String uri)

getRef

public String getRef()

setRef

public void setRef(String ref)

getEndpoint

public Endpoint getEndpoint()

setEndpoint

public void setEndpoint(Endpoint endpoint)

getNewExchangeProcessor

public Processor getNewExchangeProcessor()

setNewExchangeProcessor

public void setNewExchangeProcessor(Processor processor)

getNewExchangeProcessorRef

public String getNewExchangeProcessorRef()

setNewExchangeProcessorRef

public void setNewExchangeProcessorRef(String ref)

getNewExchangeExpression

public ExpressionSubElementDefinition getNewExchangeExpression()

setNewExchangeExpression

public void setNewExchangeExpression(ExpressionSubElementDefinition expression)

setNewExchangeExpression

public void setNewExchangeExpression(Expression expression)

getExecutorService

public ExecutorService getExecutorService()
Description copied from interface: ExecutorServiceAware
Gets the executor service

Specified by:
getExecutorService in interface ExecutorServiceAware
Returns:
the executor

setExecutorService

public void setExecutorService(ExecutorService executorService)
Description copied from interface: ExecutorServiceAware
Sets the executor service to be used.

Specified by:
setExecutorService in interface ExecutorServiceAware
Parameters:
executorService - the executor

getExecutorServiceRef

public String getExecutorServiceRef()
Description copied from interface: ExecutorServiceAware
Gets the reference to lookup in the Registry for the executor service to be used.

Specified by:
getExecutorServiceRef in interface ExecutorServiceAware
Returns:
the reference, or null if the executor was set directly

setExecutorServiceRef

public void setExecutorServiceRef(String executorServiceRef)
Description copied from interface: ExecutorServiceAware
Sets a reference to lookup in the Registry for the executor service to be used.

Specified by:
setExecutorServiceRef in interface ExecutorServiceAware
Parameters:
executorServiceRef - reference for the executor

getCopy

public Boolean getCopy()

setCopy

public void setCopy(Boolean copy)

isCopy

public boolean isCopy()

getOnPrepareRef

public String getOnPrepareRef()

setOnPrepareRef

public void setOnPrepareRef(String onPrepareRef)

getOnPrepare

public Processor getOnPrepare()

setOnPrepare

public void setOnPrepare(Processor onPrepare)

getHeaders

public List<SetHeaderDefinition> getHeaders()

setHeaders

public void setHeaders(List<SetHeaderDefinition> headers)


Apache CAMEL