org.aspectj.weaver.bcel
Class BcelWorld

java.lang.Object
  extended by org.aspectj.weaver.World
      extended by org.aspectj.weaver.bcel.BcelWorld
All Implemented Interfaces:
Repository, Dump.INode
Direct Known Subclasses:
LTWWorld

public class BcelWorld
extends World
implements Repository


Nested Class Summary
 
Nested classes/interfaces inherited from class org.aspectj.weaver.World
World.TypeMap
 
Field Summary
protected  Repository delegate
           
 
Fields inherited from class org.aspectj.weaver.World
bcelRepositoryCaching, BOOLEAN, BYTE, CHAR, createInjarHierarchy, DOUBLE, FLOAT, forDEBUG_bridgingCode, forDEBUG_structuralChangesCode, infoMessagesEnabled, INT, LONG, optimizedMatching, SHORT, timersPerJoinpoint, timersPerType, typeMap, VOID, xsetAVOID_FINAL, xsetBCEL_REPOSITORY_CACHING, xsetBCEL_REPOSITORY_CACHING_DEFAULT, xsetCAPTURE_ALL_CONTEXT, xsetCOMPLETE_BINARY_TYPES, xsetCOMPLETE_BINARY_TYPES_DEFAULT, xsetDEBUG_BRIDGING, xsetDEBUG_STRUCTURAL_CHANGES_CODE, xsetFAST_PACK_METHODS, xsetGENERATE_STACKMAPS, xsetITD_VERSION, xsetITD_VERSION_2NDGEN, xsetITD_VERSION_DEFAULT, xsetITD_VERSION_ORIGINAL, xsetMINIMAL_MODEL, xsetOPTIMIZED_MATCHING, xsetOVERWEAVING, xsetPIPELINE_COMPILATION, xsetPIPELINE_COMPILATION_DEFAULT, xsetRUN_MINIMAL_MEMORY, xsetTARGETING_RUNTIME_1610, xsetTIMERS_PER_FASTMATCH_CALL, xsetTIMERS_PER_JOINPOINT, xsetTRANSIENT_TJP_FIELDS, xsetTYPE_DEMOTION, xsetTYPE_DEMOTION_DEBUG, xsetTYPE_REFS, xsetWEAVE_JAVA_PACKAGES, xsetWEAVE_JAVAX_PACKAGES
 
Constructor Summary
BcelWorld()
           
BcelWorld(java.lang.ClassLoader loader, IMessageHandler handler, ICrossReferenceHandler xrefHandler)
          Build a World from a ClassLoader, for LTW support
BcelWorld(ClassPathManager cpm, IMessageHandler handler, ICrossReferenceHandler xrefHandler)
           
BcelWorld(java.util.List classPath, IMessageHandler handler, ICrossReferenceHandler xrefHandler)
           
BcelWorld(java.lang.String cp)
           
 
Method Summary
 void addAspectRequires(java.lang.String name, java.lang.String requiredType)
           
 void addPath(java.lang.String name)
           
 void addScopedAspect(java.lang.String name, java.lang.String scope)
          Add a scoped aspects where the scoping was defined in an aop.xml file and this world is being used in a LTW configuration
 BcelObjectType addSourceObjectType(JavaClass jc, boolean artificial)
           
 BcelObjectType addSourceObjectType(java.lang.String classname, byte[] bytes, boolean artificial)
           
 BcelObjectType addSourceObjectType(java.lang.String classname, JavaClass jc, boolean artificial)
           
 void addTypeDelegateResolver(TypeDelegateResolver typeDelegateResolver)
           
 BcelObjectType buildBcelDelegate(ReferenceType type, JavaClass jc, boolean artificial, boolean exposedToWeaver)
           
 void classWriteEvent(char[][] compoundName)
           
 void clear()
          Clear all entries from cache.
 void demote(ResolvedType type)
          Force demote a type.
 IRelationship.Kind determineRelKind(ShadowMunger munger)
           
 void ensureRepositorySetup()
           
 JavaClass findClass(java.lang.String className)
          Find the class with the name provided, if the class isn't there, return NULL.
static UnresolvedType fromBcel(Type t)
           
 TypePattern getAspectScope(ResolvedType declaringType)
           
