amber.type.server
Class PendingResponsePacket

java.lang.Object
  |
  +--amber.type.server.PendingResponsePacket

public class PendingResponsePacket
extends java.lang.Object

This class holds information on a packet which is expected by the server. It is typically used when a response is required from the client.

Version:
1.0.0
Author:
Dr. David J. Knowles
See Also:
ComponentHandler

Field Summary
protected  byte commandId
          This is the expected response packet ID in the returned packet.
protected  Mutex lock
          This is the mutex which is blocking the server thread.
protected  PacketData responsePacket
          This is the returned packet data.
 
Constructor Summary
PendingResponsePacket()
          Default Constructor.
PendingResponsePacket(PacketData responsePacket, byte commandId, Mutex lock)
          Initialising Constructor.
 
Method Summary
 byte getCommandId()
          Gets the data in the following variable: This is the expected response packet ID in the returned packet.
 Mutex getLock()
          Gets the data in the following variable: This is the mutex which is blocking the server thread.
 PacketData getResponsePacket()
          Gets the data in the following variable: This is the returned packet data.
 void setCommandId(byte data)
          Sets the data in the following variable: This is the expected response packet ID in the returned packet.
 void setLock(Mutex data)
          Sets the data in the following variable: This is the mutex which is blocking the server thread.
 void setResponsePacket(PacketData data)
          Sets the data in the following variable: This is the returned packet data.
 java.lang.String toString()
          This function returns the String form of the data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

responsePacket

protected PacketData responsePacket
This is the returned packet data. It is set when the response packet is received.

commandId

protected byte commandId
This is the expected response packet ID in the returned packet.

lock

protected Mutex lock
This is the mutex which is blocking the server thread. This must be unlocked when the client returns the response packet.
Constructor Detail

PendingResponsePacket

public PendingResponsePacket()
Default Constructor.

PendingResponsePacket

public PendingResponsePacket(PacketData responsePacket,
                             byte commandId,
                             Mutex lock)
Initialising Constructor.
Parameters:
responsePacket - This is the returned packet data. It is set when the response packet is received.
commandId - This is the expected response packet ID in the returned packet.
lock - This is the mutex which is blocking the server thread. This must be unlocked when the client returns the response packet.
Method Detail

getResponsePacket

public PacketData getResponsePacket()
Gets the data in the following variable: This is the returned packet data. It is set when the response packet is received.
Returns:
PacketData containing the required information.

getCommandId

public byte getCommandId()
Gets the data in the following variable: This is the expected response packet ID in the returned packet.
Returns:
byte containing the required information.

getLock

public Mutex getLock()
Gets the data in the following variable: This is the mutex which is blocking the server thread. This must be unlocked when the client returns the response packet.
Returns:
Mutex containing the required information.

setResponsePacket

public void setResponsePacket(PacketData data)
Sets the data in the following variable: This is the returned packet data. It is set when the response packet is received.
Parameters:
data - PacketData containing the data to set the variable to.

setCommandId

public void setCommandId(byte data)
Sets the data in the following variable: This is the expected response packet ID in the returned packet.
Parameters:
data - byte containing the data to set the variable to.

setLock

public void setLock(Mutex data)
Sets the data in the following variable: This is the mutex which is blocking the server thread. This must be unlocked when the client returns the response packet.
Parameters:
data - Mutex containing the data to set the variable to.

toString

public java.lang.String toString()
This function returns the String form of the data.
Overrides:
toString in class java.lang.Object
Returns:
String containing the string version of this class.


Copyright © 2002 Clearfield Research Ltd. All Rights Reserved.