Enum MailContextPriority

    • Enum Constant Detail

      • SAME_TRANSACTION

        public static final MailContextPriority SAME_TRANSACTION
        The email is sent in the end of the current transaction. It has 2 consequences: Only if the transaction would succeed the mail is sent, and failing to send the email rolls back the transaction.
      • CONCURRENT

        public static final MailContextPriority CONCURRENT
        After the current transaction commits, the email sending is dispatched to the ExecutorService, which doesn't block the current request, and avoids being enqueued as a background task. If there's an error in the email sending, then it will be scheduled as a background task.
      • BACKGROUND

        public static final MailContextPriority BACKGROUND
        A background task is scheduled to send the email, and will be processed later.
      • IMMEDIATE

        public static final MailContextPriority IMMEDIATE
        The email is sent right now. It might happen that after the email is sent, if the current transaction fails, the email was sent anyway but no data is persisted.
    • Method Detail

      • values

        public static MailContextPriority[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (MailContextPriority c : MailContextPriority.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static MailContextPriority valueOf​(String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        IllegalArgumentException - if this enum type has no constant with the specified name
        NullPointerException - if the argument is null