All Downloads are FREE. Search and download functionalities are using the official Maven repository.

dev.voidframework.cache.module.CacheModule Maven / Gradle / Ivy

package dev.voidframework.cache.module;

import com.google.inject.AbstractModule;
import com.google.inject.matcher.Matchers;
import dev.voidframework.cache.CacheRemove;
import dev.voidframework.cache.CacheResult;
import dev.voidframework.cache.engine.CacheEngine;

/**
 * Cache module.
 */
public final class CacheModule extends AbstractModule {

    @Override
    protected void configure() {

        final CacheInterceptor cacheInterceptorRemove = new CacheInterceptorRemove();
        final CacheInterceptor cacheInterceptorResult = new CacheInterceptorResult();

        requestInjection(cacheInterceptorRemove);
        requestInjection(cacheInterceptorResult);
        bind(CacheEngine.class).toProvider(CacheEngineProvider.class);
        bindInterceptor(Matchers.any(), Matchers.annotatedWith(CacheRemove.class), cacheInterceptorRemove);
        bindInterceptor(Matchers.any(), Matchers.annotatedWith(CacheResult.class), cacheInterceptorResult);
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy