Class DefaultCachingStrategy
java.lang.Object
org.mule.jms.commons.api.connection.caching.DefaultCachingStrategy
- All Implemented Interfaces:
CachingConfiguration,CachingStrategy
@Alias("default-caching")
public class DefaultCachingStrategy
extends Object
implements CachingStrategy, CachingConfiguration
Default implementation of
CachingConfiguration that not only enables caching but also provides default values for all
the configurable parameters- Since:
- 1.0
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanappliesTo(jakarta.jms.ConnectionFactory target) We only wrap connection factories that: - aren't instances of XAConnectionFactory - haven't already been wrapped - aren't already a caching factorybooleanintinthashCode()booleanbooleanvoidsetConsumersCache(boolean consumersCache) voidsetProducersCache(boolean producersCache) voidsetSessionCacheSize(int sessionCacheSize)
-
Constructor Details
-
DefaultCachingStrategy
public DefaultCachingStrategy()
-
-
Method Details
-
getSessionCacheSize
public int getSessionCacheSize()- Specified by:
getSessionCacheSizein interfaceCachingConfiguration- Returns:
- the
sessionCacheSize
-
isProducersCache
public boolean isProducersCache()- Specified by:
isProducersCachein interfaceCachingConfiguration- Returns:
trueifMessageProducers should be cached
-
isConsumersCache
public boolean isConsumersCache()- Specified by:
isConsumersCachein interfaceCachingConfiguration- Returns:
trueifMessageConsumers should be cached
-
appliesTo
public boolean appliesTo(jakarta.jms.ConnectionFactory target) We only wrap connection factories that: - aren't instances of XAConnectionFactory - haven't already been wrapped - aren't already a caching factory- Specified by:
appliesToin interfaceCachingStrategy- Parameters:
target- theConnectionFactorythat will be wrapped using thisCachingConfiguration- Returns:
trueif thetargetfactory can be wrapped in a caching connection factory
-
strategyConfiguration
- Specified by:
strategyConfigurationin interfaceCachingStrategy- Returns:
- the
CachingConfigurationrequired for executing thisCachingStrategyif one is required.
-
equals
-
hashCode
public int hashCode() -
setSessionCacheSize
public void setSessionCacheSize(int sessionCacheSize) -
setProducersCache
public void setProducersCache(boolean producersCache) -
setConsumersCache
public void setConsumersCache(boolean consumersCache)
-