Package io.hekate.messaging
Enum MessagingOverflowPolicy
- java.lang.Object
-
- java.lang.Enum<MessagingOverflowPolicy>
-
- io.hekate.messaging.MessagingOverflowPolicy
-
- All Implemented Interfaces:
Serializable
,Comparable<MessagingOverflowPolicy>
public enum MessagingOverflowPolicy extends Enum<MessagingOverflowPolicy>
Policy that defines howMessagingChannel
should behave in case of its send queue overflow.
-
-
Enum Constant Summary
Enum Constants Enum Constant Description BLOCK
Block the caller thread unless theMessagingChannel
's outbound queue goes down to itslow watermark
or unless the caller thread gets interrupted.BLOCK_UNINTERRUPTEDLY
Blocks the caller thread unless theMessagingChannel
's outbound queue goes down to itslow watermark
.FAIL
Rejects operation withMessageQueueOverflowException
error.IGNORE
Completely ignore queue size restrictions.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static MessagingOverflowPolicy
valueOf(String name)
Returns the enum constant of this type with the specified name.static MessagingOverflowPolicy[]
values()
Returns an array containing the constants of this enum type, in the order they are declared.
-
-
-
Enum Constant Detail
-
BLOCK
public static final MessagingOverflowPolicy BLOCK
Block the caller thread unless theMessagingChannel
's outbound queue goes down to itslow watermark
or unless the caller thread gets interrupted. If the caller thread gets interrupted then the messaging operation will fail withInterruptedException
. Note that the caller thread'sinterrupted
flag will not be reset (i.e.Thread.isInterrupted()
will returnfalse
).
-
BLOCK_UNINTERRUPTEDLY
public static final MessagingOverflowPolicy BLOCK_UNINTERRUPTEDLY
Blocks the caller thread unless theMessagingChannel
's outbound queue goes down to itslow watermark
. If the caller thread gets interrupted then such interruption will be ignored.
-
FAIL
public static final MessagingOverflowPolicy FAIL
Rejects operation withMessageQueueOverflowException
error.
-
IGNORE
public static final MessagingOverflowPolicy IGNORE
Completely ignore queue size restrictions.
-
-
Method Detail
-
values
public static MessagingOverflowPolicy[] 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 (MessagingOverflowPolicy c : MessagingOverflowPolicy.values()) System.out.println(c);
- Returns:
- an array containing the constants of this enum type, in the order they are declared
-
valueOf
public static MessagingOverflowPolicy 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 nameNullPointerException
- if the argument is null
-
-