Klasse ReflectionWorld

java.lang.Object
org.aspectj.weaver.World
org.aspectj.weaver.reflect.ReflectionWorld
Alle implementierten Schnittstellen:
Dump.INode, IReflectionWorld

public class ReflectionWorld extends World implements IReflectionWorld
A ReflectionWorld is used solely for purposes of type resolution based on the runtime classpath (java.lang.reflect). It does not support weaving operations (creation of mungers etc..).
Autor:
Adrian Colyer, Andy Clement
  • Konstruktordetails

    • ReflectionWorld

      public ReflectionWorld(WeakClassLoaderReference classloaderRef)
    • ReflectionWorld

      public ReflectionWorld(ClassLoader aClassLoader)
    • ReflectionWorld

      public ReflectionWorld(boolean forceUseOf14Delegates, ClassLoader aClassLoader)
  • Methodendetails

    • getReflectionWorldFor

      public static ReflectionWorld getReflectionWorldFor(WeakClassLoaderReference classLoaderReference)
    • cleanUpWorlds

      public static void cleanUpWorlds()
    • makeAnnotationFinderIfAny

      public static AnnotationFinder makeAnnotationFinderIfAny(ClassLoader loader, World world)
    • getClassLoader

      public ClassLoader getClassLoader()
    • getAnnotationFinder

      public AnnotationFinder getAnnotationFinder()
      Angegeben von:
      getAnnotationFinder in Schnittstelle IReflectionWorld
    • resolve

      public ResolvedType resolve(Class aClass)
      Angegeben von:
      resolve in Schnittstelle IReflectionWorld
    • resolve

      public static ResolvedType resolve(World world, Class<?> aClass)
    • resolveUsingClass

      public ResolvedType resolveUsingClass(Class<?> clazz)
      Resolve a type using the specified class. Normal resolution in a reflection world uses Class.forName() via the classloader (attached to this world) in order to find a named type then builds a reference type and a reference type delegate based on that. For some classes generated at runtime (e.g. proxy or lambda representation) the forName() call will not work. In those situations we should just use the clazz we have. Should the whole thing switch from using forName() to using the clazz objects? Possibly but that introduces a lot of change and we don't have a lot of test coverage for this scenario (reflection world). What we are doing right now is that this can optionally be used if the regular resolution scheme did not work. Although AspectJ is *not* multi threaded or re-entrant, Spring doesn't always respect that. There might be an issue here if two attempts are made to resolve the same thing at the same time via this method.
      Parameter:
      clazz - the class to use as the delegate for the resolved type
    • resolveDelegate

      protected ReferenceTypeDelegate resolveDelegate(ReferenceType ty)
      Beschreibung aus Klasse kopiert: World
      Find the ReferenceTypeDelegate behind this reference type so that it can fulfill its contract.
      Angegeben von:
      resolveDelegate in Klasse World
    • getWeavingSupport

      public IWeavingSupport getWeavingSupport()
      Angegeben von:
      getWeavingSupport in Klasse World
    • isLoadtimeWeaving

      public boolean isLoadtimeWeaving()
      Angegeben von:
      isLoadtimeWeaving in Klasse World