Top Description Inners Fields Constructors Methods
org.aspectj.weaver.reflect

public Class ReflectionWorld

extends World
implements IReflectionWorld
Class Inheritance
All Implemented Interfaces
org.aspectj.weaver.reflect.IReflectionWorld
Imports
java.lang.reflect.InvocationTargetException, java.util.Collections, .HashMap, .Map, org.aspectj.bridge.AbortException, .IMessage, .IMessageHandler, org.aspectj.weaver.BCException, .IWeavingSupport, .ReferenceType, .ReferenceTypeDelegate, .ResolvedType, .UnresolvedType, .WeakClassLoaderReference, .World

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..).
Authors
Adrian Colyer, Andy Clement

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
public static class

Field Summary

Modifier and TypeField and Description
private AnnotationFinder
private WeakClassLoaderReference
private Map<String, Class<?>>
private boolean
private static Map<WeakClassLoaderReference, ReflectionWorld>
Inherited from org.aspectj.weaver.World:
bcelRepositoryCachingBOOLEANBYTECHARcreateInjarHierarchyDOUBLEFLOATforDEBUG_bridgingCodeforDEBUG_structuralChangesCodegenerateNewLvtsinfoMessagesEnabledINTLONGoptimizedMatchingRUNTIME_LEVEL_DEFAULTSHORTtimersPerJoinpointtimersPerTypetypeMapVOIDxsetAVOID_FINALxsetBCEL_REPOSITORY_CACHINGxsetBCEL_REPOSITORY_CACHING_DEFAULTxsetCAPTURE_ALL_CONTEXTxsetCOMPLETE_BINARY_TYPESxsetCOMPLETE_BINARY_TYPES_DEFAULTxsetDEBUG_BRIDGINGxsetDEBUG_STRUCTURAL_CHANGES_CODExsetFAST_PACK_METHODSxsetGENERATE_NEW_LVTSxsetGENERATE_STACKMAPSxsetITD_VERSIONxsetITD_VERSION_2NDGENxsetITD_VERSION_DEFAULTxsetITD_VERSION_ORIGINALxsetMINIMAL_MODELxsetOPTIMIZED_MATCHINGxsetOVERWEAVINGxsetPIPELINE_COMPILATIONxsetPIPELINE_COMPILATION_DEFAULTxsetRUN_MINIMAL_MEMORYxsetTARGETING_RUNTIME_1610xsetTIMERS_PER_FASTMATCH_CALLxsetTIMERS_PER_JOINPOINTxsetTRANSIENT_TJP_FIELDSxsetTYPE_DEMOTIONxsetTYPE_DEMOTION_DEBUGxsetTYPE_REFSxsetWEAVE_JAVA_PACKAGESxsetWEAVE_JAVAX_PACKAGES

Constructor Summary

AccessConstructor and Description
private
public
public
public
ReflectionWorld(boolean forceUseOf14Delegates, ClassLoader aClassLoader)

Method Summary

Modifier and TypeMethod and Description
public static void
public AnnotationFinder
public ClassLoader
public static ReflectionWorld
public IWeavingSupport
public boolean
public static AnnotationFinder
public ResolvedType
public static ResolvedType
resolve(World world, Class<?> aClass)

protected ReferenceTypeDelegate
resolveDelegate(ReferenceType ty)

Implements abstract org.aspectj.weaver.World.resolveDelegate.

Find the ReferenceTypeDelegate behind this reference type so that it can fulfill its contract.
public ResolvedType
resolveUsingClass(Class<?>
the class to use as the delegate for the resolved type
clazz
)

Resolve a type using the specified class.

