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.


Constructor Index

 o Space()
Default constructor.

Method Index

 o getObjectSpace()
Returns the Jada object space used for this Space.
 o getSpaceName()
Returns the current tuple space name.
 o in(Tuple)
Performs a request for withdrawing a tuple from this space.
 o inAll(Tuple)
Returns every tuple in this space that matches the given template.
 o join(String)
Name managing method.
 o leave()
Name managing method.
 o leaveAll()
Name managing method.
 o list()
 o out(Tuple)
Inserts a tuple in this space.
 o read(Tuple)
Performs a request for reading a tuple from this space.
 o readAll(Tuple)
Returns every tuple in this space that matches the given template.

Constructors

 o Space
 public Space()
Default constructor. Builds a new local Space object.

Methods

 o 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
 o 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
 o 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.
 o 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.
 o 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.
 o 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
 o 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
 o 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
 o getSpaceName
 public SpaceName getSpaceName()
Returns the current tuple space name.

Returns:
the current tuple space name.
See Also:
SpaceName
 o list
 public void list()
 o 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