@UriEndpoint(scheme="language",
title="Language",
syntax="language:languageName:resourceUri",
producerOnly=true,
label="core,script")
public class LanguageEndpoint
extends ResourceEndpoint
logshutdown, 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 |
getResourceUri() |
String |
getScript() |
boolean |
isBinary() |
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 |
setBinary(boolean binary)
Whether the script is binary content or text content.
|
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 |
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, isContentCache, isContentCacheCleared, loadResource, setContentCachecreatePollingConsumer, createProcessor, getProcessor, onExchange, setProcessorconfigurePollingConsumer, configureProperties, configureScheduledPollConsumerProperties, doStart, doStop, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, getDelay, getInitialDelay, getPollStrategy, getRunLoggingLevel, getScheduledExecutorService, getScheduler, getSchedulerProperties, getTimeUnit, initConsumerProperties, isGreedy, isSendEmptyMessageWhenIdle, isStartScheduler, isUseFixedDelay, setBackoffErrorThreshold, setBackoffIdleThreshold, setBackoffMultiplier, setDelay, setGreedy, setInitialDelay, setPollStrategy, setRunLoggingLevel, setScheduledExecutorService, setScheduler, setScheduler, setSchedulerProperties, setSendEmptyMessageWhenIdle, setStartScheduler, setTimeUnit, setUseFixedDelayconfigureConsumer, createEndpointConfiguration, createExchange, createExchange, createExchange, equals, getCamelContext, getComponent, getConsumerProperties, getEndpointConfiguration, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isBridgeErrorHandler, isLenientProperties, isPollingConsumerBlockWhenFull, isSynchronous, setBridgeErrorHandler, setCamelContext, setConsumerProperties, setEndpointConfiguration, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toStringdoResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendpublic LanguageEndpoint()
public LanguageEndpoint(String endpointUri, Component component, Language language, Expression expression, String resourceUri)
public Producer createProducer() throws Exception
EndpointcreateProducer in interface EndpointcreateProducer in class ProcessorEndpointException - can be thrownpublic Consumer createConsumer(Processor processor) throws Exception
EndpointcreateConsumer in interface EndpointcreateConsumer in class DefaultPollingEndpointprocessor - 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()
IsSingletonisSingleton in interface IsSingletonisSingleton in class ProcessorEndpointprotected String createEndpointUri()
DefaultEndpointcreateEndpointUri in class DefaultEndpointpublic 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 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 ResourceEndpointresourceUri - the resource pathpublic String getResourceUri()
getResourceUri in class ResourceEndpointpublic 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 ManagedResourceEndpointMBeanclearContentCache in class ResourceEndpointApache Camel