org.xnap.plugin.opennap.net
Class SendQueue

java.lang.Object
  extended by org.xnap.plugin.opennap.net.SendQueue

public class SendQueue
extends java.lang.Object

Provides a message queue that is used by the OpenNapServerRunner class.


Field Summary
static int STATE_BUSY
           
static int STATE_EMPTY
           
static int STATE_WAITING
           
 
Constructor Summary
SendQueue(OpenNapServerRunner runner)
           
 
Method Summary
 void add(ClientMessage msg)
          Returns true, if a send worker needs to be notified.
 int getState()
          Returns true, if a send worker is currently sending messages from this queue.
 boolean isEmpty()
           
 ClientMessage pop()
          Removes the top message from the queue.
 boolean send(ClientMessage msg)
           
 void setState(int state)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STATE_EMPTY

public static final int STATE_EMPTY
See Also:
Constant Field Values

STATE_WAITING

public static final int STATE_WAITING
See Also:
Constant Field Values

STATE_BUSY

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

SendQueue

public SendQueue(OpenNapServerRunner runner)
Method Detail

add

public void add(ClientMessage msg)
Returns true, if a send worker needs to be notified.


getState

public int getState()
Returns true, if a send worker is currently sending messages from this queue.


isEmpty

public boolean isEmpty()

pop

public ClientMessage pop()
Removes the top message from the queue.

Returns:
if queue is not empty, top message; null otherwise

send

public boolean send(ClientMessage msg)

setState

public void setState(int state)


Copyright © 2001-2005 XNap Team. All Rights Reserved.