public class DefaultConsumerCache
extends org.apache.camel.support.service.ServiceSupport
implements org.apache.camel.spi.ConsumerCache
Consumer.| Constructor and Description |
|---|
DefaultConsumerCache(Object source,
org.apache.camel.CamelContext camelContext,
int cacheSize) |
| Modifier and Type | Method and Description |
|---|---|
org.apache.camel.PollingConsumer |
acquirePollingConsumer(org.apache.camel.Endpoint endpoint)
Acquires a pooled PollingConsumer which you must release back again after usage using the
releasePollingConsumer(org.apache.camel.Endpoint, org.apache.camel.PollingConsumer) method. |
void |
cleanUp()
Cleanup the cache (purging stale entries)
|
protected void |
doStart() |
protected void |
doStop() |
org.apache.camel.CamelContext |
getCamelContext() |
int |
getCapacity()
Gets the maximum cache size (capacity).
|
org.apache.camel.spi.EndpointUtilizationStatistics |
getEndpointUtilizationStatistics() |
long |
getEvicted()
Gets the cache evicted statistic
Will return -1 if it cannot determine this if a custom cache was used.
|
long |
getHits()
Gets the cache hits statistic
Will return -1 if it cannot determine this if a custom cache was used.
|
long |
getMisses()
Gets the cache misses statistic
Will return -1 if it cannot determine this if a custom cache was used.
|
Object |
getSource()
Gets the source which uses this cache
|
boolean |
isExtendedStatistics() |
void |
purge()
Purges this cache
|
org.apache.camel.Exchange |
receive(org.apache.camel.Endpoint endpoint) |
org.apache.camel.Exchange |
receive(org.apache.camel.Endpoint endpoint,
long timeout) |
org.apache.camel.Exchange |
receiveNoWait(org.apache.camel.Endpoint endpoint) |
void |
releasePollingConsumer(org.apache.camel.Endpoint endpoint,
org.apache.camel.PollingConsumer pollingConsumer)
Releases an acquired producer back after usage.
|
void |
resetCacheStatistics()
Resets the cache statistics
|
void |
setExtendedStatistics(boolean extendedStatistics)
Whether extended JMX statistics is enabled for
EndpointUtilizationStatistics |
int |
size()
Returns the current size of the cache
|
String |
toString() |
build, doBuild, doInit, doResume, doShutdown, doSuspend, getStatus, init, isBuild, isInit, isNew, isRunAllowed, isShutdown, isStarted, isStarting, isStartingOrStarted, isStopped, isStopping, isStoppingOrStopped, isSuspended, isSuspending, isSuspendingOrSuspended, resume, shutdown, start, stop, suspendpublic DefaultConsumerCache(Object source, org.apache.camel.CamelContext camelContext, int cacheSize)
public boolean isExtendedStatistics()
public void setExtendedStatistics(boolean extendedStatistics)
EndpointUtilizationStatisticspublic void releasePollingConsumer(org.apache.camel.Endpoint endpoint,
org.apache.camel.PollingConsumer pollingConsumer)
releasePollingConsumer in interface org.apache.camel.spi.ConsumerCacheendpoint - the endpointpollingConsumer - the pollingConsumer to releasepublic org.apache.camel.PollingConsumer acquirePollingConsumer(org.apache.camel.Endpoint endpoint)
releasePollingConsumer(org.apache.camel.Endpoint, org.apache.camel.PollingConsumer) method.acquirePollingConsumer in interface org.apache.camel.spi.ConsumerCacheendpoint - the endpointpublic org.apache.camel.Exchange receive(org.apache.camel.Endpoint endpoint)
receive in interface org.apache.camel.spi.ConsumerCachepublic org.apache.camel.Exchange receive(org.apache.camel.Endpoint endpoint,
long timeout)
receive in interface org.apache.camel.spi.ConsumerCachepublic org.apache.camel.Exchange receiveNoWait(org.apache.camel.Endpoint endpoint)
receiveNoWait in interface org.apache.camel.spi.ConsumerCachepublic org.apache.camel.CamelContext getCamelContext()
public Object getSource()
getSource in interface org.apache.camel.spi.ConsumerCachepublic int size()
size in interface org.apache.camel.spi.ConsumerCachepublic int getCapacity()
getCapacity in interface org.apache.camel.spi.ConsumerCachepublic long getHits()
getHits in interface org.apache.camel.spi.ConsumerCachepublic long getMisses()
getMisses in interface org.apache.camel.spi.ConsumerCachepublic long getEvicted()
getEvicted in interface org.apache.camel.spi.ConsumerCachepublic void resetCacheStatistics()
resetCacheStatistics in interface org.apache.camel.spi.ConsumerCachepublic void purge()
purge in interface org.apache.camel.spi.ConsumerCachepublic void cleanUp()
cleanUp in interface org.apache.camel.spi.ConsumerCachepublic org.apache.camel.spi.EndpointUtilizationStatistics getEndpointUtilizationStatistics()
getEndpointUtilizationStatistics in interface org.apache.camel.spi.ConsumerCacheprotected void doStart()
throws Exception
doStart in class org.apache.camel.support.service.ServiceSupportExceptionApache Camel