|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object lime.LimeTupleSpace lime.motes.MoteLimeTupleSpace
This class, MotesLimeTupleSpace
, extends the LimeTupleSpace
class, overriding the conventional operations in order to adapt them to the semantic
they have when working with sensor networks.
StationaryAgent
,
Location
,
Reaction
,
ReactionListener
,
LimeTupleSpace
,
Serialized FormNested Class Summary | |
private class |
MoteLimeTupleSpace.MotesReactionInterceptor
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. |
Field Summary | |
private LimeTupleSpace |
inLTS
Variable used to "receive" the tuples from the motes. |
private LimeTupleSpace |
outLTS
Variable used to out the config tuples. |
private MoteLimeTuple |
reactionResult
This tuple is returned when performing a rdp with the reaction |
private java.util.HashMap |
reactions_pool
This is a Vector that stores all the templates we are reacting to. |
private int |
sensingTimeout
This value means how long the MoteAccess reads data from the network in a rdg. |
private static int |
SLEEPING_TIME
This value represent the rate at which |
Fields inherited from class lime.LimeTupleSpace |
DEFAULT, SYSTEM |
Constructor Summary | |
MoteLimeTupleSpace(java.lang.String name)
Constructor that instantiate both the data tuple space and the
|
Method Summary | |
RegisteredReaction[] |
addWeakReaction(Reaction[] reactions)
This method adds an array of weak reactions to the tuple space. |
private MoteRegisteredReaction |
buildMrrFromRr(RegisteredReaction rr)
This method builds a MoteRegisteredReaction from a RegisteredReaction that contains the MoteID in the template. |
private RequestID |
generateRequestID(java.lang.Object o)
Helper method used to generate a unique request id. |
RegisteredReaction[] |
getRegisteredReactions()
This method returns an array of MoteRegisteredReaction that contains all the reactions registered by any user on this MotesLimeTupleSpace. |
int |
getSensingTimeout()
Getter for the sensing timeout. |
LimeTuple |
in(LimeTemplate template)
As explained and motivated in the documentation, this method always throws a MotesIllegalOperationException when trying to remove sensig data tuples, since we consider not appropriate to remove from the tuple space a tuple that indicates a property of the environment, such as the temperature or the light status. |
LimeTuple[] |
ing(LimeTemplate template)
As explained and motivated in the documentation, this method always throws a MotesIllegalOperationException, since we consider not appropriate to remove from the tuple space a tuple that indicates a property of the environment, such as the temperature or the light status. |
LimeTuple |
inp(LimeTemplate template)
As explained and motivated in the documentation, this method always throws a MotesIllegalOperationException, since we consider not appropriate to remove from the tuple space a tuple that indicates a property of the environment, such as the temperature or the light status. |
LimeTuple |
out(lights.interfaces.ITuple tuple)
The out operation is forbidden, just like the in; see the documentation for more detailed information and motivation. |
LimeTuple |
rd(LimeTemplate template)
This method performs the read operation on the sensor network. |
LimeTuple[] |
rdg(LimeTemplate template)
This method performs the readg operation on the sensor network. |
LimeTuple |
rdp(LimeTemplate template)
This method performs the readp operation on the sensor network. |
void |
reactsTo(ReactionEvent e)
This implementation of the reactsTo method is used when we are reacting to tuples requested with the rd method. |
void |
removeWeakReaction(RegisteredReaction[] reactions)
The reactions passed as parameters are removed from the sensor network. |
void |
setBuzzer()
This method makes the reachable motes buzz. |
void |
setDutyCycle(int awake_percentage)
Setter of the Awake fraction |
void |
setMotesMode(int mode)
Setter for the Mote automatic mode. |
void |
setRadioPower(int power)
Setter of the Power of the radio of the motes, to be used when in manaul mode. |
void |
setSensingTimeout(int sensingTimeout)
Setter for the sensing timout represent the maximum time waited for a motes to answer before declering it unreacheable |
boolean |
setShared(boolean shared)
Enable or disable transient sharing of this tuple space with tuple spaces having the same name. |
Methods inherited from class lime.LimeTupleSpace |
addStrongReaction, cloneTuple, cloneTuple, getName, isOwner, isRegisteredReaction, isShared, out, outg, print, removeStrongReaction, setShared |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
private static final int SLEEPING_TIME
private LimeTupleSpace outLTS
private LimeTupleSpace inLTS
private MoteLimeTuple reactionResult
private int sensingTimeout
private java.util.HashMap reactions_pool
Constructor Detail |
public MoteLimeTupleSpace(java.lang.String name) throws TupleSpaceEngineException, IllegalTupleSpaceNameException
data tuple space and the
config tuple space, called name
_CONFIG
- Throws:
TupleSpaceEngineException
IllegalTupleSpaceNameException
Method Detail |
public LimeTuple in(LimeTemplate template) throws TupleSpaceEngineException
in
in class LimeTupleSpace
template
- template the returned tuple must be matched against.
MotesIllegalOperationException.
TupleSpaceEngineException
- if a problem is encountered in the
underlying tuple space engine.public LimeTuple inp(LimeTemplate template) throws TupleSpaceEngineException
inp
in class LimeTupleSpace
template
- template the returned tuple must be matched against
TupleSpaceEngineException
- if a problem is encountered in the
underlying tuple space engine.public LimeTuple[] ing(LimeTemplate template)
ing
in class LimeTupleSpace
template
- template the returned tuple must be matched against.
public LimeTuple rd(LimeTemplate template) throws TupleSpaceEngineException
rd
in class LimeTupleSpace
template
- this template must be an instance of MotesLimeTemplate.
TupleSpaceEngineException
- if the passed template is not a MotesLimeTemplate.public RegisteredReaction[] getRegisteredReactions()
getRegisteredReactions
in class LimeTupleSpace
private MoteRegisteredReaction buildMrrFromRr(RegisteredReaction rr)
rr
- the lime RegisteredReaction from which we exctract the MoteID.
public LimeTuple rdp(LimeTemplate template) throws TupleSpaceEngineException
rdp
in class LimeTupleSpace
template
- this template must be an instance of MotesLimeTemplate.
TupleSpaceEngineException
- if the passed template is not a MotesLimeTemplate.public LimeTuple[] rdg(LimeTemplate template) throws TupleSpaceEngineException
rdg
in class LimeTupleSpace
template
- this template must be an instance of MotesLimeTemplate.
TupleSpaceEngineException
- if the passed template is not a MotesLimeTemplate.public LimeTuple out(lights.interfaces.ITuple tuple) throws TupleSpaceEngineException
out
in class LimeTupleSpace
tuple
- the tuple to be inserted.
TupleSpaceEngineException
- if a problem is encountered in the
underlying tuple space engine.public RegisteredReaction[] addWeakReaction(Reaction[] reactions) throws TupleSpaceEngineException
addWeakReaction
in class LimeTupleSpace
reactions
- the array of reactions that will be registered.
TupleSpaceEngineException
private RequestID generateRequestID(java.lang.Object o)
public void removeWeakReaction(RegisteredReaction[] reactions) throws TupleSpaceEngineException, NoSuchReactionException
removeWeakReaction
in class LimeTupleSpace
reactions
- the reactions to be removed.
TupleSpaceEngineException
NoSuchReactionException
public boolean setShared(boolean shared)
LimeTupleSpace
Note: setting a tuple space to shared is different from calling engage on the LimeServer. setShared operates only on the public/private status of a tuple space while engage/disengage operate on the status of the host which is holding the tuple spaces.
setShared
in class LimeTupleSpace
shared
- true
to set the tuple spaces to shared,
false
to set it to private.
true
if the tuple space is successfully
engaged/disengaged.public int getSensingTimeout()
public void setSensingTimeout(int sensingTimeout)
sensingTimeout
- the new value of the sensing timeout.public void setBuzzer()
public void setMotesMode(int mode)
public void setRadioPower(int power)
public void setDutyCycle(int awake_percentage)
awake_percentage
- represent the qoute of the cycle that the motes stays up.public void reactsTo(ReactionEvent e)
reactsTo
in interface ReactionListener
e
- the reaction event containing the tuple which will be extracted of
the MoteID and then assigned to the reactionResult variable.
Then a notify is performed in order to awake the threads that are waiting for
a tuple (typically the rd function call).
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |