com.maxifier.mxcache.clean.Cleanable Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of mxcache-runtime Show documentation
Show all versions of mxcache-runtime Show documentation
Constains all classes necessary for launching a MxCache-instrumentated application
/*
* Copyright (c) 2008-2014 Maxifier Ltd. All Rights Reserved.
*/
package com.maxifier.mxcache.clean;
import com.maxifier.mxcache.caches.Cache;
import com.maxifier.mxcache.caches.CleaningNode;
import java.util.List;
/**
* Cleanable - this class usually should not be implemented manually.
* It is generated by mxCache instrumentator for each class that contains @Cached methods.
* Cleanable is used to obtain instances of caches that an instance of class holds. It also allows to obtain
* static caches.
* No matter how many cached methods are there in the class, a single Cleanable is generated for it.
* A single instance of this class is created. It manages all the caches of class.
* It doesn't allow to access superclass or subclass caches, consider getting corresponding Cleanable for it.
*
* @author Andrey Yakoushin ([email protected])
* @author Alexander Kochurov ([email protected])
*/
public interface Cleanable {
void appendStaticCachesTo(List locks);
/**
* @param id id of cache
* @return cache instance
*/
Cache getStaticCache(int id);
void appendInstanceCachesTo(List locks, T t);
/**
* @param t instance of cached class
* @param id id of cache
* @return cache instance
*/
Cache getInstanceCache(T t, int id);
}