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

net.anotheria.anoprise.cache.CacheProducerWrapper Maven / Gradle / Ivy

Go to download

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.

There is a newer version: 4.0.0
Show newest version
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