static BcelObjectType getBcelObjectType(ResolvedType concreteAspect)
          Retrieve a bcel delegate for an aspect - this will return NULL if the delegate is an EclipseSourceType and not a BcelObjectType - this happens quite often when incrementally compiling.
 Repository getClassLoaderRepositoryFor(ClassLoaderReference loader)
           
 AsmManager getModelAsAsmManager()
           
 World.TypeMap getTypeMap()
           
 IWeavingSupport getWeavingSupport()
           
 org.aspectj.weaver.bcel.BcelWorld.WeavingXmlConfig getXmlConfiguration()
           
 boolean hasUnsatisfiedDependency(ResolvedType aspectType)
          Determine if the named aspect requires a particular type around in order to be useful.
 boolean isAspectIncluded(ResolvedType aspectType)
           
 boolean isLoadtimeWeaving()
           
 boolean isXmlConfigured()
           
 JavaClass loadClass(java.lang.Class clazz)
          Find the JavaClass instance for the given run-time class object
 JavaClass loadClass(java.lang.String className)
          Find the class with the name provided, if the class isn't there, make an attempt to load it.
static Type makeBcelType(UnresolvedType type)
           
static Member makeFieldJoinPointSignature(LazyClassGen cg, FieldInstruction fi)
           
 Member makeJoinPointSignatureForArrayConstruction(LazyClassGen cg, InstructionHandle handle)
           
 Member makeJoinPointSignatureForMethodInvocation(LazyClassGen cg, InvokeInstruction ii)
           
 Member makeJoinPointSignatureForMonitorEnter(LazyClassGen cg, InstructionHandle h)
           
 Member makeJoinPointSignatureForMonitorExit(LazyClassGen cg, InstructionHandle h)
           
 Member makeJoinPointSignatureFromMethod(LazyMethodGen mg, MemberKind kind)
           
 void removeClass(JavaClass clazz)
          Remove class from repository
 void reportCheckerMatch(Checker checker, Shadow shadow)
           
 void reportMatch(ShadowMunger munger, Shadow shadow)
           
 ResolvedType resolve(Type t)
           
protected  ReferenceTypeDelegate resolveDelegate(ReferenceType ty)
          Find the ReferenceTypeDelegate behind this reference type so that it can fulfill its contract.
 void setXmlConfigured(boolean b)
           
 void setXmlFiles(java.util.List<java.io.File> xmlFiles)
          These are aop.xml files that can be used to alter the aspects that actually apply from those passed in - and also their scope of application to other files in the system.
 void storeClass(JavaClass clazz)
          Store the provided class under "clazz.getClassName()"
 void tidyUp()
           
 java.lang.String toString()
           
 void validateType(UnresolvedType type)
          The aim of this method is to make sure a particular type is 'ok'.
protected  void weaveInterTypeDeclarations(ResolvedType onType)
           
 
Methods inherited from class org.aspectj.weaver.World
accept, areAllLintIgnored, areInfoMessagesEnabled, areSynchronizationPointcutsInUse, compareByPrecedence, compareByPrecedenceAndHierarchy, completeBinaryType, couldIncrementalCompileFollow, createAdviceMunger, demote, ensureAdvancedConfigurationProcessed, flush, forgetTypeVariablesCurrentlyBeingProcessed, getCoreType, getCrosscuttingMembersSet, getCrossReferenceHandler, getDeclareAnnotationOnFields, getDeclareAnnotationOnMethods, getDeclareAnnotationOnTypes, getDeclareParents, getDeclareSoft, getDeclareTypeEows, getExclusionMap, getExpendable, getExtraConfiguration, getFixed, getItdVersion, getLint, getMessageHandler, getModel, getPrecedenceIfAny, getRegisteredPointcutHandlers, getTargetAspectjRuntimeLevel, getTypeVariableLookupScope, getTypeVariablesCurrentlyBeingProcessed, isAddSerialVerUID, isDemotionActive, isExpendable, isHasMemberSupportEnabled, isIgnoringUnusedDeclaredThrownException, isInJava5Mode, isInPinpointMode, isJoinpointArrayConstructionEnabled, isJoinpointSynchronizationEnabled, isLocallyDefined, isMinimalModel, isOverWeaving, isRunMinimalMemory, isRunMinimalMemorySet, isTargettingAspectJRuntime12, isTargettingRuntime1_6_10, isTimingEnabled, isTransientTjpFields, isXlazyTjp, isXnoInline, lookupBySignature, lookupOrCreateName, performExtraConfiguration, record, recordFastMatch, recordTypeVariablesCurrentlyBeingProcessed, registerPointcutHandler, reportTimers, reset, resolve, resolve, resolve, resolve, resolve, resolve, resolve, resolve, resolveGenericTypeFor, resolveToReferenceType, setAddSerialVerUID, setAllLintIgnored, setBehaveInJava5Way, setCrossReferenceHandler, setErrorAndWarningThreshold, setIncrementalCompileCouldFollow, setLint, setMessageHandler, setModel, setOptionalJoinpoints, setPinpointMode, setSynchronizationPointcutsInUse, setTargetAspectjRuntimeLevel, setTiming, setTypeVariableLookupScope, setXHasMemberSupportEnabled, setXlazyTjp, setXnoInline, shouldFastPackMethods, shouldGenerateStackMaps, shouldPipelineCompilation, showMessage, useFinal
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

