All Packages Class Hierarchy This Package Previous Next Index
Class macondo.mistero.Space
macondo.mistero.Space
- public class Space
This class represents the coordination medium used by Macondo
clients. It supports multiple nested tuple spaces with Linda-like
operations.
-
Space()
- Default constructor.
-
getObjectSpace()
- Returns the Jada object space used for this
Space
.
-
getSpaceName()
- Returns the current tuple space name.
-
in(Tuple)
- Performs a request for withdrawing a tuple from this space.
-
inAll(Tuple)
- Returns every tuple in this space that matches the given template.
-
join(String)
- Name managing method.
-
leave()
- Name managing method.
-
leaveAll()
- Name managing method.
-
list()
-
-
out(Tuple)
- Inserts a tuple in this space.
-
read(Tuple)
- Performs a request for reading a tuple from this space.
-
readAll(Tuple)
- Returns every tuple in this space that matches the given template.
Space
public Space()
- Default constructor. Builds a new local
Space
object.
in
public final Result in(Tuple formal)
- Performs a request for withdrawing a tuple from this space.
- Parameters:
- formal - the tuple requested.
- Returns:
- a
Result
object used as a placeholder
for the result of this request.
- See Also:
- Result
read
public final Result read(Tuple formal)
- Performs a request for reading a tuple from this space.
- Parameters:
- formal - the tuple requested.
- Returns:
- a
Result
object uset as a placeholder
for the result of this request.
- See Also:
- Result
inAll
public final Enumeration inAll(Tuple formal)
- Returns every tuple in this space that matches the given template.
Matching tuples are removed from the space.
- Parameters:
- formal - the template for requested tuples.
- Returns:
- an enumeration of all tuples in this space
that match the given template.
readAll
public final Enumeration readAll(Tuple formal)
- Returns every tuple in this space that matches the given template.
- Parameters:
- formal - the template for requested tuples.
- Returns:
- an enumeration of all tuples in this space
that match the given template.
out
public final void out(Tuple tuple)
- Inserts a tuple in this space.
- Parameters:
- tuple - the tuple to insert in this space.
- Throws: SpaceException
- thrown if an I/O error occurs.
join
public void join(String name_items)
- Name managing method.
Moves to the referenced tuple space, specified by its name, from
the current one. Since tuple spaces are nested, names are expressed
like directory names in a UNIX file system. For instance "/space",
"/chapter/section" are valid names.
If current tuple space has name "/space1" and this method is
called with argument "space2", then following operations are performed
on space "/space1/space2".
Name items can be specified as relative paths but also as absolute
paths. For instance, if current tuple space is "/working_space" and
join
is called with argument "/games_space", the
resulting space is "/games_space".
It is also possible moving to the encompassing space specifying
".." as the join
argument.
Finally, a name can have multiple items like "space2/space3".
- Parameters:
- name_items - the tuple space name items.
- See Also:
- join, leave, leaveAll
leave
public void leave()
- Name managing method.
Moves to the encompassing space in the coordination structure.
It is equivalent to
join("..")
.
- See Also:
- leave, join, leaveAll
leaveAll
public void leaveAll()
- Name managing method.
Moves to the root space in the coordination structure.
It is equivalent to
join("/")
.
- See Also:
- leaveAll, join, leave
getSpaceName
public SpaceName getSpaceName()
- Returns the current tuple space name.
- Returns:
- the current tuple space name.
- See Also:
- SpaceName
list
public void list()
getObjectSpace
public ObjectSpace getObjectSpace()
- Returns the Jada object space used for this
Space
.
- Returns:
- the Jada object space used for this
Space
.
All Packages Class Hierarchy This Package Previous Next Index