adaptive-caching-framework

Name Message Date
.idea
src
autonomicmanager.iml
pom.xml
README.md

APL Cache

#todo presentation

#todo describe the features

#todo put the image of the architecture

Requirements

If you are using Gradle/Maven, see example below:

Gradle

In your build.gradle:

	allprojects {
		repositories {
			maven { url "https://jitpack.io" }
		}
	}
	
	dependencies {
		compile 'com.github.jhonnymertz:java-wkhtmltopdf-wrapper:1.0.2-RELEASE'
	}
Maven

In your pom.xml:

	<dependencies>
		<dependency>
				<groupId>com.github.jhonnymertz</groupId>
				<artifactId>java-wkhtmltopdf-wrapper</artifactId>
				<version>1.0.2-RELEASE</version>
		</dependency>
	</dependencies>

	<repositories>
		<repository>
				<id>jitpack.io</id>
				<url>https://jitpack.io</url>
		</repository>
	</repositories>

Usage

Create a file adaptivecaching.properties under resources folder

#Cache config
#Redis:
#adaptivecaching.cache.url=localhost
#adaptivecaching.cache.port=6379

#Logging
adaptivecaching.cache.logging=DEBUG
adaptivecaching.monitoring.logging=DEBUG

#Repository config:
##MongoDB:
adaptivecaching.monitoring.db.scheme=cachemonitoring
adaptivecaching.monitoring.db.name=petclinic
adaptivecaching.monitoring.db.port=27017
adaptivecaching.monitoring.db.address=localhost

##Redis:
#adaptivecaching.monitoring.db.scheme=yourdb

#adaptivecaching.monitoring.db.port=27017
#adaptivecaching.monitoring.db.address=localhost

Then, create a configuration class, on the root package of the system:

//working config: mongodb, accumulation
@AdaptiveCaching(cacheProvider = CacheProviderType.EHCACHE, logRepository = RepositoryType.MONGODB,
    modelling = Modelling.ACCUMULATION, analyzerEnabled = false, enabled = true, disableMonitoringAfterAnalysis = true,
    clearMonitoringDataOnStart = true, traceAsync = false, tracerEnabled = true)

//Jhonny: workaround below. a better solution involve filter by serialization methods in aspect to avoid it
@ComponentScan(allowed = "org.springframework.samples.petclinic", denied = "org.springframework.samples.petclinic.model")
public class Configuration {
}

Available annotations

@AdaptiveCaching cacheProvider = CacheProviderType.EHCACHE, logRepository = RepositoryType.MONGODB, modelling = Modelling.ACCUMULATION, analyzerEnabled = false, enabled = true, disableMonitoringAfterAnalysis = true, clearMonitoringDataOnStart = true, traceAsync = false, tracerEnabled = true

@ComponentScan allowed = "org.springframework.samples.petclinic", denied = "org.springframework.samples.petclinic.model"

Customizations

Repository - Repository Caching - CacheManager interface

Snapshots

Snapshots built from the master branch are available through jitpack using version 1.1.0-SNAPSHOT

License

This project is available under MIT Licence.