|
|||||||||
| Home >> All >> proxy >> [ protocol overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
proxy.protocol
Class ProxyRequestManager

java.lang.Objectjava.lang.Thread
proxy.protocol.ProxyRequestManager
- All Implemented Interfaces:
- mobile.bearer.http.Protocol, java.lang.Runnable
- public class ProxyRequestManager
- extends java.lang.Thread
- implements mobile.bearer.http.Protocol
- extends java.lang.Thread
This class provides an implementation of a thread which manages requests comming from mobile devices. The request are received in the order of their ids. The receipt protocol ensures that no request is lost and that they come in the desired order.
The requests are stored in a queue and processed sequentially. For each request the appropriate action associated with this request is executed and a reply is generated. The reply is then added to the reply queue. The reply queue is emptied by the replier thread which send the replies to the mobile device using the bearer layer.
| Nested Class Summary | |
private class |
ProxyRequestManager.Receiver
|
private class |
ProxyRequestManager.Replier
|
| Nested classes inherited from class java.lang.Thread |
java.lang.Thread.UncaughtExceptionHandler |
| Field Summary | |
private java.util.Hashtable |
currentIds
For each mobile contains a hash table mapping the id of the last request which was received from an application. |
private proxy.jmsapi.JMSObjectManager |
manager
|
private static int |
MESSAGES_PER_PACK
|
private ProxyRequestManager.Replier |
replier
|
private java.util.LinkedList |
replyQueue
|
private java.util.LinkedList |
requestQueue
|
private proxy.bearer.http.TalkingWithMobiles |
talking
|
private java.util.Hashtable |
waiting
For each mobile contains a sorted collection of waiting requests which couldn't have been processed because a previous request was missing |
| Fields inherited from class java.lang.Thread |
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY |
| Constructor Summary | |
ProxyRequestManager()
Initializes the queues and starts the main thread. |
|
| Method Summary | |
private Reply |
handleExc(Request req,
int type,
java.lang.String name)
|
private Reply |
handleRequest(Request req)
|
private void |
log(java.lang.String msg)
adds the message to the server logs - for debugging |
void |
processReply(Reply rep)
Adds the reply to the reply queue. |
void |
processRequest(Request req)
Receives the next request, acknowledges its receipt and adds it to the request queue. |
void |
run()
The main thread. |
void |
setObjectManager(proxy.jmsapi.JMSObjectManager _om)
|
void |
setTalkingWithMobiles(proxy.bearer.http.TalkingWithMobiles _twm)
|
| Methods inherited from class java.lang.Thread |
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
currentIds
private java.util.Hashtable currentIds
For each mobile contains a hash table mapping the id of the last request which was received from an application. Thus the hash table has two levels - the first one mapping the mobile nr to the second hash table and the second mapping the owner id to the last request id.
waiting
private java.util.Hashtable waiting
For each mobile contains a sorted collection of waiting requests which couldn't have been processed because a previous request was missing
talking
private proxy.bearer.http.TalkingWithMobiles talking
manager
private proxy.jmsapi.JMSObjectManager manager
MESSAGES_PER_PACK
private static final int MESSAGES_PER_PACK
- See Also:
- Constant Field Values
replier
private ProxyRequestManager.Replier replier
requestQueue
private java.util.LinkedList requestQueue
replyQueue
private java.util.LinkedList replyQueue
| Constructor Detail |
ProxyRequestManager
public ProxyRequestManager()
Initializes the queues and starts the main thread.
| Method Detail |
setTalkingWithMobiles
public void setTalkingWithMobiles(proxy.bearer.http.TalkingWithMobiles _twm)
setObjectManager
public void setObjectManager(proxy.jmsapi.JMSObjectManager _om)
log
private void log(java.lang.String msg)
- adds the message to the server logs - for debugging
processRequest
public void processRequest(Request req)
Receives the next request, acknowledges its receipt and adds it to the request queue. Provides that the requests are added to the queue in the desired order and that no request is lost.
processReply
public void processReply(Reply rep)
Adds the reply to the reply queue.
handleExc
private Reply handleExc(Request req, int type, java.lang.String name)
handleRequest
private Reply handleRequest(Request req)
run
public void run()
The main thread. It takes the next request from the request queue and executes the action associated with it. The action generates a reply, which is handled by the processReply method.
- Specified by:
runin interfacejava.lang.Runnable
|
|||||||||
| Home >> All >> proxy >> [ protocol overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC