Interface SemiSpaceInterface
- All Known Implementing Classes:
SemiSpace
public interface SemiSpaceInterface
Operations possible to perform on space, inspired by the JavaSpace interface.
-
Method Summary
Modifier and TypeMethodDescriptionnotify(Object template, SemiEventListener<? extends SemiEvent> listener, long duration) Register a listener for a particular template search.<T> Tread(T template, long duration) Read an object from the space, which has matching fields (or getters) with the template<T> TreadIfExists(T template) Same as read, with duration 0<T> Ttake(T template, long duration) Same as read, except that the object is removed from the space.<T> TtakeIfExists(T template) Same as take, with a duration of 0Write object into tuple space, with a lifetime given in ms.
-
Method Details
-
write
-
read
<T> T read(T template, long duration) Read an object from the space, which has matching fields (or getters) with the template- Parameters:
template- Object of exactly the same type as what is wanted as return value, with zero or more none-null fields or getters.duration- How long you are willing to wait for an answer / match.- Returns:
- An object when matches the template, or null of none are found.
-
readIfExists
<T> T readIfExists(T template) Same as read, with duration 0- See Also:
-
take
<T> T take(T template, long duration) Same as read, except that the object is removed from the space.- See Also:
-
takeIfExists
<T> T takeIfExists(T template) Same as take, with a duration of 0- See Also:
-
notify
SemiEventRegistration notify(Object template, SemiEventListener<? extends SemiEvent> listener, long duration) Register a listener for a particular template search.- Parameters:
template- Template to be matched.listener- Listener to be notified when object with a matching template is foundduration- How long this particular listener is valid.- Returns:
- An event registration or null
-