Inherited from org.aspectj.weaver.World:
acceptareAllLintIgnoredareInfoMessagesEnabledareSynchronizationPointcutsInUseclassWriteEventcompareByPrecedencecompareByPrecedenceAndHierarchycompleteBinaryTypecouldIncrementalCompileFollowcreateAdviceMungerdemoteensureAdvancedConfigurationProcessedflushforgetTypeVariablesCurrentlyBeingProcessedgetAspectScopegetCoreTypegetCrosscuttingMembersSetgetCrossReferenceHandlergetDeclareAnnotationOnFieldsgetDeclareAnnotationOnMethodsgetDeclareAnnotationOnTypesgetDeclareParentsgetDeclareSoftgetDeclareTypeEowsgetExclusionMapgetExpendablegetExtraConfigurationgetFixedgetItdVersiongetLintgetMessageHandlergetModelgetPrecedenceIfAnygetRegisteredPointcutHandlersgetTargetAspectjRuntimeLevelgetTypeMapgetTypeVariableLookupScopegetTypeVariablesCurrentlyBeingProcessedhasUnsatisfiedDependencyisAddSerialVerUIDisAspectIncludedisDemotionActiveisExpendableisHasMemberSupportEnabledisIgnoringUnusedDeclaredThrownExceptionisInJava5ModeisInPinpointModeisJoinpointArrayConstructionEnabledisJoinpointSynchronizationEnabledisLocallyDefinedisMinimalModelisOverWeavingisRunMinimalMemoryisRunMinimalMemorySetisTargettingAspectJRuntime12isTargettingRuntime1_6_10isTimingEnabledisTransientTjpFieldsisXlazyTjpisXmlConfiguredisXnoInlinelookupBySignaturelookupOrCreateNameperformExtraConfigurationrecordrecordFastMatchrecordTypeVariablesCurrentlyBeingProcessedregisterPointcutHandlerreportCheckerMatchreportMatchreportTimersresetresolveresolveresolveresolveresolveresolveresolveresolveresolveGenericTypeForresolveToReferenceTypesetAddSerialVerUIDsetAllLintIgnoredsetBehaveInJava5WaysetCrossReferenceHandlersetErrorAndWarningThresholdsetIncrementalCompileCouldFollowsetLintsetMessageHandlersetModelsetOptionalJoinpointssetPinpointModesetSynchronizationPointcutsInUsesetTargetAspectjRuntimeLevelsetTimingsetTypeVariableLookupScopesetXHasMemberSupportEnabledsetXlazyTjpsetXnoInlineshouldFastPackMethodsshouldGenerateStackMapsshouldPipelineCompilationshowMessageuseFinalvalidateType

Field Detail

annotationFinderback to summary
private AnnotationFinder annotationFinder
classLoaderReferenceback to summary
private WeakClassLoaderReference classLoaderReference
inProgressResolutionClassesback to summary
private Map<String, Class<?>> inProgressResolutionClasses
mustUseOneFourDelegatesback to summary
private boolean mustUseOneFourDelegates
rworldsback to summary
private static Map<WeakClassLoaderReference, ReflectionWorld> rworlds

Constructor Detail

ReflectionWorldback to summary
private ReflectionWorld()
ReflectionWorldback to summary
public ReflectionWorld(WeakClassLoaderReference classloaderRef)
ReflectionWorldback to summary
public ReflectionWorld(ClassLoader aClassLoader)
ReflectionWorldback to summary
public ReflectionWorld(boolean forceUseOf14Delegates, ClassLoader aClassLoader)

Method Detail

cleanUpWorldsback to summary
public static void cleanUpWorlds()
getAnnotationFinderback to summary
public AnnotationFinder getAnnotationFinder()

Implements org.aspectj.weaver.reflect.IReflectionWorld.getAnnotationFinder.

getClassLoaderback to summary
public ClassLoader getClassLoader()
getReflectionWorldForback to summary
public static ReflectionWorld getReflectionWorldFor(WeakClassLoaderReference classLoaderReference)
getWeavingSupportback to summary
public IWeavingSupport getWeavingSupport()

Implements abstract org.aspectj.weaver.World.getWeavingSupport.

isLoadtimeWeavingback to summary
public boolean isLoadtimeWeaving()

