@ManagedResource(description="Managed ResourceEndpoint") public abstract class ResourceEndpoint extends ProcessorEndpoint implements org.apache.camel.api.management.mbean.ManagedResourceEndpointMBean
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
log |
Constructor and Description |
---|
ResourceEndpoint() |
ResourceEndpoint(String endpointUri,
org.apache.camel.Component component,
String resourceUri) |
Modifier and Type | Method and Description |
---|---|
void |
clearContentCache() |
String |
getCamelId() |
String |
getCamelManagementName() |
InputStream |
getResourceAsInputStream()
Gets the resource as an input stream considering the cache flag as well.
|
protected InputStream |
getResourceAsInputStreamWithoutCache() |
String |
getResourceUri() |
String |
getState() |
boolean |
isContentCache() |
boolean |
isContentCacheCleared() |
protected InputStream |
loadResource(String uri)
Loads the given resource.
|
void |
setContentCache(boolean contentCache)
Sets whether to use resource content cache or not.
|
void |
setResourceUri(String resourceUri)
Path to the resource.
|
createPollingConsumer, createProcessor, createProducer, getProcessor, isSingleton, onExchange, setProcessor
createConsumer
configurePollingConsumer, 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, setUseFixedDelay
configureConsumer, createAsyncProducer, createEndpointUri, createExchange, createExchange, equals, getCamelContext, getComponent, getConsumerProperties, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isBridgeErrorHandler, isLenientProperties, isPollingConsumerBlockWhenFull, isSynchronous, setBridgeErrorHandler, setCamelContext, setConsumerProperties, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, toString
doInit, doResume, doShutdown, doSuspend, getStatus, init, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
public InputStream getResourceAsInputStream() throws IOException
IOException
- is thrown if error loading the content of the resource to the local cache bufferprotected InputStream getResourceAsInputStreamWithoutCache() throws IOException
IOException
protected InputStream loadResource(String uri) throws IOException
uri
- uri of the resource.IOException
- is thrown if resource is not found or cannot be loaded@ManagedAttribute(description="Whether the resource is cached") public boolean isContentCache()
isContentCache
in interface org.apache.camel.api.management.mbean.ManagedResourceEndpointMBean
@ManagedOperation(description="Clears the cached resource, forcing to re-load the resource on next request") public void clearContentCache()
clearContentCache
in interface org.apache.camel.api.management.mbean.ManagedResourceEndpointMBean
public boolean isContentCacheCleared()
@ManagedAttribute(description="Camel context ID") public String getCamelId()
getCamelId
in interface org.apache.camel.api.management.mbean.ManagedResourceEndpointMBean
@ManagedAttribute(description="Camel ManagementName") public String getCamelManagementName()
getCamelManagementName
in interface org.apache.camel.api.management.mbean.ManagedResourceEndpointMBean
@ManagedAttribute(description="Endpoint service state") public String getState()
getState
in interface org.apache.camel.api.management.mbean.ManagedResourceEndpointMBean
public void setContentCache(boolean contentCache)
setContentCache
in interface org.apache.camel.api.management.mbean.ManagedResourceEndpointMBean
public String getResourceUri()
public void setResourceUri(String resourceUri)
resourceUri
- the resource pathApache Camel