@ManagedResource(description="Managed ResourceEndpoint") public abstract class ResourceEndpoint extends ProcessorEndpoint implements ManagedResourceEndpointMBean
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
log |
shutdown, shuttingdown, started, starting, stopped, stopping, suspended, suspending
Constructor and Description |
---|
ResourceEndpoint() |
ResourceEndpoint(String endpointUri,
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, or a reference to lookup a bean in the Registry to use as 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, createEndpointConfiguration, createEndpointUri, 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, toString
doResume, doShutdown, doSuspend, getStatus, getVersion, isRunAllowed, isStarted, isStarting, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspend
protected final org.slf4j.Logger log
public ResourceEndpoint()
public ResourceEndpoint(String endpointUri, Component component, String resourceUri)
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 ManagedResourceEndpointMBean
@ManagedOperation(description="Clears the cached resource, forcing to re-load the resource on next request") public void clearContentCache()
clearContentCache
in interface ManagedResourceEndpointMBean
public boolean isContentCacheCleared()
@ManagedAttribute(description="Camel context ID") public String getCamelId()
getCamelId
in interface ManagedResourceEndpointMBean
@ManagedAttribute(description="Camel ManagementName") public String getCamelManagementName()
getCamelManagementName
in interface ManagedResourceEndpointMBean
@ManagedAttribute(description="Endpoint service state") public String getState()
getState
in interface ManagedResourceEndpointMBean
public void setContentCache(boolean contentCache)
setContentCache
in interface ManagedResourceEndpointMBean
public String getResourceUri()
public void setResourceUri(String resourceUri)
resourceUri
- the resource pathApache Camel