|
xmlBlaster 2.2.0 client API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.xmlBlaster.util.def.PriorityEnum
public final class PriorityEnum
This class simulates an enumeration for queue priorities, it ensures that only valid priorities are used.
Note that this implementation has a fixed number of priorities, namely from 0 (lowest) to 9 (highest). For performance reasons we have not used an interface in the queue implementation to hide this priority implementation (calling a method through an interface takes 20 CPU cycles instead of 2).
If you need a different set of priorities, replace this implementation or change it to support an adjustable amount of priorities.
| Field Summary | |
|---|---|
static PriorityEnum |
HIGH_PRIORITY
The higher priority of a message (7 or HIGH). |
static PriorityEnum |
HIGH8_PRIORITY
The higher priority of a message (8). |
static PriorityEnum |
LOW_PRIORITY
The lower priority of a message (3 or LOW). |
static PriorityEnum |
LOW4_PRIORITY
The lower priority of a message (4). |
static PriorityEnum |
MAX_PRIORITY
The maximum priority of a message (9 or MAX). |
static PriorityEnum |
MIN_PRIORITY
The minimum priority of a message (0 or MIN). |
static PriorityEnum |
MIN1_PRIORITY
The minimum priority of a message (1). |
static PriorityEnum |
MIN2_PRIORITY
The minimum priority of a message (2). |
static PriorityEnum |
NORM_PRIORITY
The default priority of a message (5 or NORM). |
static PriorityEnum |
NORM6_PRIORITY
The default priority of a message (6). |
| Method Summary | |
|---|---|
int |
getInt()
Returns the int representation of this priority |
java.lang.Integer |
getInteger()
Returns the Integer representation of this priority |
static void |
main(java.lang.String[] args)
java org.xmlBlaster.util.def.PriorityEnum |
static PriorityEnum |
parsePriority(java.lang.String prio)
Parses given string to extract the priority of a message |
static PriorityEnum |
parsePriority(java.lang.String priority,
PriorityEnum defaultPriority)
Parses given string to extract the priority of a message |
static PriorityEnum |
toPriorityEnum(int priority)
Checks the given int and returns the corresponding PriorityEnum instance. |
java.lang.String |
toString()
Return a human readable string of the priority |
java.lang.Object |
writeReplace()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final PriorityEnum MIN_PRIORITY
public static final PriorityEnum MIN1_PRIORITY
public static final PriorityEnum MIN2_PRIORITY
public static final PriorityEnum LOW_PRIORITY
public static final PriorityEnum LOW4_PRIORITY
public static final PriorityEnum NORM_PRIORITY
public static final PriorityEnum NORM6_PRIORITY
public static final PriorityEnum HIGH_PRIORITY
public static final PriorityEnum HIGH8_PRIORITY
public static final PriorityEnum MAX_PRIORITY
| Method Detail |
|---|
public java.lang.String toString()
toString in class java.lang.Objectpublic final int getInt()
public final java.lang.Integer getInteger()
public static final PriorityEnum toPriorityEnum(int priority)
throws java.lang.IllegalArgumentException
prio - For example 7
java.lang.IllegalArgumentException - if the given priority is invalid
public static final PriorityEnum parsePriority(java.lang.String prio)
throws java.lang.IllegalArgumentException
prio - For example "HIGH" or 7
java.lang.IllegalArgumentException - if the given priority is invalid
public static final PriorityEnum parsePriority(java.lang.String priority,
PriorityEnum defaultPriority)
prio - For example "HIGH" or 7defaultPriority - Value to use if not parsable
public java.lang.Object writeReplace()
throws java.io.ObjectStreamException
java.io.ObjectStreamExceptionpublic static void main(java.lang.String[] args)
|
xmlBlaster 2.2.0 client API | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||