IBM Branch Transformation Toolkit Javadoc

com.ibm.dse.services.landp
Class DeviceStatus

java.lang.Object
  extended bycom.ibm.dse.services.landp.DeviceStatus

public class DeviceStatus
extends java.lang.Object

This class encapsulates a device status (closed, open, reading or writing), so that its getter and setter are both synchronized. This way, there is no possibility of any conflict when the status is changed concurrently. For example, when a secondary thread is in charge of waiting for a LANDP read event and the user thread cancels the read request.


Field Summary
static int CLOSED
           
static int OPEN
           
static int READING
           
static int WRITING
           
 
Constructor Summary
(package private) DeviceStatus()
          This constructor creates a DeviceStatus object.
 
Method Summary
 int get()
          Synchronized status getter.
(package private)  void set(int newStatus)
          Synchronized status setter.
 java.lang.String toString()
          Returns a string with a text representation of the status value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CLOSED

public static final int CLOSED
See Also:
Constant Field Values

OPEN

public static final int OPEN
See Also:
Constant Field Values

READING

public static final int READING
See Also:
Constant Field Values

WRITING

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

DeviceStatus

DeviceStatus()
This constructor creates a DeviceStatus object.

Method Detail

get

public int get()
Synchronized status getter.

Returns:
int - the device status value.

set

void set(int newStatus)
Synchronized status setter.

Parameters:
newStatus - int - the new device status value.

toString

public java.lang.String toString()
Returns a string with a text representation of the status value.

Returns:
- the representation of the status value.

IBM Branch Transformation Toolkit Javadoc

(c) Copyright IBM Corporation 1998, 2005