Class ProjectEventAspect
- java.lang.Object
-
- ca.corefacility.bioinformatics.irida.events.ProjectEventAspect
-
- All Implemented Interfaces:
org.springframework.core.Ordered
public class ProjectEventAspect extends java.lang.Object implements org.springframework.core.Ordered
Aspect used to create project events for methods annotated with event annotations- See Also:
LaunchesProjectEvent
-
-
Constructor Summary
Constructors Constructor Description ProjectEventAspect(ProjectEventHandler eventListener)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getOrder()
This event **must** happen outside of a transaction so that multiple events happening at the same time do not result in a deadlock exception.void
handleProjectEvent(org.aspectj.lang.JoinPoint jp, LaunchesProjectEvent eventAnnotation, java.lang.Object returnValue)
Get the return value of a method to send to theProjectEventHandler
void
handleProjectEventWithoutReturn(org.aspectj.lang.JoinPoint jp, LaunchesProjectEvent eventAnnotation)
Get the arguments of a method to send to theProjectEventHandler
-
-
-
Constructor Detail
-
ProjectEventAspect
public ProjectEventAspect(ProjectEventHandler eventListener)
-
-
Method Detail
-
handleProjectEvent
public void handleProjectEvent(org.aspectj.lang.JoinPoint jp, LaunchesProjectEvent eventAnnotation, java.lang.Object returnValue)
Get the return value of a method to send to theProjectEventHandler
- Parameters:
jp
- the JoinPoint object describing the method signatureeventAnnotation
- the LaunchesProjectEvent annotation argumentsreturnValue
- the return value of the annotated method
-
handleProjectEventWithoutReturn
public void handleProjectEventWithoutReturn(org.aspectj.lang.JoinPoint jp, LaunchesProjectEvent eventAnnotation)
Get the arguments of a method to send to theProjectEventHandler
- Parameters:
jp
- The join point object describing the method signatureeventAnnotation
- The LaunchesProjectEvent annotation arguments
-
getOrder
public int getOrder()
This event **must** happen outside of a transaction so that multiple events happening at the same time do not result in a deadlock exception. Example: when multiple sequencers are uploading sample data simultaneously, they are all creating samples on the server. When the samples are being created the project event for updating the project modified time is fired many times simultaneously, so multiple clients are trying to update the project at the same time. If that update is within a transaction, at least one of those simultaneous updates fails, so the client gets a report that creating the sample failed. Since we don't care which thread wins the update (they should be setting the same updated time down to at least the second), just make sure that this aspect is being applied *outside* of the transaction.- Specified by:
getOrder
in interfaceorg.springframework.core.Ordered
- Returns:
- the order of this aspect
-
-