org.springframework.aop.framework.AopConfigException Java Examples

The following examples show how to use org.springframework.aop.framework.AopConfigException. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AbstractAspectJAdvisorFactory.java    From spring-analysis-note with MIT License 6 votes vote down vote up
@Override
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.");
	}
}
 
Example #2
Source File: ExecutorBeanPostProcessor.java    From elasticactors with Apache License 2.0 6 votes vote down vote up
private Object wrapExecutor(Object bean) {
    Executor executor = (Executor) bean;
    boolean methodFinal = anyFinalMethods(executor, Executor.class);
    boolean classFinal = Modifier.isFinal(bean.getClass().getModifiers());
    boolean cglibProxy = !methodFinal && !classFinal;
    try {
        return createProxy(bean, cglibProxy, new ExecutorMethodInterceptor<>(executor));
    } catch (AopConfigException ex) {
        if (cglibProxy) {
            if (log.isDebugEnabled()) {
                log.debug(
                        "Exception occurred while trying to create a proxy, falling back to "
                                + "JDK proxy",
                        ex);
            }
            return createProxy(bean, false, new ExecutorMethodInterceptor<>(executor));
        }
        throw ex;
    }
}
 
Example #3
Source File: ExecutorBeanPostProcessorTests.java    From spring-cloud-sleuth with Apache License 2.0 6 votes vote down vote up
@Test
public void should_fallback_to_default_implementation_when_exception_thrown()
		throws Exception {
	ScheduledExecutorService service = Executors.newSingleThreadScheduledExecutor();
	ExecutorBeanPostProcessor bpp = new ExecutorBeanPostProcessor(this.beanFactory) {

		@Override
		Object createProxy(Object bean, boolean cglibProxy, Advice advice) {
			throw new AopConfigException("foo");
		}

	};

	Object wrappedService = bpp.postProcessAfterInitialization(service, "foo");

	then(wrappedService).isInstanceOf(TraceableScheduledExecutorService.class);
	service.shutdown();
}
 
Example #4
Source File: ExecutorBeanPostProcessor.java    From spring-cloud-sleuth with Apache License 2.0 6 votes vote down vote up
private Object wrapExecutor(Object bean) {
	Executor executor = (Executor) bean;
	boolean methodFinal = anyFinalMethods(executor, Executor.class);
	boolean classFinal = Modifier.isFinal(bean.getClass().getModifiers());
	boolean cglibProxy = !methodFinal && !classFinal;
	try {
		return createProxy(bean, cglibProxy,
				new ExecutorMethodInterceptor<>(executor, this.beanFactory));
	}
	catch (AopConfigException ex) {
		if (cglibProxy) {
			if (log.isDebugEnabled()) {
				log.debug(
						"Exception occurred while trying to create a proxy, falling back to JDK proxy",
						ex);
			}
			return createProxy(bean, false,
					new ExecutorMethodInterceptor<>(executor, this.beanFactory));
		}
		throw ex;
	}
}
 
Example #5
Source File: FlushingAttributeSourceAdvisor.java    From cacheonix-core with GNU Lesser General Public License v2.1 6 votes vote down vote up
/**
 * @param cacheInterceptor
 *          Advice that caches the returned values of intercepted methods.
 * @throws AopConfigException
 *           if the <code>CacheFlushAttributeSource</code> of
 *           <code>cacheInterceptor</code> is <code>null</code>.
 */
public FlushingAttributeSourceAdvisor(
    MetadataFlushingInterceptor cacheInterceptor) {

  super(cacheInterceptor);

  FlushingAttributeSource tempAttributeSource = cacheInterceptor
      .getFlushingAttributeSource();

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

  cacheFlushAttributeSource = tempAttributeSource;
}
 
Example #6
Source File: AbstractAspectJAdvisorFactory.java    From spring4-understanding with Apache License 2.0 6 votes vote down vote up
@Override
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.");
	}
}
 
Example #7
Source File: AbstractAspectJAdvisorFactory.java    From lams with GNU General Public License v2.0 6 votes vote down vote up
@Override
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.");
	}
}
 
Example #8
Source File: AbstractAspectJAdvisorFactory.java    From java-technology-stack with MIT License 6 votes vote down vote up
@Override
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.");
	}
}
 
Example #9
Source File: AbstractAspectJAdvisorFactoryTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void testRejectsPerCflowBelowAspect() {
	try {
		getFixture().getAdvisors(
				new SingletonMetadataAwareAspectInstanceFactory(new PerCflowBelowAspect(), "someBean"));
		fail("Cannot accept cflowbelow");
	}
	catch (AopConfigException ex) {
		assertTrue(ex.getMessage().contains("PERCFLOWBELOW"));
	}
}
 
