Package org.aspectj.weaver

Examples of org.aspectj.weaver.ReferenceTypeDelegate


    JavaClass jc = lookupJavaClass(classPath, name);
    if (jc == null) {
      // Anyone else to ask?
      if (typeDelegateResolvers != null) {
        for (TypeDelegateResolver tdr : typeDelegateResolvers) {
          ReferenceTypeDelegate delegate = tdr.getDelegate(ty);
          if (delegate != null) {
            return delegate;
          }
        }
      }
View Full Code Here


      return null;
    }
    if (!(concreteAspect instanceof ReferenceType)) { // Might be Missing
      return null;
    }
    ReferenceTypeDelegate rtDelegate = ((ReferenceType) concreteAspect).getDelegate();
    if (rtDelegate instanceof BcelObjectType) {
      return (BcelObjectType) rtDelegate;
    } else {
      return null;
    }
View Full Code Here

   */
  @Override
  protected ReferenceTypeDelegate resolveDelegate(ReferenceType ty) {

    // use reflection delegates for all bootstrap types
    ReferenceTypeDelegate bootstrapLoaderDelegate = resolveIfBootstrapDelegate(ty);
    if (bootstrapLoaderDelegate != null) {
      return bootstrapLoaderDelegate;
    }

    return super.resolveDelegate(ty);
View Full Code Here

  /**
   * Helper method to resolve the delegate from the reflection delegate factory.
   */
  private ReferenceTypeDelegate resolveReflectionTypeDelegate(ReferenceType ty, ClassLoader resolutionLoader) {
    ReferenceTypeDelegate res = ReflectionBasedReferenceTypeDelegateFactory.createDelegate(ty, this, resolutionLoader);
    return res;
  }
View Full Code Here

    }
    ResolvedType toResolve = ret;
    if (ret.isParameterizedType() || ret.isGenericType()) {
      toResolve = toResolve.getGenericType();
    }
    ReferenceTypeDelegate rtd = resolveReflectionTypeDelegate((ReferenceType) toResolve, getClassLoader());
    ((ReferenceType) ret).setDelegate(rtd);
    return ret;
  }
View Full Code Here

    return boType.getLazyClassGen().isWoven();
  }

  private boolean aspectIsBroken() {
    if (concreteAspect instanceof ReferenceType) {
      ReferenceTypeDelegate rtDelegate = ((ReferenceType) concreteAspect).getDelegate();
      if (!(rtDelegate instanceof BcelObjectType)) {
        return true;
      }
    }
    return false;
View Full Code Here

    // also add it to the bcel delegate if there is one
    if (sourceType instanceof BinaryTypeBinding) {
      ResolvedType onType = factory.fromEclipse(sourceType);
      ReferenceType rt = (ReferenceType) onType;
      ReferenceTypeDelegate rtd = rt.getDelegate();
      if (rtd instanceof BcelObjectType) {
        rt.addParent(parent);
        // ((BcelObjectType) rtd).addParent(parent);
      }
    }
View Full Code Here

      // If we are in here due to a resetState() call (presumably because of reweavable state processing), the
      // original type delegate will have been set with a version but that version will be missing from
      // the new set of attributes (looks like a bug where the version attribute was not included in the
      // data compressed into the attribute). So rather than 'defaulting' to current, we should use one
      // if it set on the delegate for the type.
      ReferenceTypeDelegate delegate = type.getDelegate();
      if (delegate instanceof BcelObjectType) {
        wvinfo = ((BcelObjectType) delegate).getWeaverVersionAttribute();
        if (wvinfo != null) {
          if (wvinfo.getMajorVersion() != WeaverVersionInfo.WEAVER_VERSION_MAJOR_UNKNOWN) {
            // use this one
View Full Code Here

          // a previous compiler run. In this case I assert the
          // delegate will still be an EclipseSourceType
          // and we can ignore the problem here (the original compile
          // error will be reported again from
          // the eclipse source type) - pr113531
          ReferenceTypeDelegate theDelegate = ((ReferenceType) theType).getDelegate();
          if (theDelegate.getClass().getName().endsWith("EclipseSourceType")) {
            continue;
          }

          throw new BCException("Can't find bcel delegate for " + className + " type=" + theType.getClass());
        }
        weaveAndNotify(classFile, classType, requestor);
        wovenClassNames.add(className);
      }
    }

    CompilationAndWeavingContext.leavingPhase(aspectToken);

    requestor.weavingClasses();
    ContextToken classToken = CompilationAndWeavingContext.enteringPhase(CompilationAndWeavingContext.WEAVING_CLASSES, "");
    // then weave into non-aspects
    for (Iterator<UnwovenClassFile> i = input.getClassFileIterator(); i.hasNext();) {
      UnwovenClassFile classFile = i.next();
      String className = classFile.getClassName();
      ResolvedType theType = world.resolve(className);
      if (!theType.isAspect()) {
        BcelObjectType classType = BcelWorld.getBcelObjectType(theType);
        if (classType == null) {

          // bug 119882 - see above comment for bug 113531
          ReferenceTypeDelegate theDelegate = ((ReferenceType) theType).getDelegate();

          // TODO urgh - put a method on the interface to check this,
          // string compare is hideous
          if (theDelegate.getClass().getName().endsWith("EclipseSourceType")) {
            continue;
          }

          throw new BCException("Can't find bcel delegate for " + className + " type=" + theType.getClass());
        }
View Full Code Here

      // If we are in here due to a resetState() call (presumably because of reweavable state processing), the
      // original type delegate will have been set with a version but that version will be missing from
      // the new set of attributes (looks like a bug where the version attribute was not included in the
      // data compressed into the attribute). So rather than 'defaulting' to current, we should use one
      // if it set on the delegate for the type.
      ReferenceTypeDelegate delegate = type.getDelegate();
      if (delegate instanceof BcelObjectType) {
        wvinfo = ((BcelObjectType) delegate).getWeaverVersionAttribute();
        if (wvinfo != null) {
          if (wvinfo.getMajorVersion() != WeaverVersionInfo.WEAVER_VERSION_MAJOR_UNKNOWN) {
            // use this one
View Full Code Here

TOP

Related Classes of org.aspectj.weaver.ReferenceTypeDelegate

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.