org.apache.camel.component
Class ResourceBasedEndpoint
java.lang.Object
org.apache.camel.impl.ServiceSupport
org.apache.camel.impl.DefaultEndpoint
org.apache.camel.impl.ScheduledPollEndpoint
org.apache.camel.impl.DefaultPollingEndpoint
org.apache.camel.impl.ProcessorEndpoint
org.apache.camel.component.ResourceBasedEndpoint
- All Implemented Interfaces:
- org.apache.camel.CamelContextAware, org.apache.camel.Endpoint, org.apache.camel.IsSingleton, org.apache.camel.Service, org.apache.camel.ShutdownableService, org.apache.camel.spi.HasId
public abstract class ResourceBasedEndpoint
- extends org.apache.camel.impl.ProcessorEndpoint
A useful base class for endpoints which depend on a resource
such as things like Velocity or XQuery based components.
- Version:
Field Summary |
protected org.slf4j.Logger |
log
|
Methods inherited from class org.apache.camel.impl.ProcessorEndpoint |
createPollingConsumer, createProcessor, createProducer, getProcessor, isSingleton, onExchange, setProcessor |
Methods inherited from class org.apache.camel.impl.DefaultPollingEndpoint |
createConsumer |
Methods inherited from class org.apache.camel.impl.ScheduledPollEndpoint |
configureConsumer, configureProperties, getConsumerProperties, setConsumerProperties |
Methods inherited from class org.apache.camel.impl.DefaultEndpoint |
createEndpointUri, createExchange, createExchange, createExchange, doStart, doStop, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExchangePattern, getExchangeType, getId, hashCode, isLenientProperties, isSynchronous, setCamelContext, setEndpointUri, setEndpointUriIfNotSpecified, setExchangePattern, setSynchronous, toString |
Methods inherited from class org.apache.camel.impl.ServiceSupport |
addChildService, doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isSuspended, isSuspending, removeChildService, resume, shutdown, start, start, stop, suspend |
Methods inherited from interface org.apache.camel.Service |
start, stop |
log
protected final transient org.slf4j.Logger log
ResourceBasedEndpoint
protected ResourceBasedEndpoint()
ResourceBasedEndpoint
public ResourceBasedEndpoint(String endpointUri,
org.apache.camel.Component component,
String resourceUri,
org.apache.camel.Processor processor)
ResourceBasedEndpoint
protected ResourceBasedEndpoint(String endpointUri,
org.apache.camel.Processor processor,
String resourceUri)
getResource
public org.springframework.core.io.Resource getResource()
getResourceAsInputStream
public InputStream getResourceAsInputStream()
throws IOException
- Gets the resource as an input stream considering the cache flag as well.
If cache is enabled then the resource content is cached in an internal buffer and this content is
returned to avoid loading the resource over and over again.
- Returns:
- the input stream
- Throws:
IOException
- is thrown if error loading the content of the resource to the local cache buffer
getResourceAsInputStreamWithoutCache
protected InputStream getResourceAsInputStreamWithoutCache()
throws IOException
- Throws:
IOException
isContentCache
public boolean isContentCache()
setContentCache
public void setContentCache(boolean contentCache)
- Sets whether to use resource content cache or not - default is false.
- See Also:
getResourceAsInputStream()
getResourceLoader
public org.springframework.core.io.ResourceLoader getResourceLoader()
setResourceLoader
public void setResourceLoader(org.springframework.core.io.ResourceLoader resourceLoader)
getResourceUri
public String getResourceUri()
setResourceUri
public void setResourceUri(String resourceUri)
Apache CAMEL