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 Details

    • DefaultCachingStrategy

      public DefaultCachingStrategy()
  • Method Details

    • getSessionCacheSize

      public int getSessionCacheSize()
      Specified by:
      getSessionCacheSize in interface CachingConfiguration
      Returns:
      the sessionCacheSize
    • isProducersCache

      public boolean isProducersCache()
      Specified by:
      isProducersCache in interface CachingConfiguration
      Returns:
      true if MessageProducers should be cached
    • isConsumersCache

      public boolean isConsumersCache()
      Specified by:
      isConsumersCache in interface CachingConfiguration
      Returns:
      true if MessageConsumers 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:
      appliesTo in interface CachingStrategy
      Parameters:
      target - the ConnectionFactory that will be wrapped using this CachingConfiguration
      Returns:
      true if the target factory can be wrapped in a caching connection factory
    • strategyConfiguration

      public Optional<CachingConfiguration> strategyConfiguration()
      Specified by:
      strategyConfiguration in interface CachingStrategy
      Returns:
      the CachingConfiguration required for executing this CachingStrategy if one is required.
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • setSessionCacheSize

      public void setSessionCacheSize(int sessionCacheSize)
    • setProducersCache

      public void setProducersCache(boolean producersCache)
    • setConsumersCache

      public void setConsumersCache(boolean consumersCache)