delegate

protected Repository delegate
Constructor Detail

BcelWorld

public BcelWorld()

BcelWorld

public BcelWorld(java.lang.String cp)

BcelWorld

public BcelWorld(java.util.List classPath,
                 IMessageHandler handler,
                 ICrossReferenceHandler xrefHandler)

BcelWorld

public BcelWorld(ClassPathManager cpm,
                 IMessageHandler handler,
                 ICrossReferenceHandler xrefHandler)

BcelWorld

public BcelWorld(java.lang.ClassLoader loader,
                 IMessageHandler handler,
                 ICrossReferenceHandler xrefHandler)
Build a World from a ClassLoader, for LTW support

Parameters:
loader -
handler -
xrefHandler -
Method Detail

determineRelKind

public IRelationship.Kind determineRelKind(ShadowMunger munger)

reportMatch

public void reportMatch(ShadowMunger munger,
                        Shadow shadow)
Overrides:
reportMatch in class World

ensureRepositorySetup

public void ensureRepositorySetup()

getClassLoaderRepositoryFor

public Repository getClassLoaderRepositoryFor(ClassLoaderReference loader)

addPath

public void addPath(java.lang.String name)

makeBcelType

public static Type makeBcelType(UnresolvedType type)

fromBcel

public static UnresolvedType fromBcel(Type t)

resolve

public ResolvedType resolve(Type t)

resolveDelegate

protected ReferenceTypeDelegate resolveDelegate(ReferenceType ty)
Description copied from class: World
Find the ReferenceTypeDelegate behind this reference type so that it can fulfill its contract.

Specified by:
resolveDelegate in class World

buildBcelDelegate

public BcelObjectType buildBcelDelegate(ReferenceType type,
                                        JavaClass jc,
                                        boolean artificial,
                                        boolean exposedToWeaver)

addSourceObjectType

public BcelObjectType addSourceObjectType(JavaClass jc,
                                          boolean artificial)

addSourceObjectType

public BcelObjectType addSourceObjectType(java.lang.String classname,
                                          JavaClass jc,
                                          boolean artificial)

addSourceObjectType

public BcelObjectType addSourceObjectType(java.lang.String classname,
                                          byte[] bytes,
                                          boolean artificial)

makeFieldJoinPointSignature

public static Member makeFieldJoinPointSignature(LazyClassGen cg,
                                                 FieldInstruction fi)

makeJoinPointSignatureFromMethod

public Member makeJoinPointSignatureFromMethod(LazyMethodGen mg,
                                               MemberKind kind)

makeJoinPointSignatureForMonitorEnter

public Member makeJoinPointSignatureForMonitorEnter(LazyClassGen cg,
                                                    InstructionHandle h)

makeJoinPointSignatureForMonitorExit

public Member makeJoinPointSignatureForMonitorExit(LazyClassGen cg,
                                                   InstructionHandle h)

makeJoinPointSignatureForArrayConstruction

public Member makeJoinPointSignatureForArrayConstruction(LazyClassGen cg,
                                                         InstructionHandle handle)

makeJoinPointSignatureForMethodInvocation

public Member makeJoinPointSignatureForMethodInvocation(LazyClassGen cg,
                                                        InvokeInstruction ii)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

getBcelObjectType

