|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.ObjectCADI.Server.Request.RequestQueue
public class RequestQueue
This class implements a queue where the received client requests are
saved and then they are readed by the RequestDispatcher
thead to be processed.
NOTE:
Implementing of different kinds of priorities is very easy.
Using several queues with differents priorities and then doing the
necessary changes in the add and get methods.
Usage example:
construct
add
get
| Field Summary | |
|---|---|
private java.util.ArrayList<RequestQueueNode> |
queue
Contains a list of the client request. |
| Constructor Summary | |
|---|---|
RequestQueue()
Constructor. |
|
| Method Summary | |
|---|---|
void |
add(RequestQueueNode nodeInfo)
Adds new client request nodes to the queue, and it notifies it to the dispatcher requests. |
RequestQueueNode |
get()
Returns the first element of the queue if it isn't empty, otherwise null. |
boolean |
isEmpty()
Returns true if the list is empty, false otherwise. |
void |
list(java.io.PrintStream out)
Prints this Request Queue fields out to the specified output stream. |
int |
size()
Returns the size of the queue. |
java.lang.String |
toString()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private java.util.ArrayList<RequestQueueNode> queue
| Constructor Detail |
|---|
public RequestQueue()
| Method Detail |
|---|
public void add(RequestQueueNode nodeInfo)
nodeInfo -
public RequestQueueNode get()
throws java.lang.InterruptedException
java.lang.InterruptedExceptionpublic boolean isEmpty()
public int size()
public java.lang.String toString()
toString in class java.lang.Objectpublic void list(java.io.PrintStream out)
out - an output stream.
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||