@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 |
isAllowContextMapAll() |
boolean |
isContentCache() |
boolean |
isContentCacheCleared() |
protected InputStream |
loadResource(String uri)
Loads the given resource.
|
void |
setAllowContextMapAll(boolean allowContextMapAll)
Sets whether the context map should allow access to all details.
|
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, onExchange, setProcessorcreateConsumerconfigureConsumer, configureProperties, configureScheduledPollConsumerProperties, doConfigureConsumer, doStart, doStop, getBackoffErrorThreshold, getBackoffIdleThreshold, getBackoffMultiplier, 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, setUseFixedDelayconfigurePollingConsumer, createAsyncProducer, createEndpointUri, createExchange, createExchange, doInit, equals, getCamelContext, getComponent, getEndpointKey, getEndpointUri, getExceptionHandler, getExchangePattern, getId, getPollingConsumerBlockTimeout, getPollingConsumerQueueSize, hashCode, isBasicPropertyBinding, isBridgeErrorHandler, isLazyStartProducer, isLenientProperties, isPollingConsumerBlockWhenFull, isSingleton, isSynchronous, setBasicPropertyBinding, setBridgeErrorHandler, setCamelContext, setComponent, setEndpointUri, setEndpointUriIfNotSpecified, setExceptionHandler, setExchangePattern, setLazyStartProducer, setPollingConsumerBlockTimeout, setPollingConsumerBlockWhenFull, setPollingConsumerQueueSize, setProperties, setSynchronous, 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, waitpublic InputStream getResourceAsInputStream() throws IOException
IOException - is thrown if error loading the content of the resource to the local cache bufferprotected InputStream getResourceAsInputStreamWithoutCache() throws IOException
IOExceptionprotected 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.ManagedResourceEndpointMBeanpublic boolean isContentCacheCleared()
@ManagedAttribute(description="Whether the context map is limited to only include the message body and headers") public boolean isAllowContextMapAll()
public void setAllowContextMapAll(boolean allowContextMapAll)
@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.ManagedResourceEndpointMBeanpublic void setContentCache(boolean contentCache)
setContentCache in interface org.apache.camel.api.management.mbean.ManagedResourceEndpointMBeanpublic String getResourceUri()
public void setResourceUri(String resourceUri)
resourceUri - the resource pathApache Camel