Class SimpleCache

java.lang.Object
org.aspectj.weaver.tools.cache.SimpleCache

public class SimpleCache extends Object
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 Details

  • Constructor Details

    • SimpleCache

      protected SimpleCache(String folder, boolean enabled)
  • 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 cache
      bytes - class bytes (used to calculate cache key)
      loader - class loader
      protectionDomain - protection domain
      Returns:
      null, if the cache is disabled or if it contains no entry for the given class. An Optional<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

      public void put(String classname, byte[] origbytes, byte[] wovenbytes)
    • addGeneratedClassesNames

      public void addGeneratedClassesNames(String parentClassName, byte[] parentBytes, String generatedClassName)