Package org.aspectj.weaver.tools.cache
Schnittstelle CacheKeyResolver
- Alle bekannten Implementierungsklassen:
DefaultCacheKeyResolver
public interface CacheKeyResolver
Interface to allow alternate hashing schemes for weaved and
generated classes. While the DefaultCacheKeyResolver may be
a reasonable naive implementation, the management and invalidation
of the cache may be more usefully accomplished at the Application
or Container level.
The key is not a one-way hash; it must be convertible back to a className and must match the regex for the type of key it is (generated or weaved).
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungcreateClassLoaderScope
(ClassLoader loader, List<String> aspects) Create a unique string for the given classpath and aspect listgeneratedKey
(String className) Create a key for the given className from a class generated by the weaver such that:Return a regex which matches all generated keysReturn a regex which matches all weaved keys;keyToClass
(String key) Convert a key back to a classNameCreate a key for the given class name and byte array from the pre-weaved class such that
-
Methodendetails
-
generatedKey
Create a key for the given className from a class generated by the weaver such that:className == keyToClass(generatedKey(className)) holds and generatedKey(className).matches(getGeneratedRegex()) == true
- Parameter:
className
- class to create a key for- Gibt zurück:
- key for the class, or null if no caching should be performed
-
weavedKey
Create a key for the given class name and byte array from the pre-weaved class such thatclassName == keyToClass(weavedKey(className, various_bytes)) holds and weavedKey(className, various_bytes).matches(getWeavedRegex()) == true
- Parameter:
className
- class to create a key fororiginal_bytes
- bytes of the pre-weaved class- Gibt zurück:
- key for the class, or null if no caching should be performed
-
keyToClass
Convert a key back to a className- Parameter:
key
- cache key- Gibt zurück:
- className
-
createClassLoaderScope
Create a unique string for the given classpath and aspect list- Parameter:
loader
- Classloader for this adapteraspects
- list of aspects; either urls or class names handled by this adapter- Gibt zurück:
- scope, or null, if no caching should be performed for this classloader
-
getGeneratedRegex
String getGeneratedRegex()Return a regex which matches all generated keys- Gibt zurück:
- string regex
-
getWeavedRegex
String getWeavedRegex()Return a regex which matches all weaved keys;- Gibt zurück:
- string regex
-