A project that shows caching solution approaches with code generation Lombok and AutoValue
Jacoco/cobertura code coverage, pmd, checkstyle, enforcer, findbugs
org.caching.autovaluecontains example with builder, equals, hashcode, getters, setters example without much flexibilityorg.caching.lombokcontains examples with Lombok features. In IDE plugins for Lombok are needed. Main features: getters, setters, equals, hashcode, builder, lazy getter, sneakyThrows, synchronized, logger code generation.Ehcache2TransactionDaoTesttest for direct usage of ehcache version 2 with springJbossCacheTransactionDaoTesttest with Jboss cache usageJCacheEhCache2TransactionDaoTestjcache standard protocol with Ehcache 2 version as an implementation Use getClass().getClassLoader().getResourceAsStream("filename") instead of full path to file (like: scr/main/resources/filename) which is not a case in jar fileJCacheEhCache3TransactionDaoTestjcache standard protocol with Ehcache 3 version as an implementation with spring (no spring configuration for direct usage of ehcache 3 yet).JCacheHazelcastTransactionDaoTestjcache standard protocol with Hazelcast as an implementationSpringCacheTransactionDaoTesttest for spring simple cache usage Tests show saving to cache / without cache and reading the values. With Cache look ups are quicker. Evict does nothing, cause small data. Clearing cache shows that cache is not hit in this case.GuavaCacheTesttest Guava abilities to cache
mvn clean package
Excluded some auto generated classes from cobertura and coveralls coverage for lombok and autovalue cause they do not support it well
Libraries:
- hazelcast
- ehcache 2
- ehcache 3
- jboss cache
- jcache
- guava
- spring
- lombok
- autovalue
- log4j logging (possibility to configure) via slf4j