|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.util.dispatch.ConnectionStateEnum
public final class ConnectionStateEnum
This class simulates an enumeration for the connection states.
Note that this implementation has a fixed number of four states.
Field Summary | |
---|---|
static ConnectionStateEnum |
ALIVE
We have a connection (0). |
private int |
connectionState
|
private static ConnectionStateEnum[] |
connectionStateEnumArr
For good performance have a static array of all priorities |
static ConnectionStateEnum |
DEAD
The connection is dead an no recovery is possible (2). |
static ConnectionStateEnum |
POLLING
We have lost the connection and are polling for it (1). |
private static long |
serialVersionUID
|
static ConnectionStateEnum |
UNDEF
The connection state is not known (-1). |
Constructor Summary | |
---|---|
private |
ConnectionStateEnum(int connectionState)
|
Method Summary | |
---|---|
boolean |
equals(ConnectionStateEnum other)
|
int |
getInt()
Returns the int representation of this connectionState |
static ConnectionStateEnum |
parseConnectionState(java.lang.String state)
Parses given string to extract the connectionState of a message. |
static ConnectionStateEnum |
parseConnectionState(java.lang.String connectionState,
ConnectionStateEnum defaultConnectionState)
Parses given string to extract the connectionState of a message |
static ConnectionStateEnum |
toConnectionStateEnum(int connectionState)
Checks the given int and returns the corresponding ConnectionStateEnum instance. |
java.lang.String |
toString()
Return a human readable string of the connectionState |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
private static final long serialVersionUID
private final int connectionState
public static final ConnectionStateEnum UNDEF
public static final ConnectionStateEnum ALIVE
public static final ConnectionStateEnum POLLING
public static final ConnectionStateEnum DEAD
private static final ConnectionStateEnum[] connectionStateEnumArr
Constructor Detail |
---|
private ConnectionStateEnum(int connectionState)
Method Detail |
---|
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(ConnectionStateEnum other)
public final int getInt()
public static final ConnectionStateEnum toConnectionStateEnum(int connectionState) throws java.lang.IllegalArgumentException
prio
- For example 7
java.lang.IllegalArgumentException
- if the given connectionState is invalidpublic static final ConnectionStateEnum parseConnectionState(java.lang.String state) throws java.lang.IllegalArgumentException
state
- For example "POLLING"
java.lang.IllegalArgumentException
- if the given connectionState is invalidpublic static final ConnectionStateEnum parseConnectionState(java.lang.String connectionState, ConnectionStateEnum defaultConnectionState)
prio
- For example "polling" or "alive"defaultConnectionState
- Value to use if not parsable
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |