org.fosstrak.ale.server.readers
Class IdentifyThread

java.lang.Object
  extended by org.fosstrak.ale.server.readers.IdentifyThread
All Implemented Interfaces:
java.lang.Runnable

public class IdentifyThread
extends java.lang.Object
implements java.lang.Runnable

An IdentifyThread encapsulates all the methods necessary for polling the device. The identification process itself is based on the method identify() of the associated AutoIdController.

Author:
Stefan Schlegel (schlstef@student.ethz.ch), sawielan

Constructor Summary
IdentifyThread()
          Constructs an instance of IdentifyThread.
IdentifyThread(BaseReader adapter)
          Constructs an instance of IdentifyThread.
 
Method Summary
 BaseReader getAdapter()
          Gets the Controller instance associated with this IdentificationThread.
 long getPollingFrequency()
          Gets the current polling frequency.
 boolean isRunning()
          Returns true if the thread is currently running, false otherwise.
 void resumeIdentify()
          Resumes the IdentifyThread.
 void run()
          Polls the RFID hardware for RFID tags in the fields.
 void setPollingFrequency(long frequency)
          Sets the polling frequency.
 void setSourceIds(java.lang.String[] sourceIds)
          set the sources to poll.
 void start()
          Starts an instance of IdentifyThread.
 void stopIdentify()
          Stops the Thread.
 void suspendIdentify()
          Suspends the IdentifyThread.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdentifyThread

public IdentifyThread()
Constructs an instance of IdentifyThread.


IdentifyThread

public IdentifyThread(BaseReader adapter)
Constructs an instance of IdentifyThread.

Parameters:
adapter - the associated controller
Method Detail

run

public void run()
Polls the RFID hardware for RFID tags in the fields.

Specified by:
run in interface java.lang.Runnable

start

public void start()
Starts an instance of IdentifyThread.


suspendIdentify

public void suspendIdentify()
Suspends the IdentifyThread.


resumeIdentify

public void resumeIdentify()
Resumes the IdentifyThread.


stopIdentify

public void stopIdentify()
Stops the Thread.


getPollingFrequency

public long getPollingFrequency()
Gets the current polling frequency.

Returns:
the current polling frequency

setPollingFrequency

public void setPollingFrequency(long frequency)
Sets the polling frequency. The frequency is given in milliseconds indicating how long the thread has to sleep between two executions.

Parameters:
frequency - the polling frequency in milliseconds.

setSourceIds

public void setSourceIds(java.lang.String[] sourceIds)
set the sources to poll.

Parameters:
sourceIds - an array of source ids to be polled on the reader.

isRunning

public boolean isRunning()
Returns true if the thread is currently running, false otherwise.

Returns:
boolean indicating if the thread is currently running or not.

getAdapter

public BaseReader getAdapter()
Gets the Controller instance associated with this IdentificationThread.

Returns:
the reader polled through this polling thread.


Copyright © 2009. All Rights Reserved.