@UriEndpoint(scheme="language") public class LanguageEndpoint extends ResourceEndpoint
log
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
LanguageEndpoint() |
LanguageEndpoint(String endpointUri,
Component component,
Language language,
Expression expression,
String resourceUri) |
Modifier and Type | Method and Description |
---|---|
void |
clearContentCache() |
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() |
String |
getScript() |
boolean |
isCacheScript() |
boolean |
isContentResolvedFromResource() |
boolean |
isSingleton()
Whether this class supports being singleton or not.
|
boolean |
isTransform() |
protected String |
resolveScript(String script)
Resolves the script.
|
void |
setCacheScript(boolean cacheScript)
|
void |
setContentResolvedFromResource(boolean contentResolvedFromResource) |
void |
setExpression(Expression expression) |
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.
|
getResourceAsInputStream, getResourceAsInputStreamWithoutCache, getResourceUri, isContentCache, isContentCacheCleared, loadResource, setContentCache, setResourceUri
createPollingConsumer, createProcessor, getProcessor, onExchange, setProcessor
configurePollingConsumer, configureProperties, configureScheduledPollConsumerProperties
configureConsumer, createEndpointConfiguration, createExchange, createExchange, createExchange, doStart, doStop, equals, getCamelContext, getComponent, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExchangePattern, getId, getPollingConsumerQueueSize, hashCode, isLenientProperties, isPollingConsumerBlockWhenFull, isSynchronous, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toString
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, resume, shutdown, start, stop, suspend
public LanguageEndpoint()
public LanguageEndpoint(String endpointUri, Component component, Language language, Expression expression, String resourceUri)
public Producer createProducer() throws Exception
Endpoint
createProducer
in interface Endpoint
createProducer
in class ProcessorEndpoint
Exception
- can be thrownpublic Consumer createConsumer(Processor processor) throws Exception
Endpoint
createConsumer
in interface Endpoint
createConsumer
in class DefaultPollingEndpoint
processor
- the given processorException
- can be thrownprotected String resolveScript(String script) throws IOException
script
- script or uri for a script to loadIOException
- is thrown if error loading the scriptpublic boolean isSingleton()
IsSingleton
isSingleton
in interface IsSingleton
isSingleton
in class ProcessorEndpoint
protected String createEndpointUri()
DefaultEndpoint
createEndpointUri
in class DefaultEndpoint
public Language getLanguage()
public Expression getExpression()
public void setExpression(Expression expression)
public boolean isTransform()
public void setTransform(boolean transform)
transform
- true to use result as new message body, false to keep the existing message bodypublic void setLanguageName(String languageName)
languageName
- the name of the languagepublic void setScript(String script)
script
- the scriptpublic boolean isContentResolvedFromResource()
public void setContentResolvedFromResource(boolean contentResolvedFromResource)
public boolean isCacheScript()
public void setCacheScript(boolean cacheScript)
public void clearContentCache()
clearContentCache
in interface ManagedResourceEndpointMBean
clearContentCache
in class ResourceEndpoint
Apache Camel