Websphere MQ Everyplace

examples.assured
Class AtomicState

java.lang.Object
  |
  +--examples.assured.AtomicState

public class AtomicState
extends java.lang.Object

Reads and writes the state of the program to persistent storage in an atomic manner. Used by the SendTestMessagesAssured program.

See Also:
SendTestMessagesAssured

Field Summary
static int STATE_BUILT_MSG_OK_MAY_HAVE_PUT
           
static int STATE_PUT_MSG_OK_MAY_HAVE_CONFIRMED
           
static int STATE_START
           
static short[] version
           
 
Constructor Summary
AtomicState(java.lang.String stateFile)
          Create the atomic state, reading any data we can from the disk file specified.
 
Method Summary
 long getConfirmID()
           Gets the ConfirmID Value.
 int getMsgIndex()
           Gets the Message Index Value.
 int getState()
           Gets the state of the object.
 java.lang.String getStateString()
          Returns the state as a string for display.
 MQeFields getUniqueID()
           Gets the Unique ID.
 void set(MQeFields uniqueID, int state, long confirmID, int msgIndex)
          Write the atomic state to disk using an MQe adapter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static short[] version

STATE_START

public static final int STATE_START
See Also:
Constant Field Values

STATE_BUILT_MSG_OK_MAY_HAVE_PUT

public static final int STATE_BUILT_MSG_OK_MAY_HAVE_PUT
See Also:
Constant Field Values

STATE_PUT_MSG_OK_MAY_HAVE_CONFIRMED

public static final int STATE_PUT_MSG_OK_MAY_HAVE_CONFIRMED
See Also:
Constant Field Values
Constructor Detail

AtomicState

public AtomicState(java.lang.String stateFile)
            throws java.lang.Exception
Create the atomic state, reading any data we can from the disk file specified.

Parameters:
stateFile - A String containing the path of the file.
Throws:
java.lang.Exception
Method Detail

getMsgIndex

public int getMsgIndex()

Gets the Message Index Value.

Returns:
an Integer value

getConfirmID

public long getConfirmID()

Gets the ConfirmID Value.

Returns:
A long integer value

getUniqueID

public MQeFields getUniqueID()

Gets the Unique ID.

Returns:
an MQeFields Object

getState

public int getState()

Gets the state of the object.

Returns:
an Integer value

set

public void set(MQeFields uniqueID,
                int state,
                long confirmID,
                int msgIndex)
         throws java.lang.Exception
Write the atomic state to disk using an MQe adapter.

Parameters:
uniqueID - The UniqueID of the Object.
state - Integer containing the state of the Object.
confirmID - A long value containing the ConfirmID
msgIndex - Integer containing the Index of the message.
Returns:
void
Throws:
java.lang.Exception

getStateString

public java.lang.String getStateString()
Returns the state as a string for display.

Returns:
String containing the State of the Object.
Throws:
none

Websphere MQ Everyplace