Example #10
Source File: ExecutorBeanPostProcessorTests.java    From spring-cloud-sleuth with Apache License 2.0 5 votes vote down vote up
@Test
public void should_fallback_to_sleuth_impl_when_it_is_not_possible_to_create_any_proxy_for_ExecutorService()
		throws Exception {
	ExecutorService service = BDDMockito.mock(ExecutorService.class);
	ExecutorBeanPostProcessor bpp = new ExecutorBeanPostProcessor(this.beanFactory) {
		@Override
		Object getObject(ProxyFactoryBean factory) {
			throw new AopConfigException("foo");
		}
	};

	Object o = bpp.postProcessAfterInitialization(service, "foo");

	then(o).isInstanceOf(TraceableExecutorService.class);
}
 
Example #11
Source File: ExecutorBeanPostProcessorTests.java    From spring-cloud-sleuth with Apache License 2.0 5 votes vote down vote up
@Test
public void should_throw_exception_when_it_is_not_possible_to_create_any_proxy_for_ThreadPoolTaskExecutor()
		throws Exception {
	ThreadPoolTaskExecutor taskExecutor = new ThreadPoolTaskExecutor();
	ExecutorBeanPostProcessor bpp = new ExecutorBeanPostProcessor(this.beanFactory) {
		@Override
		Object createThreadPoolTaskExecutorProxy(Object bean, boolean cglibProxy,
				ThreadPoolTaskExecutor executor) {
			throw new AopConfigException("foo");
		}
	};

	thenThrownBy(() -> bpp.postProcessAfterInitialization(taskExecutor, "foo"))
			.isInstanceOf(AopConfigException.class).hasMessage("foo");
}
 
Example #12
Source File: AbstractAspectJAdvisorFactoryTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void testRejectsPerCflowAspect() {
	try {
		getFixture().getAdvisors(
				new SingletonMetadataAwareAspectInstanceFactory(new PerCflowAspect(), "someBean"));
		fail("Cannot accept cflow");
	}
	catch (AopConfigException ex) {
		assertTrue(ex.getMessage().contains("PERCFLOW"));
	}
}
 
Example #13
Source File: AbstractAspectJAdvisorFactoryTests.java    From java-technology-stack with MIT License 5 votes vote down vote up
@Test
public void testRejectsPerCflowBelowAspect() {
	try {
		getFixture().getAdvisors(
				new SingletonMetadataAwareAspectInstanceFactory(new PerCflowBelowAspect(), "someBean"));
		fail("Cannot accept cflowbelow");
	}
	catch (AopConfigException ex) {
		assertTrue(ex.getMessage().contains("PERCFLOWBELOW"));
	}
}
 
Example #14
Source File: CacheProxyFactoryBean.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Creates the proxy for target object. This method is invoked by a
 * BeanFactory after it has set all bean properties supplied.
 * 
 * @throws IllegalStateException
 *           if target is <code>null</code>.
 * @throws AopConfigException
 *           if the proxy interfaces or proxyTargetClass are not set and the
 *           target type is <code>org.springframework.aop.TargetSource</code>.
 */
public void afterPropertiesSet() throws IllegalStateException,
    AopConfigException {
  cachingInterceptor.afterPropertiesSet();
  flushingInterceptor.afterPropertiesSet();

  if (target == null) {
    throw new IllegalStateException("Property 'target' is required");
  }

  ProxyFactory proxyFactory = new ProxyFactory();
  proxyFactory.addAdvisor(new CachingModelSourceAdvisor(cachingInterceptor));

  if (hasFlushingModels) {
    proxyFactory.addAdvisor(new FlushingModelSourceAdvisor(
        flushingInterceptor));
  }

  proxyFactory.copyFrom(this);

  TargetSource targetSource = createTargetSource(target);
  proxyFactory.setTargetSource(targetSource);

  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
    proxyFactory.setInterfaces(ClassUtils.getAllInterfaces(target));
  }

  proxy = proxyFactory.getProxy();
}
 
Example #15
Source File: AbstractAspectJAdvisorFactoryTests.java    From spring-analysis-note with MIT License 5 votes vote down vote up
@Test
public void testRejectsPerCflowAspect() {
	try {
		getFixture().getAdvisors(
				new SingletonMetadataAwareAspectInstanceFactory(new PerCflowAspect(), "someBean"));
		fail("Cannot accept cflow");
	}
	catch (AopConfigException ex) {
		assertTrue(ex.getMessage().contains("PERCFLOW"));
	}
}
 
