Class 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 Detail

    • 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 the ProjectEventHandler
        Parameters:
        jp - the JoinPoint object describing the method signature
        eventAnnotation - the LaunchesProjectEvent annotation arguments
        returnValue - 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 the ProjectEventHandler
        Parameters:
        jp - The join point object describing the method signature
        eventAnnotation - 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 interface org.springframework.core.Ordered
        Returns:
        the order of this aspect