net.anotheria.anoprise.cache.CacheProducerWrapper Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of ano-prise Show documentation
Show all versions of ano-prise Show documentation
Collection of utils for different enterprise class projects. Among other stuff contains
Caches, Mocking, DualCrud, MetaFactory and SessionDistributorService. Visit https://opensource.anotheria.net for details.
package net.anotheria.anoprise.cache;
import net.anotheria.moskito.core.producers.IStats;
import net.anotheria.moskito.core.producers.IStatsProducer;
import java.util.ArrayList;
import java.util.List;
/**
* Helper class for cache - moskito integration.
* @author another
*
*/
public class CacheProducerWrapper implements IStatsProducer{
/**
* Wrapped cache.
*/
private Cache,?> cache;
/**
* Producer Id.
*/
private String producerId;
/**
* Producer category.
*/
private String category;
/**
* Producer subsystems.
*/
private String subsystem;
/**
* Cached stats list.
*/
private List stats;
public CacheProducerWrapper(Cache,?> aCache, String aProducerId, String aCategory, String aSubsystem){
producerId = aProducerId;
category = aCategory;
subsystem = aSubsystem;
cache = aCache;
stats = new ArrayList();
stats.add(cache.getCacheStats());
}
@Override
public String getCategory() {
return category;
}
@Override
public String getProducerId() {
return producerId;
}
@Override
public List getStats() {
return stats;
}
@Override
public String getSubsystem() {
return subsystem;
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy