org.fosstrak.llrp.adaptor.util
Class AsynchronousNotifiableList

java.lang.Object
  extended by org.fosstrak.llrp.adaptor.util.AsynchronousNotifiableList
All Implemented Interfaces:
java.rmi.Remote, AsynchronousNotifiable

public class AsynchronousNotifiableList
extends java.lang.Object
implements AsynchronousNotifiable

helper class to maintain a list of asynchronous message receivers. the helper checks whether there are transmission exception, and if so then the respective receivers get dropped after a certain number of erroneous transmissions.

Author:
swieland

Field Summary
static int NUM_NON_RECHABLE_ALLOWED
          remove the receiver after this number of unsuccessful connection attempts.
 
Constructor Summary
AsynchronousNotifiableList()
           
 
Method Summary
 void add(AsynchronousNotifiable entry)
          add a new receiver to the list.
 java.util.List<org.fosstrak.llrp.adaptor.util.AsynchronousNotifiableList.Receiver> getAll()
           
 void notify(byte[] message, java.lang.String readerName)
          notify all the receivers with a new message.
 void notifyError(LLRPRuntimeException e, java.lang.String readerName)
          notify all the receivers about an exception in the reader module.
 void remove(AsynchronousNotifiable entry)
          removes a receiver from the list.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NUM_NON_RECHABLE_ALLOWED

public static final int NUM_NON_RECHABLE_ALLOWED
remove the receiver after this number of unsuccessful connection attempts.

See Also:
Constant Field Values
Constructor Detail

AsynchronousNotifiableList

public AsynchronousNotifiableList()
Method Detail

add

public void add(AsynchronousNotifiable entry)
add a new receiver to the list.

Parameters:
entry - the new receiver to be stored in the list.

remove

public void remove(AsynchronousNotifiable entry)
removes a receiver from the list.

Parameters:
entry - the receiver to be removed.

notify

public void notify(byte[] message,
                   java.lang.String readerName)
            throws java.rmi.RemoteException
notify all the receivers with a new message.

Specified by:
notify in interface AsynchronousNotifiable
Parameters:
message - the LLRP message.
readerName - the reader that delivered the message.
Throws:
java.rmi.RemoteException - when there is an RMI exception.

notifyError

public void notifyError(LLRPRuntimeException e,
                        java.lang.String readerName)
                 throws java.rmi.RemoteException
notify all the receivers about an exception in the reader module.

Specified by:
notifyError in interface AsynchronousNotifiable
Parameters:
e - the exception.
readerName - the reader that delivered the exception.
Throws:
java.rmi.RemoteException - when there is an RMI exception.

getAll

public java.util.List<org.fosstrak.llrp.adaptor.util.AsynchronousNotifiableList.Receiver> getAll()
Returns:
a list holding all the registered receivers.


Copyright © 2009. All Rights Reserved.