@UriEndpoint(firstVersion="2.5.0",
scheme="language",
title="Language",
syntax="language:languageName:resourceUri",
producerOnly=true,
category={CORE,SCRIPT})
public class LanguageEndpoint
extends org.apache.camel.component.ResourceEndpoint
| Constructor and Description |
|---|
LanguageEndpoint() |
LanguageEndpoint(String endpointUri,
org.apache.camel.Component component,
org.apache.camel.spi.Language language,
org.apache.camel.Expression expression,
String resourceUri) |
| Modifier and Type | Method and Description |
|---|---|
void |
clearContentCache() |
org.apache.camel.Consumer |
createConsumer(org.apache.camel.Processor processor) |
protected String |
createEndpointUri() |
org.apache.camel.Producer |
createProducer() |
protected void |
doInit() |
org.apache.camel.Expression |
getExpression() |
org.apache.camel.spi.Language |
getLanguage() |
String |
getResourceUri() |
String |
getScript() |
boolean |
isBinary() |
boolean |
isCacheScript() |
boolean |
isContentResolvedFromResource() |
boolean |
isTransform() |
protected String |
resolveScript(String script)
Resolves the script.
|
void |
setBinary(boolean binary)
Whether the script is binary content or text content.
|
void |
setCacheScript(boolean cacheScript)
Whether to cache the compiled script and reuse
Notice reusing the script can cause side effects from processing one Camel
Exchange to
the next Exchange. |
void |
setContentResolvedFromResource(boolean contentResolvedFromResource) |
void |
setExpression(org.apache.camel.Expression expression) |
void |
setLanguageName(String languageName)
Sets the name of the language to use
|
void |
setResourceUri(String resourceUri)
Path to the resource, or a reference to lookup a bean in the Registry to use as the resource
|
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.
|
getCamelId, getCamelManagementName, getResourceAsInputStream, getResourceAsInputStreamWithoutCache, getState, isAllowContextMapAll, isContentCache, isContentCacheCleared, loadResource, setAllowContextMapAll, setContentCachecreatePollingConsumer, createProcessor, getProcessor, onExchange, setProcessorconfigureConsumer, configureProperties, configureScheduledPollConsumerProperties, doConfigureConsumer, doStart, doStop, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDefaultDelay, getDelay, getInitialDelay, getPollStrategy, getRepeatCount, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, isGreedy, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRepeatCount, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelayconfigureExchange, configurePollingConsumer, createAsyncProducer, createExchange, createExchange, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isAutowiredEnabled, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isPollingConsumerCopy, isSingleton, setAutowiredEnabled, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerCopy, setPollingConsumerQueueSize, setProperties, toStringbuild, doBuild, doFail, doLifecycleChange, doResume, doShutdown, doSuspend, fail, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendclone, finalize, getClass, notify, notifyAll, wait, wait, waitprotected void doInit()
throws Exception
doInit in class org.apache.camel.support.DefaultEndpointExceptionpublic org.apache.camel.Producer createProducer()
throws Exception
createProducer in interface org.apache.camel.EndpointcreateProducer in class org.apache.camel.support.ProcessorEndpointExceptionpublic org.apache.camel.Consumer createConsumer(org.apache.camel.Processor processor)
throws Exception
createConsumer in interface org.apache.camel.EndpointcreateConsumer in class org.apache.camel.support.DefaultPollingEndpointExceptionprotected String resolveScript(String script) throws IOException
script - script or uri for a script to loadIOException - is thrown if error loading the scriptprotected String createEndpointUri()
createEndpointUri in class org.apache.camel.support.DefaultEndpointpublic org.apache.camel.spi.Language getLanguage()
public org.apache.camel.Expression getExpression()
public void setExpression(org.apache.camel.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 boolean isBinary()
public void setBinary(boolean binary)
binary - true to read the script as binary, instead of text based.public void setLanguageName(String languageName)
languageName - the name of the languagepublic void setResourceUri(String resourceUri)
setResourceUri in class org.apache.camel.component.ResourceEndpointresourceUri - the resource pathpublic String getResourceUri()
getResourceUri in class org.apache.camel.component.ResourceEndpointpublic void setScript(String script)
script - the scriptpublic String getScript()
public boolean isContentResolvedFromResource()
public void setContentResolvedFromResource(boolean contentResolvedFromResource)
public boolean isCacheScript()
public void setCacheScript(boolean cacheScript)
Exchange to
the next Exchange.public void clearContentCache()
clearContentCache in interface org.apache.camel.api.management.mbean.ManagedResourceEndpointMBeanclearContentCache in class org.apache.camel.component.ResourceEndpointApache Camel