Package org.aspectj.weaver.tools.cache
Klasse DefaultCacheKeyResolver
java.lang.Object
org.aspectj.weaver.tools.cache.DefaultCacheKeyResolver
- Alle implementierten Schnittstellen:
CacheKeyResolver
Naive default class and classloader hashing implementation useful
for some multi-classloader environments.
This implementation creates classloader scopes of the form:
"ExampleClassLoaderName.[crc hash]"
And weaved class keys of the form:
"com.foo.BarClassName.[bytes len][crc].weaved"
And generated class keys of the form:
"com.foo.BarClassName$AjClosure.generated
-
Feldübersicht
-
Konstruktorübersicht
-
Methodenübersicht
Modifizierer und TypMethodeBeschreibungcreateClassLoaderScope
(ClassLoader cl, List<String> aspects) Create a scope from a set of urls and aspect urls.generatedKey
(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) Converts a cache key back to a classNameCreate a key for the given class name and byte array from the pre-weaved class such that
-
Felddetails
-
GENERATED_SUFFIX
- Siehe auch:
-
WEAVED_SUFFIX
- Siehe auch:
-
-
Konstruktordetails
-
DefaultCacheKeyResolver
public DefaultCacheKeyResolver()
-
-
Methodendetails
-
createClassLoaderScope
Create a scope from a set of urls and aspect urls. Creates scope of the form "ExampleClassLoaderName.[md5sum]" or "ExampleClassLoaderName.[crc]"- Angegeben von:
createClassLoaderScope
in SchnittstelleCacheKeyResolver
- Parameter:
cl
- the classloader which uses the cache, can be nullaspects
- the aspects- Gibt zurück:
- a unique string for URLClassloaders, otherwise a non-unique classname
-
getGeneratedRegex
Beschreibung aus Schnittstelle kopiert:CacheKeyResolver
Return a regex which matches all generated keys- Angegeben von:
getGeneratedRegex
in SchnittstelleCacheKeyResolver
- Gibt zurück:
- string regex
-
getWeavedRegex
Beschreibung aus Schnittstelle kopiert:CacheKeyResolver
Return a regex which matches all weaved keys;- Angegeben von:
getWeavedRegex
in SchnittstelleCacheKeyResolver
- Gibt zurück:
- string regex
-
keyToClass
Converts a cache key back to a className- Angegeben von:
keyToClass
in SchnittstelleCacheKeyResolver
- Parameter:
key
- to convert- Gibt zurück:
- className, e.g. "com.foo.Bar"
-
weavedKey
Beschreibung aus Schnittstelle kopiert:CacheKeyResolver
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
- Angegeben von:
weavedKey
in SchnittstelleCacheKeyResolver
- 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
-
generatedKey
Beschreibung aus Schnittstelle kopiert:CacheKeyResolver
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
- Angegeben von:
generatedKey
in SchnittstelleCacheKeyResolver
- Parameter:
className
- class to create a key for- Gibt zurück:
- key for the class, or null if no caching should be performed
-