Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[aspectj-users] Non-singleton aspects and Spring configuration

Hi,

what is the way to configure non singleton aspects (using perthis) and Spring? I saw on some Adrian's slides that in this case factory-method in Spring configuration should be aspectOf(Object). Should I put something instead of Object or just to leave it as it is?
Probably very dumb question, but have no idea how to become non-dumb. :)

I have something like this:
 public abstract aspect BaseAspect perthis(advisedOperation()) {
     abstract pointcut advisedOperation();   ....

In Spring XML I use:
<bean id="cacheAspect" class="com.aspectcms.aspects.production.components.CacheAspect" factory-method="aspectOf(Object)" parent="baseAspect"> </bean>

CacheAspect extends BaseAspect and override advisedOperation() pointcut.

When I run it, I get error:
Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'cacheAspect' defined in class path resource [spring-aspectCMS.xml]: Cannot find matching factory method 'aspectOf(Object)' on class [com.aspectcms.aspects.production.components.CacheAspect]


Thanks,
Nemanja.



Back to the top