public static BcelObjectType getBcelObjectType(ResolvedType concreteAspect)
Retrieve a bcel delegate for an aspect - this will return NULL if the delegate is an EclipseSourceType and not a BcelObjectType - this happens quite often when incrementally compiling.


tidyUp

public void tidyUp()

findClass

public JavaClass findClass(java.lang.String className)
Description copied from interface: Repository
Find the class with the name provided, if the class isn't there, return NULL.

Specified by:
findClass in interface Repository

loadClass

public JavaClass loadClass(java.lang.String className)
                    throws java.lang.ClassNotFoundException
Description copied from interface: Repository
Find the class with the name provided, if the class isn't there, make an attempt to load it.

Specified by:
loadClass in interface Repository
Throws:
java.lang.ClassNotFoundException

storeClass

public void storeClass(JavaClass clazz)
Description copied from interface: Repository
Store the provided class under "clazz.getClassName()"

Specified by:
storeClass in interface Repository

removeClass

public void removeClass(JavaClass clazz)
Description copied from interface: Repository
Remove class from repository

Specified by:
removeClass in interface Repository

loadClass

public JavaClass loadClass(java.lang.Class clazz)
                    throws java.lang.ClassNotFoundException
Description copied from interface: Repository
Find the JavaClass instance for the given run-time class object

Specified by:
loadClass in interface Repository
Throws:
java.lang.ClassNotFoundException

clear

public void clear()
Description copied from interface: Repository
Clear all entries from cache.

Specified by:
clear in interface Repository

validateType

public void validateType(UnresolvedType type)
The aim of this method is to make sure a particular type is 'ok'. Some operations on the delegate for a type modify it and this method is intended to undo that... see pr85132

Overrides:
validateType in class World

weaveInterTypeDeclarations

protected void weaveInterTypeDeclarations(ResolvedType onType)

getWeavingSupport

public IWeavingSupport getWeavingSupport()
Specified by:
getWeavingSupport in class World

reportCheckerMatch

public void reportCheckerMatch(Checker checker,
                               Shadow shadow)
Overrides:
reportCheckerMatch in class World

getModelAsAsmManager

public AsmManager getModelAsAsmManager()

setXmlFiles

public void setXmlFiles(java.util.List<java.io.File> xmlFiles)
These are aop.xml files that can be used to alter the aspects that actually apply from those passed in - and also their scope of application to other files in the system.

Parameters:
xmlFiles - list of File objects representing any aop.xml files passed in to configure the build process

addScopedAspect

public void addScopedAspect(java.lang.String name,
                            java.lang.String scope)
Add a scoped aspects where the scoping was defined in an aop.xml file and this world is being used in a LTW configuration


setXmlConfigured

public void setXmlConfigured(boolean b)

isXmlConfigured

public boolean isXmlConfigured()
Overrides:
isXmlConfigured in class World
Returns:
true if this world has the activation and scope of application of the aspects controlled via aop.xml files

getXmlConfiguration

public org.aspectj.weaver.bcel.BcelWorld.WeavingXmlConfig getXmlConfiguration()

isAspectIncluded

public boolean isAspectIncluded(ResolvedType aspectType)
Overrides:
isAspectIncluded in class World

getAspectScope

public TypePattern getAspectScope(ResolvedType declaringType)
Overrides:
getAspectScope in class World

hasUnsatisfiedDependency

public boolean hasUnsatisfiedDependency(ResolvedType aspectType)
Description copied from class: World
Determine if the named aspect requires a particular type around in order to be useful. The type is named in the aop.xml file against the aspect.

Overrides:
hasUnsatisfiedDependency in class World
Returns:
true if there is a type missing that this aspect really needed around

addAspectRequires

public void addAspectRequires(java.lang.String name,
                              java.lang.String requiredType)

getTypeMap

public World.TypeMap getTypeMap()
Overrides:
getTypeMap in class World

isLoadtimeWeaving

public boolean isLoadtimeWeaving()
Specified by:
isLoadtimeWeaving in class World

addTypeDelegateResolver

public void addTypeDelegateResolver(TypeDelegateResolver typeDelegateResolver)

classWriteEvent

public void classWriteEvent(char[][] compoundName)
Overrides:
classWriteEvent in class World

demote

public void demote(ResolvedType type)
Force demote a type.