|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.fosstrak.llrp.adaptor.AdaptorWorker
public class AdaptorWorker
an LLRPAdaptorWorker holds an Adaptor and a callback. the worker enqueues messages and dispatches them to the corresponding reader. through the callback it can retrieve messages that then will be dispatched to the MessageRepository.
Field Summary | |
---|---|
static int |
MAX_CONN_FAILURES
the number of allowed connection failures between adaptor and client. |
static int |
QUEUE_THRESHOLD
the worker does not accept more messages in the queue than this threshold. |
Constructor Summary | |
---|---|
AdaptorWorker(AdaptorCallback callback,
Adaptor adaptor)
creates a new LLRPAdaptorWorker. |
Method Summary | |
---|---|
void |
cleanConnFailure()
resets the connection failure counter to zero. |
void |
enqueue(QueueEntry e)
enqueues a message to be sent. |
Adaptor |
getAdaptor()
the adaptor holding the connection to the readers. |
java.lang.String |
getAdaptorIpAddress()
returns the ip address of this adaptor. if its the local adaptor it returns null. |
AdaptorCallback |
getCallback()
returns the callback for asynchronous message retrieval. |
boolean |
isReady()
signals whether this worker is ready to accept messages. |
boolean |
ok()
|
void |
reportConnFailure()
increases the connection failure counter by one. |
void |
run()
|
void |
setAdaptor(Adaptor adaptor)
sets the adaptor holding the connection to the readers. |
void |
setAdaptorIpAddress(java.lang.String adaptorIpAddress)
sets the address of this adaptor. if its the local adaptor set null. |
void |
setCallback(AdaptorCallback callback)
sets the callback for asynchronous message retrieval. |
void |
tearDown()
call this method if you want to stop the worker thread. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int QUEUE_THRESHOLD
public static final int MAX_CONN_FAILURES
Constructor Detail |
---|
public AdaptorWorker(AdaptorCallback callback, Adaptor adaptor)
callback
- the callback for asynchronous message retrieval.adaptor
- the adaptor holding the connection to the readers.Method Detail |
---|
public void run()
run
in interface java.lang.Runnable
public void tearDown()
public AdaptorCallback getCallback()
public void setCallback(AdaptorCallback callback)
callback
- the callback for asynchronous message retrieval.public Adaptor getAdaptor()
public void setAdaptor(Adaptor adaptor)
adaptor
- the adaptor holding the connection to the readers.public boolean isReady()
public void enqueue(QueueEntry e) throws LLRPRuntimeException
e
- the queue element holding the message.
LLRPRuntimeException
- when worker is not ready or queue is fullpublic java.lang.String getAdaptorIpAddress()
public void setAdaptorIpAddress(java.lang.String adaptorIpAddress)
adaptorIpAddress
- the address of the adaptor.public void reportConnFailure()
public void cleanConnFailure()
public boolean ok()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |