Package org.springframework.aop.framework

Examples of org.springframework.aop.framework.AopConfigException


    super(interceptor);

    FlushingModelSource tempSource = interceptor.getFlushingModelSource();

    if (tempSource == null) {
      throw new AopConfigException("<" + interceptor.getClass().getName()
          + "> has no <" + FlushingModelSource.class.getName() + "> configured");
    }

    flushingModelSource = tempSource;
  }
View Full Code Here


    FlushingAttributeSource tempAttributeSource = cacheInterceptor
        .getFlushingAttributeSource();

    if (tempAttributeSource == null) {
      throw new AopConfigException(
          "Cannot construct a CacheFlushAttributeSourceAdvisor using a "
              + "CacheFlushInterceptor that has no CacheFlushAttributeSource configured");
    }

    cacheFlushAttributeSource = tempAttributeSource;
View Full Code Here

    super(interceptor);

    CachingModelSource tempSource = interceptor.getCachingModelSource();

    if (tempSource == null) {
      throw new AopConfigException("<" + interceptor.getClass().getName()
          + "> has no <" + CachingModelSource.class.getName() + "> configured");
    }

    cachingModelSource = tempSource;
  }
View Full Code Here

    if (proxyInterfaces != null) {
      proxyFactory.setInterfaces(proxyInterfaces);
    } else if (!isProxyTargetClass()) {
      if (target instanceof TargetSource) {
        throw new AopConfigException(
            "Either 'proxyInterfaces' or 'proxyTargetClass' is required "
                + "when using a TargetSource as 'target'");
      }

      // rely on AOP infrastructure to tell us what interfaces to proxy
View Full Code Here

  public CachingAttributeSourceAdvisor(MetadataCachingInterceptor i) {
    super(i);
    CachingAttributeSource source = i.getCachingAttributeSource();
    if (source == null)
      throw new AopConfigException("<" + i.getClass().getName() + "> has no <"
          + CachingAttributeSource.class.getName() + "> configured");
    cachingAttributeSource = source;
  }
View Full Code Here

  public final Object getAspectInstance() {
    try {
      return this.aspectClass.newInstance();
    }
    catch (InstantiationException ex) {
      throw new AopConfigException("Unable to instantiate aspect class [" + this.aspectClass.getName() + "]", ex);
    }
    catch (IllegalAccessException ex) {
      throw new AopConfigException("Cannot access element class [" + this.aspectClass.getName() + "]", ex);
    }
  }
View Full Code Here

      case PERTYPEWITHIN :
        // Works with a type pattern
        this.perClausePointcut = new ComposablePointcut(new TypePatternClassFilter(findPerClause(aspectClass)));
        return;
      default :
        throw new AopConfigException(
            "PerClause " + ajType.getPerClause().getKind() + " not supported by Spring AOP for " + aspectClass);
    }
  }
View Full Code Here

        instance = aspectClass.newInstance();
        aspectCache.put(aspectClass, instance);
        return instance;
      }
      catch (InstantiationException ex) {
        throw new AopConfigException("Unable to instantiate aspect class [" + aspectClass.getName() + "]", ex);
      }
      catch (IllegalAccessException ex) {
        throw new AopConfigException("Cannot access aspect class [" + aspectClass.getName() + "]", ex);
      }
    }
  }
View Full Code Here

  public void validate(Class<?> aspectClass) throws AopConfigException {
    // If the parent has the annotation and isn't abstract it's an error
    if (aspectClass.getSuperclass().getAnnotation(Aspect.class) != null &&
        !Modifier.isAbstract(aspectClass.getSuperclass().getModifiers())) {
      throw new AopConfigException("[" + aspectClass.getName() + "] cannot extend concrete aspect [" +
          aspectClass.getSuperclass().getName() + "]");
    }

    AjType<?> ajType = AjTypeSystem.getAjType(aspectClass);
    if (!ajType.isAspect()) {
      throw new NotAnAtAspectException(aspectClass);
    }
    if (ajType.getPerClause().getKind() == PerClauseKind.PERCFLOW) {
      throw new AopConfigException(aspectClass.getName() + " uses percflow instantiation model: " +
          "This is not supported in Spring AOP.");
    }
    if (ajType.getPerClause().getKind() == PerClauseKind.PERCFLOWBELOW) {
      throw new AopConfigException(aspectClass.getName() + " uses percflowbelow instantiation model: " +
          "This is not supported in Spring AOP.");
   
  }
View Full Code Here

    }

    // If we get here, we know we have an AspectJ method.
    // Check that it's an AspectJ-annotated class
    if (!isAspect(candidateAspectClass)) {
      throw new AopConfigException("Advice must be declared inside an aspect type: " +
          "Offending method '" + candidateAdviceMethod + "' in class [" +
          candidateAspectClass.getName() + "]");
    }

    if (logger.isDebugEnabled()) {
View Full Code Here

TOP

Related Classes of org.springframework.aop.framework.AopConfigException

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.