Example #16
Source File: FlushingModelSourceAdvisor.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * @param interceptor
 *          Advice that caches the returned value of intercepted methods.
 * @throws AopConfigException
 *           if the <code>FlushingAttributeSource</code> of
 *           <code>cacheInterceptor</code> is <code>null</code>.
 */
public FlushingModelSourceAdvisor(NameMatchFlushingInterceptor interceptor) {
  super(interceptor);

  FlushingModelSource tempSource = interceptor.getFlushingModelSource();

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

  flushingModelSource = tempSource;
}
 
Example #17
Source File: CachingModelSourceAdvisor.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
/**
 * Construct a <code>CachingModelSourceAdvisor</code>.
 * 
 * @param interceptor
 *          Advice that caches the returned value of intercepted methods.
 * @throws AopConfigException
 *           if the <code>CachingAttributeSource</code> of
 *           <code>cacheInterceptor</code> is <code>null</code>.
 */
public CachingModelSourceAdvisor(NameMatchCachingInterceptor interceptor) {
  super(interceptor);

  CachingModelSource tempSource = interceptor.getCachingModelSource();

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

  cachingModelSource = tempSource;
}
 
Example #18
Source File: CachingAttributeSourceAdvisor.java    From cacheonix-core with GNU Lesser General Public License v2.1 5 votes vote down vote up
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;
}
 
Example #19
Source File: AbstractAspectJAdvisorFactoryTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void testRejectsPerCflowBelowAspect() {
	try {
		getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(new PerCflowBelowAspect(),"someBean"));
		fail("Cannot accept cflowbelow");
	}
	catch (AopConfigException ex) {
		assertTrue(ex.getMessage().indexOf("PERCFLOWBELOW") != -1);
	}
}
 
Example #20
Source File: AbstractAspectJAdvisorFactoryTests.java    From spring4-understanding with Apache License 2.0 5 votes vote down vote up
@Test
public void testRejectsPerCflowAspect() {
	try {
		getFixture().getAdvisors(new SingletonMetadataAwareAspectInstanceFactory(new PerCflowAspect(),"someBean"));
		fail("Cannot accept cflow");
	}
	catch (AopConfigException ex) {
		assertTrue(ex.getMessage().indexOf("PERCFLOW") != -1);
	}
}
 
Example #21
Source File: AspectJPointcutAdvisorTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Test(expected=AopConfigException.class)
public void testPerCflowTarget() {
	testIllegalInstantiationModel(AbstractAspectJAdvisorFactoryTests.PerCflowAspect.class);
}
 
Example #22
Source File: AspectMetadata.java    From spring-analysis-note with MIT License 4 votes vote down vote up
/**
 * Create a new AspectMetadata instance for the given aspect class.
 * @param aspectClass the aspect class
 * @param aspectName the name of the aspect
 */
public AspectMetadata(Class<?> aspectClass, String aspectName) {
	this.aspectName = aspectName;

	Class<?> currClass = aspectClass;
	AjType<?> ajType = null;
	while (currClass != Object.class) {
		AjType<?> ajTypeToCheck = AjTypeSystem.getAjType(currClass);
		if (ajTypeToCheck.isAspect()) {
			ajType = ajTypeToCheck;
			break;
		}
		currClass = currClass.getSuperclass();
	}
	if (ajType == null) {
		throw new IllegalArgumentException("Class '" + aspectClass.getName() + "' is not an @AspectJ aspect");
	}
	if (ajType.getDeclarePrecedence().length > 0) {
		throw new IllegalArgumentException("DeclarePrecendence not presently supported in Spring AOP");
	}
	this.aspectClass = ajType.getJavaClass();
	this.ajType = ajType;

	switch (this.ajType.getPerClause().getKind()) {
		case SINGLETON:
			this.perClausePointcut = Pointcut.TRUE;
			return;
		case PERTARGET:
		case PERTHIS:
			AspectJExpressionPointcut ajexp = new AspectJExpressionPointcut();
			ajexp.setLocation(aspectClass.getName());
			ajexp.setExpression(findPerClause(aspectClass));
			ajexp.setPointcutDeclarationScope(aspectClass);
			this.perClausePointcut = ajexp;
			return;
		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);
	}
}
 
Example #23
Source File: AspectJPointcutAdvisorTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Test(expected = AopConfigException.class)
public void testPerCflowTarget() {
	testIllegalInstantiationModel(AbstractAspectJAdvisorFactoryTests.PerCflowAspect.class);
}
 
