Package org.aspectj.weaver.tools.cache
Class SimpleCache
java.lang.Object
org.aspectj.weaver.tools.cache.SimpleCache
Copyright (c) 2012 Contributors.
All rights reserved.
This program and the accompanying materials are made available
under the terms of the Eclipse Public License v 2.0
which accompanies this distribution and is available at
https://www.eclipse.org/org/documents/epl-2.0/EPL-2.0.txt
Contributors:
Abraham Nevado (lucierna) initial implementation
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
addGeneratedClassesNames
(String parentClassName, byte[] parentBytes, String generatedClassName) Optional
<byte[]> getAndInitialize
(String classname, byte[] bytes, ClassLoader loader, ProtectionDomain protectionDomain) Get bytes for given class from cache.void
-
Field Details
-
IMPL_NAME
- See Also:
-
-
Constructor Details
-
SimpleCache
-
-
Method Details
-
getAndInitialize
public Optional<byte[]> getAndInitialize(String classname, byte[] bytes, ClassLoader loader, ProtectionDomain protectionDomain) Get bytes for given class from cache. If necessary, define and initialise the class first.- Parameters:
classname
- name of class to be retrieved from the cachebytes
- class bytes (used to calculate cache key)loader
- class loaderprotectionDomain
- protection domain- Returns:
null
, if the cache is disabled or if it contains no entry for the given class. AnOptional<byte[]>
value, if the cache knows about the class. The optional will be empty, if the cache entry represents and unwoven class, i.e. its bytes are identical to the original bytes.
-
put
-
addGeneratedClassesNames
-