Announcement Announcement Module
Collapse
No announcement yet.
Pointcut Is Not Matching Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Pointcut Is Not Matching

    I have a Grails application (1.3.7) that is using AOP to manage some workflow functionality. The application processes various types of electronically submitted archives and/or XML messages and uses Quartz to facilitate notification and processing of artifacts from a gateway. Previously, the workflow aspect worked fine (and still works on other annotated methods) but after making some recent modifications it now skips one of the annotated methods, as if the signature no longer matches. I'm fairly new to AOP syntax, but to me it looks correct. The only difference I've noticed is that this method is also annotated with @Transactional and others are not. I've tried removing the @Transactional, as well as modifying the pointcut syntax to include it and it still doesn't work. Any advice would be helpful, the code including the pointcut and signatures is below.

    Aspect:
    Code:
    @Component
    @Aspect
    class SubmissionWorkflowAspect {
    	
    	def dataSource
    	
    	@Pointcut("@annotation(SubmissionWorkflowActivity) && args(submission,..)")
    	def workflowActivity(Submission submission){}
    
    	@Around("workflowActivity(submission)")
    	def processWorkflowActivities(ProceedingJoinPoint joinPoint, Submission submission)
            {
            // logic in here, excluded for brevity
            }
    }
    Custom Annotation
    Code:
    import java.lang.annotation.ElementType;
    import java.lang.annotation.RetentionPolicy;
    import java.lang.annotation.Retention;
    import java.lang.annotation.Target;
    
    @Retention(RetentionPolicy.RUNTIME)
    @Target(ElementType.METHOD)
    public @interface SubmissionWorkflowActivity {
    
    }
    Target Class and Code:
    The method parseSubmissionXML is not getting @Around advice applied.
    Code:
    import java.util.List
    import org.springframework.transaction.annotation.Propagation
    import org.springframework.transaction.annotation.Transactional
    import aspects.SubmissionWorkflowActivity
    
    @Transactional(propagation=Propagation.SUPPORTS)
    class ParseSubmissionService {	
    	
    	def storedProcedureService
    	def stagingService
    	def loaderProperties
    	
    	def parseSubmissions() 
    	{
    		List<Submission> submissions = Submission.findAllByStatus(SubmissionStatus.PARSING)
    		for(Submission submission : submissions) {
    
    			def submissionDirectory = Utils.createStagingAreaPath (submission.stagingArea, submission.receiptDate, submission.coreId)
    			List<SubmissionDocument> submissionDocuments = stagingService.extractSubmission(submission, Notify.findByCoreId(submission.coreId), submissionDirectory)
    			try {
    				parseSubmissionXML(submission, submissionDocuments)
    			} catch(ex) {
    				submission.status = SubmissionStatus.PARSING_FAILED
    				if(!submission.save(flush:true)){
    					submission.errors.allErrors.each {
    						println it
    					}
    				}				
    			}		
    			
    		}
    	}
    	
    	@Transactional(propagation=Propagation.REQUIRED)
    	@SubmissionWorkflowActivity
    	def parseSubmissionXML(Submission submission, List<SubmissionDocument> submissionDocuments)
    	{
              // logic in here, excluded for brevity
            }
Working...
X