org.apache.camel.component.language
Class LanguageEndpoint

java.lang.Object
  extended by org.apache.camel.impl.DefaultEndpoint
      extended by org.apache.camel.component.language.LanguageEndpoint
All Implemented Interfaces:
CamelContextAware, Endpoint, IsSingleton, Service, HasId

public class LanguageEndpoint
extends DefaultEndpoint

Language endpoint.

Version:
$Revision$

Constructor Summary
LanguageEndpoint()
           
LanguageEndpoint(String endpointUri, Component component, Language language, Expression expression)
           
 
Method Summary
 Consumer createConsumer(Processor processor)
          Creates a new Event Driven Consumer which consumes messages from the endpoint using the given processor
protected  String createEndpointUri()
          A factory method to lazily create the endpointUri if none is specified
 Producer createProducer()
          Creates a new producer which is used send messages into the endpoint
 Expression getExpression()
           
 Language getLanguage()
           
 boolean isSingleton()
          Whether this class supports being singleton or not.
 boolean isTransform()
           
 void setLanguageName(String languageName)
          Sets the name of the language to use
 void setScript(String script)
          Sets the script to execute
 void setTransform(boolean transform)
          Whether or not the result of the script should be used as message body.
 
Methods inherited from class org.apache.camel.impl.DefaultEndpoint
configureProperties, createExchange, createExchange, createExchange, createPollingConsumer, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExchangePattern, getExchangeType, getId, hashCode, isLenientProperties, isSynchronous, sanitizeUri, setCamelContext, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setSynchronous, start, stop, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LanguageEndpoint

public LanguageEndpoint()

LanguageEndpoint

public LanguageEndpoint(String endpointUri,
                        Component component,
                        Language language,
                        Expression expression)
Method Detail

createProducer

public Producer createProducer()
                        throws Exception
Description copied from interface: Endpoint
Creates a new producer which is used send messages into the endpoint

Returns:
a newly created producer
Throws:
Exception - can be thrown

createConsumer

public Consumer createConsumer(Processor processor)
                        throws Exception
Description copied from interface: Endpoint
Creates a new Event Driven Consumer which consumes messages from the endpoint using the given processor

Parameters:
processor - the given processor
Returns:
a newly created consumer
Throws:
Exception - can be thrown

isSingleton

public boolean isSingleton()
Description copied from interface: IsSingleton
Whether this class supports being singleton or not.

Returns:
true to be a single shared instance, false to create new instances.

createEndpointUri

protected String createEndpointUri()
Description copied from class: DefaultEndpoint
A factory method to lazily create the endpointUri if none is specified

Overrides:
createEndpointUri in class DefaultEndpoint

getLanguage

public Language getLanguage()

getExpression

public Expression getExpression()

isTransform

public boolean isTransform()

setTransform

public void setTransform(boolean transform)
Whether or not the result of the script should be used as message body.

This options is default true.

Parameters:
transform - true to use result as new message body, false to keep the existing message body

setLanguageName

public void setLanguageName(String languageName)
Sets the name of the language to use

Parameters:
languageName - the name of the language

setScript

public void setScript(String script)
Sets the script to execute

Parameters:
script - the script


Apache CAMEL