lime.motes
Class MoteLimeTupleSpace.MotesReactionInterceptor

java.lang.Object
  extended bylime.motes.MoteLimeTupleSpace.MotesReactionInterceptor
All Implemented Interfaces:
java.util.EventListener, ReactionListener, java.io.Serializable
Enclosing class:
MoteLimeTupleSpace

private class MoteLimeTupleSpace.MotesReactionInterceptor
extends java.lang.Object
implements ReactionListener

This private class is used to convert a tuple that was requested with a reaction from the lime format to the lime.motes format (i.e. extracting the MoteID).

Version:
1.0 alpha
Author:
Carlo Curino, Matteo Giani, Marco Giorgetta, Alessandro Giusti

Field Summary
(package private)  MoteLimeTemplate lt
          The template we'll react to.
(package private)  ReactionListener realListener
          The listener we will return the tuple to.
 
Constructor Summary
MoteLimeTupleSpace.MotesReactionInterceptor(MoteLimeTemplate ml, ReactionListener rl)
          Parameter is the real listener that will be returned of the tuple once the MoteID has been popped out of the tuple.
 
Method Summary
 void reactsTo(ReactionEvent e)
          This method must extract the MoteID from the returned tuple, and create a ReactionEvent that will be returned to the real listener.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

realListener

ReactionListener realListener
The listener we will return the tuple to.


lt

MoteLimeTemplate lt
The template we'll react to.

Constructor Detail

MoteLimeTupleSpace.MotesReactionInterceptor

public MoteLimeTupleSpace.MotesReactionInterceptor(MoteLimeTemplate ml,
                                                   ReactionListener rl)
Parameter is the real listener that will be returned of the tuple once the MoteID has been popped out of the tuple.

Parameters:
rl - the Reactionlistener that sill be returned of the tuple.
Method Detail

reactsTo

public void reactsTo(ReactionEvent e)
This method must extract the MoteID from the returned tuple, and create a ReactionEvent that will be returned to the real listener.

Specified by:
reactsTo in interface ReactionListener
Parameters:
e - the reaction event that contains a tuple that includes the MoteID, which will be taken out of the tuple.