Example #24
Source File: AspectJPointcutAdvisorTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
@Test(expected = AopConfigException.class)
public void testPerCflowBelowTarget() {
	testIllegalInstantiationModel(AbstractAspectJAdvisorFactoryTests.PerCflowBelowAspect.class);
}
 
Example #25
Source File: AspectJPointcutAdvisorTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
private void testIllegalInstantiationModel(Class<?> c) throws AopConfigException {
	new AspectMetadata(c,"someBean");
}
 
Example #26
Source File: AspectJPointcutAdvisorTests.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
@Test(expected=AopConfigException.class)
public void testPerCflowBelowTarget() {
	testIllegalInstantiationModel(AbstractAspectJAdvisorFactoryTests.PerCflowBelowAspect.class);
}
 
Example #27
Source File: AspectMetadata.java    From spring4-understanding with Apache License 2.0 4 votes vote down vote up
/**
 * Create a new AspectMetadata instance for the given aspect class.
 * @param aspectClass the aspect class
 * @param aspectName the name of the aspect
 */
public AspectMetadata(Class<?> aspectClass, String aspectName) {
	this.aspectName = aspectName;

	Class<?> currClass = aspectClass;
	AjType<?> ajType = null;
	while (currClass != Object.class) {
		AjType<?> ajTypeToCheck = AjTypeSystem.getAjType(currClass);
		if (ajTypeToCheck.isAspect()) {
			ajType = ajTypeToCheck;
			break;
		}
		currClass = currClass.getSuperclass();
	}
	if (ajType == null) {
		throw new IllegalArgumentException("Class '" + aspectClass.getName() + "' is not an @AspectJ aspect");
	}
	this.ajType = ajType;
	if (this.ajType.getDeclarePrecedence().length > 0) {
		throw new IllegalArgumentException("DeclarePrecendence not presently supported in Spring AOP");
	}

	switch (this.ajType.getPerClause().getKind()) {
		case SINGLETON :
			this.perClausePointcut = Pointcut.TRUE;
			return;
		case PERTARGET : case PERTHIS :
			AspectJExpressionPointcut ajexp = new AspectJExpressionPointcut();
			ajexp.setLocation("@Aspect annotation on " + aspectClass.getName());
			ajexp.setExpression(findPerClause(aspectClass));
			this.perClausePointcut = ajexp;
			return;
		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);
	}
}
 
Example #28
Source File: AspectJPointcutAdvisorTests.java    From spring-analysis-note with MIT License 4 votes vote down vote up
private void testIllegalInstantiationModel(Class<?> c) throws AopConfigException {
	new AspectMetadata(c, "someBean");
}
 
Example #29
Source File: AspectMetadata.java    From lams with GNU General Public License v2.0 4 votes vote down vote up
/**
 * Create a new AspectMetadata instance for the given aspect class.
 * @param aspectClass the aspect class
 * @param aspectName the name of the aspect
 */
public AspectMetadata(Class<?> aspectClass, String aspectName) {
	this.aspectName = aspectName;

	Class<?> currClass = aspectClass;
	AjType<?> ajType = null;
	while (currClass != Object.class) {
		AjType<?> ajTypeToCheck = AjTypeSystem.getAjType(currClass);
		if (ajTypeToCheck.isAspect()) {
			ajType = ajTypeToCheck;
			break;
		}
		currClass = currClass.getSuperclass();
	}
	if (ajType == null) {
		throw new IllegalArgumentException("Class '" + aspectClass.getName() + "' is not an @AspectJ aspect");
	}
	if (ajType.getDeclarePrecedence().length > 0) {
		throw new IllegalArgumentException("DeclarePrecendence not presently supported in Spring AOP");
	}
	this.aspectClass = ajType.getJavaClass();
	this.ajType = ajType;

	switch (this.ajType.getPerClause().getKind()) {
		case SINGLETON:
			this.perClausePointcut = Pointcut.TRUE;
			return;
		case PERTARGET:
		case PERTHIS:
			AspectJExpressionPointcut ajexp = new AspectJExpressionPointcut();
			ajexp.setLocation(aspectClass.getName());
			ajexp.setExpression(findPerClause(aspectClass));
			ajexp.setPointcutDeclarationScope(aspectClass);
			this.perClausePointcut = ajexp;
			return;
		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);
	}
}
 
Example #30
Source File: AspectJPointcutAdvisorTests.java    From java-technology-stack with MIT License 4 votes vote down vote up
private void testIllegalInstantiationModel(Class<?> c) throws AopConfigException {
	new AspectMetadata(c, "someBean");
}