Implements abstract org.aspectj.weaver.World.isLoadtimeWeaving.

makeAnnotationFinderIfAnyback to summary
public static AnnotationFinder makeAnnotationFinderIfAny(ClassLoader loader, World world)
resolveback to summary
public ResolvedType resolve(Class<T> aClass)

Implements org.aspectj.weaver.reflect.IReflectionWorld.resolve.

resolveback to summary
public static ResolvedType resolve(World world, Class<?> aClass)
resolveDelegateback to summary
protected ReferenceTypeDelegate resolveDelegate(ReferenceType ty)

Implements abstract org.aspectj.weaver.World.resolveDelegate.

Doc from org.aspectj.weaver.World.resolveDelegate.

Find the ReferenceTypeDelegate behind this reference type so that it can fulfill its contract.

resolveUsingClassback to summary
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.

Parameters
clazz:Class<?>

the class to use as the delegate for the resolved type

org.aspectj.weaver.reflect back to summary

private Class ReflectionWorld.ExceptionBasedMessageHandler

extends Object
implements IMessageHandler
Class Inheritance
  • java.lang.Object
  • org.aspectj.weaver.reflect.ReflectionWorld.ExceptionBasedMessageHandler
All Implemented Interfaces
org.aspectj.bridge.IMessageHandler

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public void
dontIgnore(IMessage.Kind kind)

Implements org.aspectj.bridge.IMessageHandler.dontIgnore.

Allow fine grained configuration after initialization.
public boolean
handleMessage(IMessage
the IMessage to handle - never null
message
)

Implements org.aspectj.bridge.IMessageHandler.handleMessage.

Handle message, by reporting and/or throwing an AbortException.
public void
ignore(IMessage.Kind kind)

Implements org.aspectj.bridge.IMessageHandler.ignore.

Allow fine grained configuration after initialization.
public boolean
isIgnoring(IMessage.Kind kind)

Implements org.aspectj.bridge.IMessageHandler.isIgnoring.

Signal clients whether this will ignore messages of a given type.
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

ExceptionBasedMessageHandlerback to summary
private ExceptionBasedMessageHandler()

Method Detail

dontIgnoreback to summary
public void dontIgnore(IMessage.Kind kind)

Implements org.aspectj.bridge.IMessageHandler.dontIgnore.

Doc from org.aspectj.bridge.IMessageHandler.dontIgnore.

Allow fine grained configuration after initialization. Minaly used in LTW. Most of the implementation can have this method be a no-op.

handleMessageback to summary
public boolean handleMessage(IMessage message) throws AbortException

Implements org.aspectj.bridge.IMessageHandler.handleMessage.

Doc from org.aspectj.bridge.IMessageHandler.handleMessage.

Handle message, by reporting and/or throwing an AbortException.

Parameters
message:IMessage

the IMessage to handle - never null

Returns:boolean

true if this message was handled by this handler

Exceptions
AbortException:
depending on handler logic.
ignoreback to summary
public void ignore(IMessage.Kind kind)

Implements org.aspectj.bridge.IMessageHandler.ignore.

Doc from org.aspectj.bridge.IMessageHandler.ignore.

Allow fine grained configuration after initialization.

isIgnoringback to summary
public boolean isIgnoring(IMessage.Kind kind)

Implements org.aspectj.bridge.IMessageHandler.isIgnoring.

Doc from org.aspectj.bridge.IMessageHandler.isIgnoring.

Signal clients whether this will ignore messages of a given type. Clients may use this to avoid constructing or sending certain messages.

Returns:boolean

true if this handler is ignoring all messages of this type

org.aspectj.weaver.reflect back to summary

public Class ReflectionWorld.ReflectionWorldException

extends RuntimeException
Class Inheritance

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.RuntimeException.serialVersionUID.

Constructor Detail

ReflectionWorldExceptionback to summary
public ReflectionWorldException(String message)