Hi,
I'm trying to write an Aspect that proxies all method implementation of the following interface:
So I've written an aspect that declares the pointcut:Code:public interface ContentConverter<T> { public T convert(LifecycleContext<AbstractRequest> context, byte[] content) throws ProcessingException; }
And I've written an aspect that declares the advice:Code:@Aspect @Component public class ConnectorLifecyclePointcuts { @Pointcut(value = "execution(java.util.Collection<com.example.HarvestedDocument+>+ com.example.ContentConverter.convert(..))") public void contentConversion() {} }
This doesn't seem to work. But if I remove the generic declaration of the Collection in the setNumberOfRetrievedDocuments method, it does work. That is - when I write the following advice:Code:@AfterReturning(pointcut = "com.example.ConnectorLifecyclePointcuts.contentConversion()", returning = "documents") public void setNumberOfRetrievedDocuments(Collection<HarvestedDocument> documents) { getStatsCollector().setNumberOfRetrievedDocuments(documents.size()); }
the advice is called as expected. What am I missing here?Code:@AfterReturning(pointcut = "com.example.ConnectorLifecyclePointcuts.contentConversion()", returning = "documents") public void setNumberOfRetrievedDocuments(Collection documents) { getStatsCollector().setNumberOfRetrievedDocuments(documents.size()); }
I'm using Spring 3.0.5.
Thanks!


Reply With Quote