All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.tspaces.TupleSpace
java.lang.Object
|
+----com.ibm.tspaces.TupleSpace
- public class TupleSpace
- extends Object
A TupleSpace is a shared named collection (bag) of
Tuples. The
basic operations supported by the collection are to add a Tuple
to the space (write), and to remove one from the space (take).
The collection is stored and administered across a network on one
or more "Tuple Space Servers". Several threads on the same or
different machines can be accessing the space simultaneously. Some
will be adding tuples to the space and some removing them.
A client thread accesses the collection/space using the methods of
an instance of this class. For each different Tuple Space a client
wishes to access, it requires a separate instance of this class,
even if they are managed by the same server. The details of how the
operations are completed are hidden from the user. All they need is
the name of the space, and the name of a server that manages that
space.
The primitive operations supported by the space are:
- write( tuple ) Adds a tuple to the space.
- take( template tuple ) Performs an associative search for a tuple that
matches the template. When found, the tuple is removed
from the space and returned. If none is found, returns null.
- waitToTake( template tuple ) Performs an associative search for a tuple
that matches the template. Blocks until
match is found. Removes and returns the
matched tuple from the space.
- read( template tuple ) Like "take" above, except that the tuple
is not removed from the tuple space.
- waitToRead( template tuple ) Like "waitToTake" above, except that the tuple
is not removed from the tuple space.
- scan( template tuple ) Like "read" above, except returns the entire set of
tuples that match.
- count( template tuple ) Like "scan" above, except that it returns a count of
matching tuples rather than the set of tuples itself.
- Author:
- Daniel Ford, Toby Lehman, Peter Wyckoff, Stephen McLaughry, John Thomas
- See Also:
- Field, Tuple, CallbackThread, TSIOHandler, Waiter, Semaphore
-
_ADMIN_TSNAME
- the name of the admin tuple space.
-
_DEBUG
- debug mode
-
_DEBUG_COMMUNICATION
-
-
_DEFAULT_DBTYPE
-
-
_DEFAULT_INDEX_FIELD
-
-
_DEFAULT_PASSWORD
-
-
_DEFAULT_PERSISTENCE
- Whether a tuple space is persistent by default and its index -1 indicates no index and what type
-
_DEFAULT_USER
- This is what is used if no user/password is specified
-
_echo
- If true then print the progess of each operation on standard out.
-
_GALAXY_TSNAME
- the galaxy tuple space name.
-
_isPersistent
- is this tuple space persistent?
-
_password
- The password for this space.
-
_TOP_GROUP
- the default top group that everyone is a part of.
-
_tsName
- The name of the tuple space.
-
_tsPort
- The port for this space's server.
-
_tsServer
- The name of the machine running the TupleSpace server
-
_userName
-
The username for this space.
-
_userNameAlreadyUsed
- A flag to make sure we don't change the username after the connection has been
verified.
-
_VERSION
- Code Version.Level.Modification
Change this when a new level of code is to be released
-
ABORT
- The string used to signal an abort operation.
-
ADDFACTORY
-
-
ADDHANDLER
-
-
CMD_TUP
-
-
CONSUMINGSCAN
-
-
COUNT
-
-
DEFAULTCONNECTTRIES
- the number of times to try to connect to the server before raising an exception to the
caller.
-
DEFAULTHOST
- The default name of the machine running the TupleSpace server.
-
DEFAULTNAME
- The default name of a TupleSpace if one isn't specified.
-
DEFAULTPORT
- The default port number used to connect to the TupleSpace server
if a port number isn't specified (the usual case).
-
DELETE
-
-
DELETEALL
-
-
EVENT_ACTION_FLD
-
-
EVENT_COMMAND_FLD
- the fields of an event tuple, keep with the making of the event templates until things
stabilize pw.
-
EVENT_DEREGISTER
-
-
EVENT_EAT_FLD
-
-
EVENT_REGISTER
-
-
EVENT_SEQ_FLD
-
-
EVENT_TUPLE_FLD
-
-
EXCEPTION
- The string used between the server and tspace library to signal a problem.
-
INDEXFIELD
-
-
OK
- The string used between the server to signal good
the operation completely normally.
-
PERSISTENCE
-
configuration field names.
-
READ
-
-
RHONDA
-
-
SCAN
- Other commands
-
SCANALL
-
-
SEQ_NUM
- obsolete
public static final String _ADD_USER = "/ac/addUser";
public static final String _DEL_USER = "/ac/rmUser";
public static final String _ADD_GROUP = "/ac/addGroup";
public static final String _DEL_GROUP = "/ac/rmGroup";
public static final String _LIST_GROUPS = "/ac/loadGroupDB";
public static final String _LIST_USERS = "/ac/loadUserDB";
public static final String _LIST_A_GROUPS_USERS = "/ac/getuserMembers";
public static final String _LIST_A_USERS_GROUPS = "/ac/getSupergroups";
public static final String _ADD_USER_TO_GROUP = "/ac/addSupergroupToUser";
public static final String _DEL_USER_FROM_GROUP ="/ac/rmSupergroupFromUser";
-
SETCONFIGURATION
-
-
STATUS
-
-
TAKE
-
-
TS_ARG
-
-
TS_CMD
-
-
TS_NAME
-
-
TS_RETURN_VALUE
-
-
TS_STATUS_CODE
-
-
TSCREATE
-
-
TSDBTYPE
-
-
TSDESTROY
-
-
TSEXISTS
-
-
WAITTOREAD
-
-
WAITTOTAKE
-
-
WRITE
-
-
TupleSpace()
- Create a default tuple space.
-
TupleSpace(String)
- Create a named Tuple Space.
-
TupleSpace(String, String)
- Create a named Tuple Space to be stored and managed by a specified
Tuple Space Server.
-
TupleSpace(String, String, int)
- Create a named Tuple Space to be stored and managed by a specified
Tuple Space Server.
-
TupleSpace(String, String, int, String, String)
- Create a named Tuple Space to be stored and managed by a specified
Tuple Space Server.
-
TupleSpace(String, String, int, Tuple)
- Create a named Tuple Space to be stored and managed by a specified
Tuple Space Server.
-
TupleSpace(String, String, int, Tuple, String, String)
- Create a named Tuple Space to be stored and managed by a specified
Tuple Space Server.
-
TupleSpace(String, String, int, Tuple, Tuple)
- Create a named Tuple Space to be stored and managed by a specified
Tuple Space Server.
-
TupleSpace(String, String, int, Tuple, Tuple, String, String)
- Create a named Tuple Space to be stored and managed by a specified
Tuple Space Server.
-
TupleSpace(String, String, String)
- Create a named Tuple Space.
-
TupleSpace(String, String, String, String)
- Create a named Tuple Space to be stored and managed by a specified
Tuple Space Server.
-
TupleSpace(String, String, Tuple)
- Create a named Tuple Space to be stored and managed by a specified
Tuple Space Server.
-
TupleSpace(String, String, Tuple, String, String)
- Create a named Tuple Space to be stored and managed by a specified
Tuple Space Server.
-
TupleSpace(String, Tuple)
- Create a named Tuple Space.
-
TupleSpace(String, Tuple, String, String)
- Create a named Tuple Space.
-
TupleSpace(Tuple)
- Create a default tuple space.
-
addFactory(Class[])
- NOT SUPPORTED ON THE SERVER IN VERSION 1.0.1
add a new factory to this tuple space as the topmost (most powerful) factory.
-
addHandler(String, Class[])
-
NOT SUPPORTED ON THE SERVER IN VERSION 1.0.1
Add a new handler to this tuple space.
-
cleanup()
- this method is used to close the current connections to the server.
-
command(String, SuperTuple)
- Issue a command to the TupleSpace and pass along a Tuple as an argument.
-
connectionTries(int)
- Set the connectionTries to a new value.
-
connectionWaitTime(int)
- Set the connectionWaitTime to a new value.
-
consumingScan(Serializable)
- Retrieve and delete all Tuples from the space that match a Tuple
template.
-
consumingScan(Serializable, Serializable)
- Retrieve and delete all Tuples from the space that match a Tuple
template.
-
consumingScan(Serializable, Serializable, Serializable)
- Retrieve and delete all Tuples from the space that match a Tuple
template.
-
consumingScan(SuperTuple)
- Retrieve and delete all Tuples from the space that match a Tuple
template.
-
count(SuperTuple)
- Count all tuples from the space that match a Tuple
template.
-
countN(SuperTuple)
- Count all tuples from the space that match a Tuple
template.
-
createTupleSpace(String, String, int, Tuple, Tuple)
- create a tuple space
A configuration tuple looks like:
Tuple( new Field(TupleSpace.PERSISTENCE, new Boolean( true)),
new Field(TupleSpace.INDEXFIELD, new Integer(-1)),
new Field(TupleSpace.TSDBTYPE, new String( TSSmall.Small_DB or TSMMDB.MM_DB)))
Any of the fields can be left out and ordering doesn't matter.
Deprecated.
-
createTupleSpace(String, Tuple, Tuple)
- create a tuple space given a name for the space and configuration information in the configuration tuple.
Deprecated.
-
delete(SuperTuple)
- Delete all tuples that match this template.
-
deleteAll()
- Delete all tuples in a space.
-
destroy()
-
-
eventRegister(String, SuperTuple, Callback)
- Register for an event on the server.
-
eventTemplate(String, SuperTuple, Class)
-
-
exists()
-
-
getFactoryStack()
-
Return a scan of all the factory names for this tuple space and their level numbers --- level 0 is the
highest --- most recently added --- factory.
-
getHandlerCommandNames(String)
-
Return a scan of all the handler names for this factory ---
this feature is *NOT* supported for the built in commands --- TSFSmallTS handlers.
-
getName()
- Return the space name.
-
getPort()
- Return the number of the port.
-
getServer()
- Return the name of the server.
-
getVersion()
- Class Method to Return the TSpaces Code Version number.
-
in(Serializable)
- Retrieve a tuple from the space that has one Field matching
the Serializables.
Deprecated.
-
in(Serializable, Serializable)
- Retrieve a tuple from the space that has two Fields matching
specified Serializables.
Deprecated.
-
in(Serializable, Serializable, Serializable)
- Retrieve a tuple from the space that has three Fields matching
specified Serializables.
Deprecated.
-
in(Tuple)
- Retrieve a tuple from the space that matches a Tuple
template.
Deprecated.
-
inp(Serializable)
- Retrieve a tuple from the space that has one Field matching
the Serializables.
Deprecated.
-
inp(Serializable, Serializable)
- Retrieve a tuple from the space that has two Fields matching
specified Serializables.
Deprecated.
-
inp(SuperTuple)
- Retrieve a tuple from the space that matches a Tuple
template.
Deprecated.
-
isValidTSName(String)
-
-
killConnection(String, Exception)
- this method is used to close the current connection to the server.
-
main(String[])
- Test routine.
-
makeJarFile(Class[])
- For all the classes, if the class is in a jar file, grab the entire jar file
otherwise for plain .class classes ship them in their own .jar file.
-
out(Serializable)
- Add a Tuple to the Tuple Space that has a single field equal to the
Object.
Deprecated.
-
out(Serializable, Serializable)
- Add a Tuple to the Tuple Space that has two fields equal to the
Serializables passed in.
Deprecated.
-
out(Serializable, Serializable, Serializable)
- Add a Tuple to the Tuple Space that has two fields equal to the
Serializables passed in.
Deprecated.
-
out(Tuple)
- Add the Tuple to the Tuple Space.
Deprecated.
-
parseConfigTuple(String, SuperTuple)
-
-
read(Serializable)
- Retrieve a Tuple from the space that matches the Tuple
template.
-
read(Serializable, Serializable)
- Retrieve a Tuple from the space that matches the Tuple
template.
-
read(Serializable, Serializable, Serializable)
- Retrieve a Tuple from the space that matches the Tuple
template.
-
read(SubclassableTuple)
- Retrieve a Tuple from the space that matches the Tuple
template.
-
read(SuperTuple)
- Retrieve a Tuple from the space that matches the Tuple
template.
-
read(Tuple)
- Retrieve a Tuple from the space that matches the Tuple
template.
-
rhonda(Tuple, Tuple)
- The rendevous primitive.
-
scan(Serializable)
- Retrieve all Tuples from the space that match a Tuple
template.
-
scan(Serializable, Serializable)
- Retrieve all Tuples from the space that match a Tuple
template.
-
scan(Serializable, Serializable, Serializable)
- Retrieve all Tuples from the space that match a Tuple
template.
-
scan(SuperTuple)
- Retrieve all Tuples from the space that match a Tuple
template.
-
setClosingDownByForcingFinalizers(boolean)
- should the TupleSpace force finalizers to be run on exit? this method
has some security checking on it, so when running in netscape this should
be set to false.
-
setUserName(String, String)
- Set username to be used for access control on this tuplespace
-
status(String, int)
-
-
take(Serializable)
- Retrieve a Tuple from the space that has one Field matching
the Serializables.
-
take(Serializable, Serializable)
- Retrieve a tuple from the space that has two Fields matching
specified Serializables.
-
take(Serializable, Serializable, Serializable)
- Retrieve a tuple from the space that has three Fields matching
specified Serializables.
-
take(SubclassableTuple)
- Retrieve a tuple from the space that matches a Tuple
template.
-
take(SuperTuple)
- Retrieve a tuple from the space that matches a Tuple
template.
-
take(Tuple)
- Retrieve a tuple from the space that matches a Tuple
template.
-
waitToRead(Serializable)
- Retrieve a Tuple from the space that matches the Tuple
template.
-
waitToRead(Serializable, Serializable)
- Retrieve a Tuple from the space that matches the Tuple
template.
-
waitToRead(Serializable, Serializable, Serializable)
- Retrieve a Tuple from the space that matches the Tuple
template.
-
waitToRead(SubclassableTuple)
- Retrieve a Tuple from the space that matches the Tuple
template.
-
waitToRead(SuperTuple)
- Retrieve a Tuple from the space that matches the Tuple
template.
-
waitToRead(Tuple)
- Retrieve a Tuple from the space that matches the Tuple
template.
-
waitToTake(Serializable)
- Retrieve a tuple from the space that has one Field matching
the Serializables.
-
waitToTake(Serializable, Serializable)
- Retrieve a tuple from the space that has two Fields matching
specified Serializables.
-
waitToTake(Serializable, Serializable, Serializable)
- Retrieve a tuple from the space that has three Fields matching
specified Serializables.
-
waitToTake(SubclassableTuple)
- Retrieve a tuple from the space that matches a Tuple
template.
-
waitToTake(SuperTuple)
- Retrieve a tuple from the space that matches a Tuple
template.
-
waitToTake(Tuple)
- Retrieve a tuple from the space that matches a Tuple
template.
-
write(Serializable)
- Add a Tuple to the Tuple Space that has a single field equal to the
Object.
-
write(Serializable, Serializable)
- Add a Tuple to the Tuple Space that has two fields equal to the
Objects passed in.
-
write(Serializable, Serializable, Serializable)
- Add a Tuple to the Tuple Space that has two fields equal to the
Serializables passed in.
-
write(SuperTuple)
- Add the Tuple to the Tuple Space.
_VERSION
public static final String _VERSION
- Code Version.Level.Modification
Change this when a new level of code is to be released
_DEFAULT_PERSISTENCE
public static final boolean _DEFAULT_PERSISTENCE
- Whether a tuple space is persistent by default and its index -1 indicates no index and what type
_DEFAULT_INDEX_FIELD
public static final int _DEFAULT_INDEX_FIELD
_DEFAULT_DBTYPE
public static final String _DEFAULT_DBTYPE
DEFAULTNAME
public static final String DEFAULTNAME
- The default name of a TupleSpace if one isn't specified.
DEFAULTPORT
public static final int DEFAULTPORT
- The default port number used to connect to the TupleSpace server
if a port number isn't specified (the usual case).
DEFAULTHOST
public static final String DEFAULTHOST
- The default name of the machine running the TupleSpace server.
EXCEPTION
public static final String EXCEPTION
- The string used between the server and tspace library to signal a problem.
Not normally referenced by a user.
OK
public static final String OK
- The string used between the server to signal good
the operation completely normally.
Not normally referenced by a user.
PERSISTENCE
public static final String PERSISTENCE
- configuration field names.
Persitence can be true or false
IndexField is for TSSmallDB, -1 indicates no index and is the default.
TSDbType can be TSSmallDB.SMALL_DB or TSMMDB.MM_DB.
INDEXFIELD
public static final String INDEXFIELD
TSDBTYPE
public static final String TSDBTYPE
_GALAXY_TSNAME
public static final String _GALAXY_TSNAME
- the galaxy tuple space name.
This used to be in TSServer, but it is here now as the client may want to make
operations on the galaxy ts so need to know it here, but don't want to have any
dependence on the Server code from the client. Maybe later can make some common file
Also, don't want users to use this. Only the system should be using it!!!!
_ADMIN_TSNAME
public static final String _ADMIN_TSNAME
- the name of the admin tuple space. Here for the same reasons as the Galaxy name.
users please don't use it.
WRITE
public static final String WRITE
TAKE
public static final String TAKE
READ
public static final String READ
WAITTOTAKE
public static final String WAITTOTAKE
WAITTOREAD
public static final String WAITTOREAD
SCAN
public static final String SCAN
- Other commands
CONSUMINGSCAN
public static final String CONSUMINGSCAN
SCANALL
public static final String SCANALL
COUNT
public static final String COUNT
DELETE
public static final String DELETE
DELETEALL
public static final String DELETEALL
TSEXISTS
public static final String TSEXISTS
EVENT_REGISTER
public static final String EVENT_REGISTER
EVENT_DEREGISTER
public static final String EVENT_DEREGISTER
STATUS
public static final String STATUS
ADDFACTORY
public static final String ADDFACTORY
ADDHANDLER
public static final String ADDHANDLER
SETCONFIGURATION
public static final String SETCONFIGURATION
TSCREATE
public static final String TSCREATE
TSDESTROY
public static final String TSDESTROY
ABORT
public static final String ABORT
- The string used to signal an abort operation. For now only the server should
be doing an abort as each operation is a transaction, but the server will not
stop the client from using abort to reinsert a TAKE or WAITTOTAKE tuple back into tuple space.
RHONDA
public static final String RHONDA
SEQ_NUM
public static final int SEQ_NUM
- obsolete
public static final String _ADD_USER = "/ac/addUser";
public static final String _DEL_USER = "/ac/rmUser";
public static final String _ADD_GROUP = "/ac/addGroup";
public static final String _DEL_GROUP = "/ac/rmGroup";
public static final String _LIST_GROUPS = "/ac/loadGroupDB";
public static final String _LIST_USERS = "/ac/loadUserDB";
public static final String _LIST_A_GROUPS_USERS = "/ac/getuserMembers";
public static final String _LIST_A_USERS_GROUPS = "/ac/getSupergroups";
public static final String _ADD_USER_TO_GROUP = "/ac/addSupergroupToUser";
public static final String _DEL_USER_FROM_GROUP ="/ac/rmSupergroupFromUser";
CMD_TUP
public static final int CMD_TUP
EVENT_COMMAND_FLD
public static final int EVENT_COMMAND_FLD
- the fields of an event tuple, keep with the making of the event templates until things
stabilize pw. The 0th field is TupleSpace.ANEVENT
EVENT_TUPLE_FLD
public static final int EVENT_TUPLE_FLD
EVENT_SEQ_FLD
public static final int EVENT_SEQ_FLD
EVENT_ACTION_FLD
public static final int EVENT_ACTION_FLD
EVENT_EAT_FLD
public static final int EVENT_EAT_FLD
_DEFAULT_USER
public static final String _DEFAULT_USER
- This is what is used if no user/password is specified
_DEFAULT_PASSWORD
public static final String _DEFAULT_PASSWORD
TS_NAME
public static final int TS_NAME
TS_CMD
public static final int TS_CMD
TS_ARG
public static final int TS_ARG
TS_STATUS_CODE
public static final int TS_STATUS_CODE
TS_RETURN_VALUE
public static final int TS_RETURN_VALUE
_DEBUG
public static boolean _DEBUG
- debug mode
_DEBUG_COMMUNICATION
public static boolean _DEBUG_COMMUNICATION
_echo
protected static boolean _echo
- If true then print the progess of each operation on standard out.
DEFAULTCONNECTTRIES
protected static final int DEFAULTCONNECTTRIES
- the number of times to try to connect to the server before raising an exception to the
caller. Would probably be nice in the future if this was an instance variable rather than
static.
_TOP_GROUP
public static final String _TOP_GROUP
- the default top group that everyone is a part of. Useful for basic ops which everyone should
be able to do, like reading access permissions.
_isPersistent
protected boolean _isPersistent
- is this tuple space persistent?
_tsName
protected String _tsName
- The name of the tuple space.
_tsServer
protected String _tsServer
- The name of the machine running the TupleSpace server
_tsPort
protected int _tsPort
- The port for this space's server.
_userName
protected String _userName
- The username for this space.
_password
protected String _password
- The password for this space.
_userNameAlreadyUsed
protected boolean _userNameAlreadyUsed
- A flag to make sure we don't change the username after the connection has been
verified.
TupleSpace
public TupleSpace() throws TupleSpaceException
- Create a default tuple space. The server is assumed to be on the same
host (localhost) and the name of the space is the deafult name ("foo").
Connections to the server will be made on the default port (8200).
- Throws: TupleSpaceException
- If there is a problem creating the space
on the server or communicating with the server or there is a problem
with the TupleSpaceName. Currently if access control permissions are
not being set for a space the server will not be contacted upon
creating a TupleSpace object, but that may change in the future.
TupleSpace
public TupleSpace(Tuple configuration_) throws TupleSpaceException
- Create a default tuple space. The server is assumed to be on the same
host (localhost) and the name of the space is the deafult name ("foo").
Connections to the server will be made on the default port (8200).
create it with the specified configuration.
A configuration tuple looks like:
Tuple( new Field( TupleSpace.PERSISTENCE, new Boolean( true)),
new Field(TupleSpace.INDEXFIELD, new Integer(-1)))
new Field(TupleSpace.TSDBTYPE, new String( TSSmall.Small_DB or TSMMDB.MM_DB)))
- Parameters:
- configuration_ - the tuple with configuration info in it
- Throws: TupleSpaceException
- if there is a problem setting up the configuration
TupleSpace
public TupleSpace(String name_) throws TupleSpaceException
- Create a named Tuple Space. The server is assumed to be on the same
host (localhost).
Connections to the server will be made on the default port (8200).
- Parameters:
- name_ - A character string that identifies the TupleSpace on
the default TupleSpaceServer.
- Throws: TupleSpaceException
- If there is a problem creating the space
on the server or communicating with the server or there is a problem
with the TupleSpaceName. Currently if access control permissions are
not being set for a space the server will not be contacted upon
creating a TupleSpace object, but that may change in the future.
TupleSpace
public TupleSpace(String name_,
String userName_,
String password_) throws TupleSpaceException
- Create a named Tuple Space. The server is assumed to be on the same
host (localhost).
Connections to the server will be made on the default port (8200).
- Parameters:
- name_ - A character string that identifies the TupleSpace on
the default TupleSpaceServer.
- userName_ - the name of the user for this space
- password_ - the password of the user
- Throws: TupleSpaceException
- If there is a problem creating the space
on the server or communicating with the server or there is a problem
with the TupleSpaceName. Currently if access control permissions are
not being set for a space the server will not be contacted upon
creating a TupleSpace object, but that may change in the future.
TupleSpace
public TupleSpace(String name_,
Tuple configuration_) throws TupleSpaceException
- Create a named Tuple Space. The server is assumed to be on the same
host (localhost).
Connections to the server will be made on the default port (8200).
A configuration tuple looks like:
Tuple( new Field( TupleSpace.PERSISTENCE, new Boolean( true)),
new Field(TupleSpace.INDEXFIELD, new Integer(-1)))
new Field(TupleSpace.TSDBTYPE, new String( TSSmall.Small_DB or TSMMDB.MM_DB)))
- Parameters:
- name_ - A character string that identifies the TupleSpace on
the default TupleSpaceServer.
- configuation_ - the configuration tuple
- Throws: TupleSpaceException
- if there is a problem setting up the configuration
TupleSpace
public TupleSpace(String name_,
Tuple configuration_,
String userName_,
String password_) throws TupleSpaceException
- Create a named Tuple Space. The server is assumed to be on the same
host (localhost).
Connections to the server will be made on the default port (8200).
A configuration tuple looks like:
Tuple( new Field( TupleSpace.PERSISTENCE, new Boolean( true)),
new Field(TupleSpace.INDEXFIELD, new Integer(-1)))
new Field(TupleSpace.TSDBTYPE, new String( TSSmall.Small_DB or TSMMDB.MM_DB)))
- Parameters:
- name_ - A character string that identifies the TupleSpace on
the default TupleSpaceServer.
- configuration_ - the configuration tuple
- userName_ - the name of the user for this space
- password_ - the password of the user
- Throws: TupleSpaceException
- If there is a problem creating the space
on the server or communicating with the server or there is a problem
with the TupleSpaceName. Currently if access control permissions are
not being set for a space the server will not be contacted upon
creating a TupleSpace object, but that may change in the future.
TupleSpace
public TupleSpace(String name_,
String tsServer_) throws TupleSpaceException
- Create a named Tuple Space to be stored and managed by a specified
Tuple Space Server.
Connections to the server will be made on the default port (8200).
- Parameters:
- name_ - A character string that identifies the TupleSpace on
the default TupleSpaceServer.
- tsServer_ - A string that identifies the TupleSpaceServer that
manages the TupleSpace.
- Throws: TupleSpaceException
- If there is a problem creating the space
on the server or communicating with the server or there is a problem
with the TupleSpaceName. Currently if access control permissions are
not being set for a space the server will not be contacted upon
creating a TupleSpace object, but that may change in the future.
TupleSpace
public TupleSpace(String name_,
String tsServer_,
String userName_,
String password_) throws TupleSpaceException
- Create a named Tuple Space to be stored and managed by a specified
Tuple Space Server.
Connections to the server will be made on the default port (8200).
- Parameters:
- name_ - A character string that identifies the TupleSpace on
the default TupleSpaceServer.
- tsServer_ - A string that identifies the TupleSpaceServer that
manages the TupleSpace.
- userName_ - the user's tspaces user name
- password_ - the user's password
- Throws: TupleSpaceException
- If there is a problem creating the space
on the server or communicating with the server or there is a problem
with the TupleSpaceName. Currently if access control permissions are
not being set for a space the server will not be contacted upon
creating a TupleSpace object, but that may change in the future.
TupleSpace
public TupleSpace(String name_,
String tsServer_,
Tuple configuration_) throws TupleSpaceException
- Create a named Tuple Space to be stored and managed by a specified
Tuple Space Server.
Connections to the server will be made on the default port (8200).
A configuration tuple looks like:
Tuple( new Field( TupleSpace.PERSISTENCE, new Boolean( true)),
new Field(TupleSpace.INDEXFIELD, new Integer(-1)))
new Field(TupleSpace.TSDBTYPE, new String( TSSmall.Small_DB or TSMMDB.MM_DB)))
- Parameters:
- name_ - A character string that identifies the TupleSpace on
the default TupleSpaceServer.
- tsServer_ - A string that identifies the TupleSpaceServer that
manages the TupleSpace.
- configuration_ - configuration tuple
- Throws: TupleSpaceException
- If there is a problem creating the space
on the server or communicating with the server or there is a problem
with the TupleSpaceName. Currently if access control permissions are
not being set for a space the server will not be contacted upon
creating a TupleSpace object, but that may change in the future.
TupleSpace
public TupleSpace(String name_,
String tsServer_,
Tuple configuration_,
String userName_,
String password_) throws TupleSpaceException
- Create a named Tuple Space to be stored and managed by a specified
Tuple Space Server.
Connections to the server will be made on the default port (8200).
A configuration tuple looks like:
Tuple( new Field( TupleSpace.PERSISTENCE, new Boolean( true)),
new Field(TupleSpace.INDEXFIELD, new Integer(-1)))
new Field(TupleSpace.TSDBTYPE, new String( TSSmall.Small_DB or TSMMDB.MM_DB)))
- Parameters:
- name_ - A character string that identifies the TupleSpace on
the default TupleSpaceServer.
- tsServer_ - A string that identifies the TupleSpaceServer that
manages the TupleSpace.
- configuration_ - configuration tuple
- userName_ - the user's tspaces user name
- password_ - the user's password
- Throws: TupleSpaceException
- If there is a problem creating the space
on the server or communicating with the server or there is a problem
with the TupleSpaceName. Currently if access control permissions are
not being set for a space the server will not be contacted upon
creating a TupleSpace object, but that may change in the future.
TupleSpace
public TupleSpace(String name_,
String tsServer_,
int tsPort_) throws TupleSpaceException
- Create a named Tuple Space to be stored and managed by a specified
Tuple Space Server. Connections to the server will be made on a specified
port.
- Parameters:
- name_ - A character string that identifies the TupleSpace on
the default TupleSpaceServer.
- tsServer_ - A string that identifies the TupleSpaceServer that
manages the TupleSpace.
- tsPort_ - The specific port that the TupleSpaceServer uses to
listen for connections from TupleSpace clients.
- Throws: TupleSpaceException
- If there is a problem creating the space
on the server or communicating with the server or there is a problem
with the TupleSpaceName. Currently if access control permissions are
not being set for a space the server will not be contacted upon
creating a TupleSpace object, but that may change in the future.
TupleSpace
public TupleSpace(String name_,
String tsServer_,
int tsPort_,
String userName_,
String password_) throws TupleSpaceException
- Create a named Tuple Space to be stored and managed by a specified
Tuple Space Server. Connections to the server will be made on a specified
port.
- Parameters:
- name_ - A character string that identifies the TupleSpace on
the default TupleSpaceServer.
- tsServer_ - A string that identifies the TupleSpaceServer that
manages the TupleSpace.
- tsPort_ - The specific port that the TupleSpaceServer uses to
listen for connections from TupleSpace clients.
- userName_ - the user's tspaces user name
- password_ - the user's password
- Throws: TupleSpaceException
- If there is a problem creating the space
on the server or communicating with the server or there is a problem
with the TupleSpaceName. Currently if access control permissions are
not being set for a space the server will not be contacted upon
creating a TupleSpace object, but that may change in the future.
TupleSpace
public TupleSpace(String name_,
String tsServer_,
int tsPort_,
Tuple configuration_) throws TupleSpaceException
- Create a named Tuple Space to be stored and managed by a specified
Tuple Space Server. Connections to the server will be made on a specified
port.
- Parameters:
- name_ - A character string that identifies the TupleSpace on
the default TupleSpaceServer.
- tsServer_ - A string that identifies the TupleSpaceServer that
manages the TupleSpace.
- tsPort_ - The specific port that the TupleSpaceServer uses to
listen for connections from TupleSpace clients.
- configuration_ - the configuration tuple for this space
- accessPermissions_ - the permissions for this space
This constructor calls the constructor with no configuration and then does
the configuration. The reason it is done this way is so that all the
TupleSpace constructors don't have to throw TupleSpaceException because of the
call to setConfig.
A configuration tuple looks like:
Tuple( new Field(TupleSpace.PERSISTENCE, new Boolean( true)),
new Field(TupleSpace.INDEXFIELD, new Integer(-1)),
new Field(TupleSpace.TSDBTYPE, new String( TSSmall.Small_DB or TSMMDB.MM_DB)))
Any of the fields can be left out and ordering doesn't matter. For fields that
are left out, the defaults --- true, -1, TSSmall_DB --- apply.
The accessPermision Tuple contains a single Field that contains an Acl
object, as defined in java.security.acl. One can construct an Acl with code
like the following.
Permissions[] p1 = {P_READ,P_WRITE};
Principal owner = ACLFactory.createPrincipal("Jim");
Principal grp = ACLFactory.createPrincipal("Jim");
Acl myacl = AclFactory("MyAcl",owner);
myacl.addEntry(owner,AclFactory.createAclEntry(owner,p1);
myacl.addEntry(owner,AclFactory.createAclEntry(grp,p1);
- Throws: TupleSpaceException
- If there is a problem creating the space
on the server or communicating with the server or there is a problem
with the TupleSpaceName. Currently if access control permissions are
not being set for a space the server will not be contacted upon
creating a TupleSpace object, but that may change in the future.
- See Also:
- Acl, AclFactory
TupleSpace
public TupleSpace(String name_,
String tsServer_,
int tsPort_,
Tuple configuration_,
String userName_,
String password_) throws TupleSpaceException
- Create a named Tuple Space to be stored and managed by a specified
Tuple Space Server. Connections to the server will be made on a specified
port.
- Parameters:
- name_ - A character string that identifies the TupleSpace on
the default TupleSpaceServer.
- tsServer_ - A string that identifies the TupleSpaceServer that
manages the TupleSpace.
- tsPort_ - The specific port that the TupleSpaceServer uses to
listen for connections from TupleSpace clients.
- configuration_ - the configuration tuple for this space
- accessPermissions_ - the permissions for this space
- userName_ - the user's tspaces user name
- password_ - the user's password
This constructor calls the constructor with no configuration and then does
the configuration. The reason it is done this way is so that all the
TupleSpace constructors don't have to throw TupleSpaceException because of the
call to setConfig.
A configuration tuple looks like:
Tuple( new Field(TupleSpace.PERSISTENCE, new Boolean( true)),
new Field(TupleSpace.INDEXFIELD, new Integer(-1)),
new Field(TupleSpace.TSDBTYPE, new String( TSSmall.Small_DB or TSMMDB.MM_DB)))
Any of the fields can be left out and ordering doesn't matter. For fields that
are left out, the defaults --- true, -1, TSSmall_DB --- apply.
The accessPermision Tuple contains a single Field that contains an Acl
object, as defined in java.security.acl. One can construct an Acl with code
like the following.
Permissions[] p1 = {P_READ,P_WRITE};
Principal owner = ACLFactory.createPrincipal("Jim");
Principal grp = ACLFactory.createPrincipal("Jim");
Acl myacl = AclFactory("MyAcl",owner);
myacl.addEntry(owner,AclFactory.createAclEntry(owner,p1);
myacl.addEntry(owner,AclFactory.createAclEntry(grp,p1);
- Throws: TupleSpaceException
- If there is a problem creating the space
on the server or communicating with the server or there is a problem
with the TupleSpaceName. Currently if access control permissions are
not being set for a space the server will not be contacted upon
creating a TupleSpace object, but that may change in the future.
- See Also:
- Acl, AclFactory
TupleSpace
public TupleSpace(String name_,
String tsServer_,
int tsPort_,
Tuple configuration_,
Tuple accessPermissions_) throws TupleSpaceException
- Create a named Tuple Space to be stored and managed by a specified
Tuple Space Server. Connections to the server will be made on a specified
port.
- Parameters:
- name_ - A character string that identifies the TupleSpace on
the default TupleSpaceServer.
- tsServer_ - A string that identifies the TupleSpaceServer that
manages the TupleSpace.
- tsPort_ - The specific port that the TupleSpaceServer uses to
listen for connections from TupleSpace clients.
- configuration_ - the configuration tuple for this space
- accessPermissions_ - the permissions for this space
This constructor calls the constructor with no configuration and then does
the configuration. The reason it is done this way is so that all the
TupleSpace constructors don't have to throw TupleSpaceException because of the
call to setConfig.
A configuration tuple looks like:
Tuple( new Field(TupleSpace.PERSISTENCE, new Boolean( true)),
new Field(TupleSpace.INDEXFIELD, new Integer(-1)),
new Field(TupleSpace.TSDBTYPE, new String( TSSmall.Small_DB or TSMMDB.MM_DB)))
Any of the fields can be left out and ordering doesn't matter. For fields that
are left out, the defaults --- true, -1, TSSmall_DB --- apply.
The accessPermision Tuple contains a single Field that contains an Acl
object, as defined in java.security.acl. One can construct an Acl with code
like the following.
Permissions[] p1 = {P_READ,P_WRITE};
Principal owner = ACLFactory.createPrincipal("Jim");
Principal grp = ACLFactory.createPrincipal("Jim");
Acl myacl = AclFactory("MyAcl",owner);
myacl.addEntry(owner,AclFactory.createAclEntry(owner,p1);
myacl.addEntry(owner,AclFactory.createAclEntry(grp,p1);
- Throws: TupleSpaceException
- If there is a problem creating the space
on the server or communicating with the server or there is a problem
with the TupleSpaceName. Currently if access control permissions are
not being set for a space the server will not be contacted upon
creating a TupleSpace object, but that may change in the future.
- See Also:
- Acl, AclFactory
TupleSpace
public TupleSpace(String name_,
String tsServer_,
int tsPort_,
Tuple configuration_,
Tuple accessPermissions_,
String userName_,
String password_) throws TupleSpaceException
- Create a named Tuple Space to be stored and managed by a specified
Tuple Space Server. Connections to the server will be made on a specified
port.
- Parameters:
- name_ - A character string that identifies the TupleSpace on
the default TupleSpaceServer.
- tsServer_ - A string that identifies the TupleSpaceServer that
manages the TupleSpace.
- tsPort_ - The specific port that the TupleSpaceServer uses to
listen for connections from TupleSpace clients.
- configuration_ - the configuration tuple for this space
- accessPermissions_ - the permissions for this space
- userName_ - the user's tspaces name
- password_ - the user's tspaces password
This constructor calls the constructor with no configuration and then does
the configuration. The reason it is done this way is so that all the
TupleSpace constructors don't have to throw TupleSpaceException because of the
call to setConfig.
A configuration tuple looks like:
Tuple( new Field(TupleSpace.PERSISTENCE, new Boolean( true)),
new Field(TupleSpace.INDEXFIELD, new Integer(-1)),
new Field(TupleSpace.TSDBTYPE, new String( TSSmall.Small_DB or TSMMDB.MM_DB)))
Any of the fields can be left out and ordering doesn't matter. For fields that
are left out, the defaults --- true, -1, TSSmall_DB --- apply.
The accessPermision Tuple contains a single Field that contains an Acl
object, as defined in java.security.acl. One can construct an Acl with code
like the following.
Permissions[] p1 = {P_READ,P_WRITE};
Principal owner = ACLFactory.createPrincipal("Jim");
Principal grp = ACLFactory.createPrincipal("Jim");
Acl myacl = AclFactory("MyAcl",owner);
myacl.addEntry(owner,AclFactory.createAclEntry(owner,p1);
myacl.addEntry(owner,AclFactory.createAclEntry(grp,p1);
- Throws: TupleSpaceException
- If there is a problem creating the space
on the server or communicating with the server or there is a problem
with the TupleSpaceName. Currently if access control permissions are
not being set for a space the server will not be contacted upon
creating a TupleSpace object, but that may change in the future.
- See Also:
- Acl, AclFactory
setUserName
public void setUserName(String name_,
String password_) throws TupleSpaceException
- Set username to be used for access control on this tuplespace
- Parameters:
- name_ - The new username
- password_ - The new password
isValidTSName
public static final boolean isValidTSName(String s)
- Returns:
- true if this string contains only alpha-numeric characters or '_'
setClosingDownByForcingFinalizers
public void setClosingDownByForcingFinalizers(boolean val_)
- should the TupleSpace force finalizers to be run on exit? this method
has some security checking on it, so when running in netscape this should
be set to false. When it is set to false though, the tuple space system will
need to have the TupleSpace.cleanup method called so that it can close its
connections to the servers normally. Note that the cleanup method is static
so just call it once and all space connections will be cleaned up.
- Parameters:
- val_ - if true then force them on shutdown, if false do not.
connectionTries
public void connectionTries(int connectionTries_) throws TupleSpaceCommunicationException
- Set the connectionTries to a new value.
0 signifies infinity --- try again and again.
- Parameters:
- connectionTries_ - the number of times to try connecting to the server before failing
- Throws: TupleSpaceCommunicationException
- if the param is negative or 0
connectionWaitTime
public void connectionWaitTime(int connectionWaitTime_) throws TupleSpaceCommunicationException
- Set the connectionWaitTime to a new value.
- Parameters:
- connectionWaitTime_ - the wait time in between times to try and talk to the server
- Throws: TupleSpaceCommunicationException
- if the param is negative or 0
write
public void write(SuperTuple tuple) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Add the Tuple to the Tuple Space. The Tuple must have at least one Field.
- Parameters:
- tuple - The Tuple to be added to the space.
- Throws: TupleSpaceException
- If a formal (template) tuple is passed,
or the Tuple has no Fields.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
write
public void write(Serializable obj) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Add a Tuple to the Tuple Space that has a single field equal to the
Object.
- Parameters:
- obj - The Serializable for the Field.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
write
public void write(Serializable obj1,
Serializable obj2) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Add a Tuple to the Tuple Space that has two fields equal to the
Objects passed in.
- Parameters:
- obj1 - The Serializable for the first Field.
- obj2 - The Serializable for the second Field.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
write
public void write(Serializable obj1,
Serializable obj2,
Serializable obj3) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Add a Tuple to the Tuple Space that has two fields equal to the
Serializables passed in.
- Parameters:
- obj1 - The Serializable for the first Field.
- obj2 - The Serializable for the second Field.
- obj3 - The Serializable for the third Field.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
waitToTake
public SuperTuple waitToTake(SuperTuple template) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a tuple from the space that matches a Tuple
template. Block until a match is found. Remove the Tuple
from the space. For WAITTOTAKE (aka CONSUME), we will require that
tuples have content (no NULL tuples). WHY?!?
After discussion with Dan and Toby, none of us can remember why we
can't take an empty (wildcard) tuple, so I'm eliminating the restriction.
(swm 9/22/97)
This version of this method name is the most general one -- ie
it is for SuperTuples -- you supply a SuperTuple and get a SuperTuple
back.
- Parameters:
- template - A template SuperTuple (one with at least one formal field)
that is used to match a tuple in the space.
- Returns:
- The SuperTuple that matches the template SuperTuple.
- Throws: TupleSpaceException
- If the Tuple has no Fields.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
waitToTake
public Tuple waitToTake(Tuple template) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a tuple from the space that matches a Tuple
template. Block until a match is found. Remove the Tuple
from the space. For WAITTOTAKE (aka CONSUME), we will require that
tuples have content (no NULL tuples). WHY?!?
After discussion with Dan and Toby, none of us can remember why we
can't take an empty (wildcard) tuple, so I'm eliminating the restriction.
(swm 9/22/97)
This version of this method name is for Tuples only --
you supply a Tuple and get one back.
- Parameters:
- template - A template Tuple (one with at least one formal field)
that is used to match a tuple in the space.
- Returns:
- The Tuple that matches the template Tuple.
- Throws: TupleSpaceException
- If the Tuple has no Fields.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
waitToTake
public SubclassableTuple waitToTake(SubclassableTuple template) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a tuple from the space that matches a Tuple
template. Block until a match is found. Remove the Tuple
from the space. For WAITTOTAKE (aka CONSUME), we will require that
tuples have content (no NULL tuples). WHY?!?
After discussion with Dan and Toby, none of us can remember why we
can't take an empty (wildcard) tuple, so I'm eliminating the restriction.
(swm 9/22/97)
This version of this method name is for SubclassableTuples ---
you supply a subclassable tuple and get the same back.
- Parameters:
- template - A template SubclassableTuple (one with at least one formal field)
that is used to match a tuple in the space.
- Returns:
- The SubclassableTuple that matches the template SubclassableTuple.
- Throws: TupleSpaceException
- If the Tuple has no Fields.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
waitToTake
public Tuple waitToTake(Serializable obj1) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a tuple from the space that has one Field matching
the Serializables. Block until a match is found. Remove the Tuple
from the space. The value and type of the Serializables (e.g., String) will
be used to create the fields of the template tuple.
If the Serializable is of type Field, then it will be used instead of
being the value of the Field.
- Parameters:
- obj1 - An Serializable to match the first Field against.
- Returns:
- The Tuple that matches the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
waitToTake
public Tuple waitToTake(Serializable obj1,
Serializable obj2) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a tuple from the space that has two Fields matching
specified Serializables. Block until a match is found. Remove the Tuple
from the space. The value and type of the Serializables (e.g., String) will
be used to create the fields of the template tuple.
If the Serializable is of type Field, then it will be used instead of
being the value of the Field.
- Parameters:
- obj1 - An Serializable to match the first Field against.
- obj2 - An Serializable to match the second Field against.
- Returns:
- The Tuple that matches the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
waitToTake
public Tuple waitToTake(Serializable obj1,
Serializable obj2,
Serializable obj3) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a tuple from the space that has three Fields matching
specified Serializables. Block until a match is found. Remove the Tuple
from the space. The value and type of the Serializables (e.g., String) will
be used to create the fields of the template tuple.
If the Serializable is of type Field, then it will be used instead of
being the value of the Field.
- Parameters:
- obj1 - An Serializable to match the first Field against.
- obj2 - An Serializable to match the second Field against.
- obj3 - An Serializable to match the second Field against.
- Returns:
- The Tuple that matches the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
take
public SuperTuple take(SuperTuple template) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a tuple from the space that matches a Tuple
template. Do not block. Remove the Tuple
from the space. For TAKE (aka CONSUME), we will require that
tuples have content (no NULL tuples).
After discussion with Dan and Toby, none of us can remember why we
can't take an empty (wildcard) tuple, so I'm eliminating the restriction.
(swm 9/22/97)
- Parameters:
- template - A template SuperTuple (one with at least one formal field)
that is used to match a tuple in the space.
This version of take has a SuperTuple template param and thus is the
most general and returns a SuperTuple return tuple.
- Returns:
- The SuperTuple that matches the template SuperTuple. null if no match
- Throws: TupleSpaceException
- If the Tuple has no Fields.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
take
public Tuple take(Tuple template) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a tuple from the space that matches a Tuple
template. Do not block. Remove the Tuple
from the space. For TAKE (aka CONSUME), we will require that
tuples have content (no NULL tuples).
After discussion with Dan and Toby, none of us can remember why we
can't take an empty (wildcard) tuple, so I'm eliminating the restriction.
(swm 9/22/97)
This version of take has a Tuple param and thus returns
a Tuple return value.
- Parameters:
- template - A template Tuple (one with at least one formal field)
that is used to match a tuple in the space.
- Returns:
- The Tuple that matches the template Tuple. null if no match
- Throws: TupleSpaceException
- If the Tuple has no Fields.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
take
public SubclassableTuple take(SubclassableTuple template) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a tuple from the space that matches a Tuple
template. Do not block. Remove the Tuple
from the space. For TAKE (aka CONSUME), we will require that
tuples have content (no NULL tuples).
After discussion with Dan and Toby, none of us can remember why we
can't take an empty (wildcard) tuple, so I'm eliminating the restriction.
(swm 9/22/97)
This version of take has a SubclassableTuple template as a param
and thus returns a SubclassableTuple.
- Parameters:
- template - A template SubclassableTuple (one with at least one formal field)
that is used to match a tuple in the space.
- Returns:
- The SubclassableTuple that matches the template SubclassableTuple. null if no match
- Throws: TupleSpaceException
- If the Tuple has no Fields.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
take
public Tuple take(Serializable obj1) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a Tuple from the space that has one Field matching
the Serializables. Do not block. Remove the Tuple
from the space. The value and type of the Serializables (e.g., String) will
be used to create the fields of the template tuple.
If the Serializable is of type Field, then it will be used instead of
being the value of the Field.
- Parameters:
- obj1 - An Serializable to match the first Field against.
- Returns:
- The Tuple that matches the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
take
public Tuple take(Serializable obj1,
Serializable obj2) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a tuple from the space that has two Fields matching
specified Serializables. Do not block. Remove the Tuple
from the space. The value and type of the Serializables (e.g., String) will
be used to create the fields of the template tuple.
If the Serializable is of type Field, then it will be used instead of
being the value of the Field.
- Parameters:
- obj1 - An Serializable to match the first Field against.
- obj2 - An Serializable to match the second Field against.
- Returns:
- The Tuple that matches the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
take
public Tuple take(Serializable obj1,
Serializable obj2,
Serializable obj3) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a tuple from the space that has three Fields matching
specified Serializables. Do not block. Remove the Tuple
from the space. The value and type of the Serializables (e.g., String) will
be used to create the fields of the template tuple.
If the Serializable is of type Field, then it will be used instead of
being the value of the Field.
- Parameters:
- obj1 - An Serializable to match the first Field against.
- obj2 - An Serializable to match the second Field against.
- obj3 - An Serializable to match the second Field against.
- Returns:
- The Tuple that matches the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
waitToRead
public SuperTuple waitToRead(SuperTuple template) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a Tuple from the space that matches the Tuple
template. Block until matching Tuple is available. But do NOT remove
it from the tuple space. For WAITTOREAD, NULL tuples are allowed,
as they match anything.
This is the general waitToRead method. A SuperTuple is supplied and
a SuperTuple is returned. If the template is known to be of type Tuple
or subclassableTuple, the more specific waitToReads could be used to
avoid having to cast the result to one of those types.
- Parameters:
- template - A template SuperTuple (one with at least one formal field)
that is used to match a tuple in the space.
- Returns:
- The SuperTuple that matches the template SuperTuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
waitToRead
public Tuple waitToRead(Tuple template) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a Tuple from the space that matches the Tuple
template. Block until matching Tuple is available. But do NOT remove
it from the tuple space. For WAITTOREAD, NULL tuples are allowed,
as they match anything.
This version of wait to read takes a Tuple param and returns a Tuple.
Since a Tuple will only match against another Tuple this is the only
possible return value.
- Parameters:
- template - A template Tuple (one with at least one formal field)
that is used to match a tuple in the space.
- Returns:
- The Tuple that matches the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
waitToRead
public SubclassableTuple waitToRead(SubclassableTuple template) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a Tuple from the space that matches the Tuple
template. Block until matching Tuple is available. But do NOT remove
it from the tuple space. For WAITTOREAD, NULL tuples are allowed,
as they match anything.
This version of waitToRead is for SubclassableTuples -- you
supply a subclassable tuple and it returns the same --- which is
actually the only thing possible since a subclassable tuple will
never match a Tuple.
- Parameters:
- template - A template Tuple (one with at least one formal field)
that is used to match a tuple in the space.
- Returns:
- The SubclassableTuple that matches the template SubclassableTuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
waitToRead
public Tuple waitToRead(Serializable obj) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a Tuple from the space that matches the Tuple
template. Block until matching Tuple is available. But do NOT remove
if from the tuple space. For WAITTOREAD, NULL tuples are allowed,
as they match anything.
- Parameters:
- obj - The Field of a tuple to match one in the space to
be returned.
- Returns:
- The Tuple that matches the template Tuple constructed
from the Serializable.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
waitToRead
public Tuple waitToRead(Serializable obj1,
Serializable obj2) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a Tuple from the space that matches the Tuple
template. Block until matching Tuple is available. But do NOT remove
if from the tuple space. For WAITTOREAD, NULL tuples are allowed,
as they match anything.
- Parameters:
- obj1 - The Field of a tuple to match one in the space to
be returned.
- obj2 - The Field of a tuple to match one in the space to
be returned.
- Returns:
- The Tuple that matches the template Tuple constructed
from the Serializable.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
waitToRead
public Tuple waitToRead(Serializable obj1,
Serializable obj2,
Serializable obj3) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a Tuple from the space that matches the Tuple
template. Block until matching Tuple is available. But do NOT remove
it from the tuple space. For WAITTOREAD, NULL tuples are allowed,
as they match anything.
- Parameters:
- obj1 - The Field of a tuple to match one in the space to
be returned.
- obj2 - The Field of a tuple to match one in the space to
be returned.
- obj3 - The Field of a tuple to match one in the space to
be returned.
- Returns:
- The Tuple that matches the template Tuple constructed
from the Serializable.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
read
public SuperTuple read(SuperTuple template) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a Tuple from the space that matches the Tuple
template. Non-blocking. But do NOT remove
it from the tuple space. For READ, NULL tuples are allowed,
as they match anything.
The most general read since the most general Tuple type,
SuperTuple, is taken as the param which of course leads
to a SuperTuple being returned.
- Parameters:
- template - A template SuperTuple (one with at least one formal field)
that is used to match a tuple in the space.
- Returns:
- The SuperTuple that matches the template SuperTuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
read
public Tuple read(Tuple template) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a Tuple from the space that matches the Tuple
template. Non-blocking. But do NOT remove
it from the tuple space. For READ, NULL tuples are allowed,
as they match anything.
read will always return a Tuple when the template is a tuple
since a tuple only matches a tuple.
- Parameters:
- template - A template Tuple (one with at least one formal field)
that is used to match a tuple in the space.
- Returns:
- The Tuple that matches the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
read
public SubclassableTuple read(SubclassableTuple template) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a Tuple from the space that matches the Tuple
template. Non-blocking. But do NOT remove
it from the tuple space. For READ, NULL tuples are allowed,
as they match anything.
A SubclassableTuple only matches another Subclassabletuple so this
method returns a SubclassableTuple.
- Parameters:
- template - A template SubclassableTuple (one with at least one formal field)
that is used to match a tuple in the space.
- Returns:
- The SubclassableTuple that matches the template SubclassableTuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
read
public Tuple read(Serializable obj) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a Tuple from the space that matches the Tuple
template. Non-blocking. But do NOT remove
if from the tuple space. For READ, NULL tuples are allowed,
as they match anything.
- Parameters:
- obj - The Field of a tuple to match one in the space to
be returned.
- Returns:
- The Tuple that matches the template Tuple constructed
from the Serializable.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
read
public Tuple read(Serializable obj1,
Serializable obj2) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a Tuple from the space that matches the Tuple
template. Non-blocking. But do NOT remove
if from the tuple space. For READ, NULL tuples are allowed,
as they match anything.
- Parameters:
- obj1 - The Field of a tuple to match one in the space to
be returned.
- obj2 - The Field of a tuple to match one in the space to
be returned.
- Returns:
- The Tuple that matches the template Tuple constructed
from the object.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
read
public Tuple read(Serializable obj1,
Serializable obj2,
Serializable obj3) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve a Tuple from the space that matches the Tuple
template. Non-blocking. But do NOT remove
it from the tuple space. For READ, NULL tuples are allowed,
as they match anything.
- Parameters:
- obj1 - The Field of a tuple to match one in the space to
be returned.
- obj2 - The Field of a tuple to match one in the space to
be returned.
- obj3 - The Field of a tuple to match one in the space to
be returned.
- Returns:
- The Tuple that matches the template Tuple constructed
from the object.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
scan
public Tuple scan(SuperTuple template) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve all Tuples from the space that match a Tuple
template. Scan is non-blocking -- it will read the current
state of the tuple space and return. For SCAN, NULL tuples are
allowed as a template, they match anything (this allows us to scan the
entire space).
Scan returns a Tuple that holds a set of tuples. Each Field is a Tuple
that matched the template.
- Parameters:
- template - A template Tuple (one with at least one formal field)
that is used to match a tuple in the space.
- Returns:
- A Tuple of Tuples. Each Field in the Tuple is a Tuple
that matched the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
- See Also:
- formal
scan
public Tuple scan(Serializable obj1,
Serializable obj2,
Serializable obj3) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve all Tuples from the space that match a Tuple
template. Scan is non-blocking -- it will read the current
state of the tuple space and return. For SCAN, NULL tuples are
allowed as a template, they match anything (this allows us to scan the
entire space).
Scan returns a Tuple that holds a set of tuples. Each Field is a Tuple
that matched the template.
- Parameters:
- obj1 - An object to match the first Field against.
- obj2 - An object to match the second Field against.
- obj3 - An Serializable to match the second Field against.
- Returns:
- A Tuple of Tuples. Each Field in the Tuple is a Tuple
that matched the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
- See Also:
- formal
scan
public Tuple scan(Serializable obj1,
Serializable obj2) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve all Tuples from the space that match a Tuple
template. Scan is non-blocking -- it will read the current
state of the tuple space and return. For SCAN, NULL tuples are
allowed as a template, they match anything (this allows us to scan the
entire space).
Scan returns a Tuple that holds a set of tuples. Each Field is a Tuple
that matched the template.
- Parameters:
- obj1 - An Serializable to match the first Field against.
- obj2 - An Serializable to match the second Field against.
- Returns:
- A Tuple of Tuples. Each Field in the Tuple is a Tuple
that matched the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
- See Also:
- formal
scan
public Tuple scan(Serializable obj) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve all Tuples from the space that match a Tuple
template. Scan is non-blocking -- it will read the current
state of the tuple space and return. For SCAN, NULL tuples are
allowed as a template, they match anything (this allows us to scan the
entire space).
Scan returns a Tuple that holds a set of tuples. Each Field is a Tuple
that matched the template.
- Parameters:
- obj - An Serializable to match the first Field against.
- Returns:
- A Tuple of Tuples. Each Field in the Tuple is a Tuple
that matched the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
- See Also:
- formal
consumingScan
public Tuple consumingScan(SuperTuple template) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve and delete all Tuples from the space that match a Tuple
template. ConsumingScan is non-blocking -- it will read the current
state of the tuple space and return. For CONSUMINGSCAN, NULL tuples are
allowed as a template, they match anything (this allows us to scan the
entire space).
ConsumingScan returns a Tuple that holds a set of tuples. Each Field is a Tuple
that matched the template.
- Parameters:
- template - A template Tuple (one with at least one formal field)
that is used to match a tuple in the space.
- Returns:
- A Tuple of Tuples. Each Field in the Tuple is a Tuple
that matched the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
- See Also:
- formal
consumingScan
public Tuple consumingScan(Serializable obj1,
Serializable obj2,
Serializable obj3) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve and delete all Tuples from the space that match a Tuple
template. ConsumingScan is non-blocking -- it will read the current
state of the tuple space and return. For CONSUMINGSCAN, NULL tuples are
allowed as a template, they match anything (this allows us to consumingScan the
entire space).
ConsumingScan returns a Tuple that holds a set of tuples. Each Field is a Tuple
that matched the template.
- Parameters:
- obj1 - An Serializable to match the first Field against.
- obj2 - An Serializable to match the second Field against.
- obj3 - An Serializable to match the second Field against.
- Returns:
- A Tuple of Tuples. Each Field in the Tuple is a Tuple
that matched the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
- See Also:
- formal
consumingScan
public Tuple consumingScan(Serializable obj1,
Serializable obj2) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve and delete all Tuples from the space that match a Tuple
template. ConsumingScan is non-blocking -- it will read the current
state of the tuple space and return. For CONSUMINGSCAN, NULL tuples are
allowed as a template, they match anything (this allows us to consumingScan the
entire space).
ConsumingScan returns a Tuple that holds a set of tuples. Each Field is a Tuple
that matched the template.
- Parameters:
- obj1 - An Serializable to match the first Field against.
- obj2 - An Serializable to match the second Field against.
- Returns:
- A Tuple of Tuples. Each Field in the Tuple is a Tuple
that matched the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
- See Also:
- formal
consumingScan
public Tuple consumingScan(Serializable obj) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Retrieve and delete all Tuples from the space that match a Tuple
template. ConsumingScan is non-blocking -- it will read the current
state of the tuple space and return. For CONSUMINGSCAN, NULL tuples are
allowed as a template, they match anything (this allows us to consumingScan the
entire space).
ConsumingScan returns a Tuple that holds a set of tuples. Each Field is a Tuple
that matched the template.
- Parameters:
- obj - An Serializable to match the first Field against.
- Returns:
- A Tuple of Tuples. Each Field in the Tuple is a Tuple
that matched the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
- See Also:
- formal
count
public Tuple count(SuperTuple template) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Count all tuples from the space that match a Tuple
template. Count is non-blocking -- it will read the current
state of the tuplespace and return. For Count, NULL tuples are
allowed, as they match anything (this allows us to count the
entire space).
Count returns a tuple that holds a single integer value.
- Parameters:
- template - A template Tuple (one with at least one formal field)
that is used to match a tuple in the space.
- Returns:
- A Tuple with a single Field of type Integer that holds the
number of Tuples that matched the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
countN
public int countN(SuperTuple template) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Count all tuples from the space that match a Tuple
template. Count is non-blocking -- it will read the current
state of the tuplespace and return. For Count, NULL tuples are
allowed, as they match anything (this allows us to count the
entire space). This is the same as the method "count", but it returns
an integer instead of a tuple with an integer.
Count returns a tuple that holds a single integer value.
- Parameters:
- template - A template Tuple (one with at least one formal field)
that is used to match a tuple in the space.
- Returns:
- An int that is the number of Tuples that matched the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
- See Also:
- count
delete
public int delete(SuperTuple template) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Delete all tuples that match this template.
- Parameters:
- template - A template Tuple that is used to match tuples in the space.
- Returns:
- An int that is the number of Tuples that were deleted
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
- See Also:
- count
deleteAll
public int deleteAll() throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Delete all tuples in a space.
- Returns:
- An int that is the number of Tuples that were deleted
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
- See Also:
- count
rhonda
public Tuple rhonda(Tuple tuple,
Tuple template) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- The rendevous primitive. (swm)
- Parameters:
- tuple - The data tuple (to "out")
- template - The template tuple (to "in")
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
makeJarFile
public byte[] makeJarFile(Class classes_[]) throws IOException, TupleSpaceClientException
- For all the classes, if the class is in a jar file, grab the entire jar file
otherwise for plain .class classes ship them in their own .jar file. This leads to the possibility of
returning multiple byte arrays for different .jar files (for now actually only make one jar file, don't
do what is stated wait till class loaders in place to see best way to do this) BUG Alert.
- Parameters:
- classes_ - the classes to make it from
- Returns:
- the byte arrays which correspond to the jar files
- Throws: IOException
- if there is a problem creating the jar file
- Throws: TupleSpaceClientException
- if there is a problem getting the byte code for one
of the classes
addHandler
public void addHandler(String name,
Class classes[]) throws TupleSpaceClientException
- NOT SUPPORTED ON THE SERVER IN VERSION 1.0.1
Add a new handler to this tuple space. The handler is added to the top
factory --- the one most recently added. Note though that a lower level
add handler command may be used to accomplish this.
We probably need to add more synchronization commands and a stronger API for handler/factory
maintenance. Right now, the client can check for SystemTuples that contain info on
which handlers belong to which factories and what levels in the chain each factory is at.
- Parameters:
- classes - the classes for the handler the handler should be the last one
- Throws: TupleSpaceClientException
- if all the classes are not there
getFactoryStack
public Tuple getFactoryStack() throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Return a scan of all the factory names for this tuple space and their level numbers --- level 0 is the
highest --- most recently added --- factory.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
- See Also:
- updateFactoryInfo
getHandlerCommandNames
public Tuple getHandlerCommandNames(String factoryName_) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Return a scan of all the handler names for this factory ---
this feature is *NOT* supported for the built in commands --- TSFSmallTS handlers.
Well, it is supported but will just return an empty scan tuple.
Also note that the functionality is not general purpose in that it only tells us the commands
that are supported but not what type of tuples the command operates on or whatever other
criteria there is for a handler to decide if it wants to act on a tuple.
- Parameters:
- factoryName_ - the name of the factory we are interested in.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
- See Also:
- addHandler
addFactory
public void addFactory(Class classes[]) throws TupleSpaceClientException
- NOT SUPPORTED ON THE SERVER IN VERSION 1.0.1
add a new factory to this tuple space as the topmost (most powerful) factory.
- Parameters:
- classes - the classes_ all the classes needed to implement the factory that aren't
part of the TupleSpace library with the factory itself being the first one. The factory
itself is the class that is derived in some fashion from TSFactory that the user wants to
be the implementation of the new factory.
- Throws: TupleSpaceClientException
- if all the classes are not there
createTupleSpace
public static TupleSpace createTupleSpace(String name_,
String tsServer_,
int tsPort_,
Tuple config_,
Tuple accessPermissions_) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException, TupleSpaceException
- Note: createTupleSpace() is deprecated.
use constructors
- create a tuple space
A configuration tuple looks like:
Tuple( new Field(TupleSpace.PERSISTENCE, new Boolean( true)),
new Field(TupleSpace.INDEXFIELD, new Integer(-1)),
new Field(TupleSpace.TSDBTYPE, new String( TSSmall.Small_DB or TSMMDB.MM_DB)))
Any of the fields can be left out and ordering doesn't matter. For fields that
are left out, the defaults --- true, -1, TSMM_DB --- apply.
- Parameters:
- name_ - the name of the tuple space.
- tsServer_ - the server host.
- tsPort_ - the server's port.
- config_ - the configuration tuple for this space.
- accessPermissions_ - a tuple describing the access permissions for this new space that is
either null --- the user group will have access to this space for all operations or of the form:
( Field ( name = attribute, value = String [] groupsThatHavePermission), ...)
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
This could be the case if the space already exists ie an exception *is* raised if it does.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
- See Also:
- TupleSpace, TSHGalaxy
createTupleSpace
public static TupleSpace createTupleSpace(String name_,
Tuple config_,
Tuple accessPermissions_) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException, TupleSpaceException
- Note: createTupleSpace() is deprecated.
use constructors
- create a tuple space given a name for the space and configuration information in the configuration tuple.
A configuration tuple looks like:
Tuple( new Field(TupleSpace.PERSISTENCE, new Boolean( true)),
new Field(TupleSpace.INDEXFIELD, new Integer(-1)),
new Field(TupleSpace.TSDBTYPE, new String( TSSmall.Small_DB or TSMMDB.MM_DB)))
Any of the fields can be left out and ordering doesn't matter. For fields that
are left out, the defaults --- true, -1, TSSmall_DB --- apply.
- Parameters:
- name_ - the name of the tuple space.
- config_ - the configuration tuple for this space.
- accessPermissions_ - a tuple describing the access permissions for this new space that is
either null --- the user group will have access to this space for all operations or of the form:
( Field ( name = attribute, value = String [] groupsThatHavePermission), ...)
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
This could be the case if the space already exists ie an exception *is* raised if it does.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
- See Also:
- TupleSpace, TSHGalaxy
destroy
public void destroy() throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
parseConfigTuple
public static Object parseConfigTuple(String fieldName_,
SuperTuple configTuple_) throws TupleSpaceException
exists
public boolean exists() throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
status
public static Tuple status(String tsServer_,
int tsPort_) throws TupleSpaceClientException, TupleSpaceServerException
eventTemplate
public static Tuple eventTemplate(String targetCmdString,
SuperTuple targetTuple,
Class operation)
eventRegister
public int eventRegister(String commandName_,
SuperTuple argTuple_,
Callback callback_) throws TupleSpaceException
- Register for an event on the server. An event is the exection of some command on some
tuple. MAKE SURE you don't do much in your callback handler, the thread that handles communication
to the tuple space server(s) for this VM will be calling call personally and you don't want to
tie that guy up. later will probably make the callback thing into a thread or will use
Java's event mechanisms to hand the event to that guy. But just like this for now.
- Parameters:
- commandName_ - the command to be on the watch for!
- argTuple_ - the tuple to be on the look at for happening on the above commandName
- callback_ - what code to call when the event happens make sure this code returns false for
deregistering after a call is executed
- Returns:
- the sequence number for this registration.
command
public SuperTuple command(String cmdString_,
SuperTuple argTuple_) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Issue a command to the TupleSpace and pass along a Tuple as an argument.
The command is a text string that is recongized by the TupleSpace.
The results of the command, if any, are returned as a tuple.
The commands recognized by all TupleSpaces are:
"in" - Remove and return a Tuple from the space that matches
the argument Tuple.
"read" - Like "in", but do not remove the Tuple from the space.
"out" - Add the argument Tuple to the space.
"scan" - Remove all tuples that match the arguement tuple?
"count" - Count the Tuples that match the argument Tuple and return
the value as a Tuple with a single integer Field.
New commands can be added to the space by sending a new
TupleSpaceHandler.
- Parameters:
- cmdString_ - The String that names the command.
- argTuple_ - The argument Tuple, can be null.
- Returns:
- A result Tuple, the format of which depends upon the command.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
- See Also:
- TupleSpaceHandler
killConnection
public static synchronized void killConnection(String key_,
Exception ioe_)
- this method is used to close the current connection to the server. It is called by CallbackThread
and talkToAServer if
they get an io error on the input end of the socket connection to the server which indicates
that this socket is probably bad so instead of fooling around with the socket let's just
close the streams and reopen a new socket.
- Parameters:
- key_ - the hostname and port catted together
- ioe_ - the ioexception that occured.
- See Also:
- CallbackThread
cleanup
public static synchronized void cleanup()
- this method is used to close the current connections to the server.
By default, the TupleSpace sets it up so the VM runs finalizers on exit
and thus, the CallbackThread and ServerConnection classes finalizers are called
and cleanup is performed that way. But, if the user did not want this,
they can set _closingDownByForcingFinalizers to false and then just call this method when they are done
with TupleSpace. The method closes down the streams connecting the client to the
server. This way the server can tell that this is a normal termination.
getName
public String getName()
- Return the space name. Cool for debugging.
- Returns:
- String - the name of the space
getServer
public String getServer()
- Return the name of the server. Cool for debugging.
- Returns:
- String - the name of the server
getPort
public int getPort()
- Return the number of the port. Cool for debugging.
- Returns:
- int - the number of the port
getVersion
public static String getVersion()
- Class Method to Return the TSpaces Code Version number.
This Version number is in the form:
V.L.M
Where "V" is the Version and is currently 1.
"L" is the Level number
"M" is the Modification number.
For example:
1.0.1
The intent is that the "V" version number will change only
for a very major change.
The "L" Level number will change when new major new
features are added
and/or incompatible changes are made.
The "M" Modification number will change when a new level of
code is distributed to fix problems and posibly add minor
new compatible function.
- Returns:
- String - Version.Level.Modificatio
out
public void out(Tuple tuple) throws TupleSpaceException, TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Note: out() is deprecated.
Use write() instead
- Add the Tuple to the Tuple Space.
- Parameters:
- tuple - The Tuple to be added to the space.
- Throws: TupleSpaceException
- If a formal (template) tuple is passed,
or the Tuple has no Fields.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
out
public void out(Serializable obj) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Note: out() is deprecated.
Use write() instead
- Add a Tuple to the Tuple Space that has a single field equal to the
Object.
- Parameters:
- obj - The Serializable for the Field.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
out
public void out(Serializable obj1,
Serializable obj2) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Note: out() is deprecated.
Use write() instead
- Add a Tuple to the Tuple Space that has two fields equal to the
Serializables passed in.
- Parameters:
- obj1 - The Serializable for the first Field.
- obj2 - The Serializable for the second Field.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
out
public void out(Serializable obj1,
Serializable obj2,
Serializable obj3) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Note: out() is deprecated.
Use write() instead
- Add a Tuple to the Tuple Space that has two fields equal to the
Serializables passed in.
- Parameters:
- obj1 - The Serializable for the first Field.
- obj2 - The Serializable for the second Field.
- obj3 - The Serializable for the third Field.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
in
public Tuple in(Tuple template) throws TupleSpaceException, TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Note: in() is deprecated.
Use waitToTake() instead.
- Retrieve a tuple from the space that matches a Tuple
template. Block until a match is found. Remove the Tuple
from the space. For IN (aka CONSUME), we will require that
tuples have content (no NULL tuples).
- Parameters:
- template - A template Tuple (one with at least one formal field)
that is used to match a tuple in the space.
- Returns:
- The Tuple that matches the template Tuple.
- Throws: TupleSpaceException
- If the Tuple has no Fields.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
in
public Tuple in(Serializable obj1) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Note: in() is deprecated.
Use waitToTake() instead.
- Retrieve a tuple from the space that has one Field matching
the Serializables. Block until a match is found. Remove the Tuple
from the space. The value and type of the Serializables (e.g., String) will
be used to create the fields of the template tuple.
If the Serializable is of type Field, then it will be used instead of
being the value of the Field.
- Parameters:
- obj1 - An Serializable to match the first Field against.
- Returns:
- The Tuple that matches the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
in
public Tuple in(Serializable obj1,
Serializable obj2) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Note: in() is deprecated.
Use waitToTake() instead.
- Retrieve a tuple from the space that has two Fields matching
specified Serializables. Block until a match is found. Remove the Tuple
from the space. The value and type of the Serializables (e.g., String) will
be used to create the fields of the template tuple.
If the Serializable is of type Field, then it will be used instead of
being the value of the Field.
- Parameters:
- obj1 - An Serializable to match the first Field against.
- obj2 - An Serializable to match the second Field against.
- Returns:
- The Tuple that matches the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
in
public Tuple in(Serializable obj1,
Serializable obj2,
Serializable obj3) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Note: in() is deprecated.
Use waitToTake() instead.
- Retrieve a tuple from the space that has three Fields matching
specified Serializables. Block until a match is found. Remove the Tuple
from the space. The value and type of the Serializables (e.g., String) will
be used to create the fields of the template tuple.
If the Serializable is of type Field, then it will be used instead of
being the value of the Field.
- Parameters:
- obj1 - An Serializable to match the first Field against.
- obj2 - An Serializable to match the second Field against.
- obj3 - An Serializable to match the second Field against.
- Returns:
- The Tuple that matches the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
inp
public SuperTuple inp(SuperTuple template) throws TupleSpaceException, TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Note: inp() is deprecated.
Use take() instead.
- Retrieve a tuple from the space that matches a Tuple
template. Do not block. Remove the Tuple
from the space. For IN (aka CONSUME), we will require that
tuples have content (no NULL tuples).
- Parameters:
- template - A template Tuple (one with at least one formal field)
that is used to match a tuple in the space.
- Returns:
- The Tuple that matches the template Tuple. null if no match
- Throws: TupleSpaceException
- If the Tuple has no Fields.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
inp
public SuperTuple inp(Serializable obj1) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Note: inp() is deprecated.
Use take() instead.
- Retrieve a tuple from the space that has one Field matching
the Serializables. Do not block. Remove the Tuple
from the space. The value and type of the Serializables (e.g., String) will
be used to create the fields of the template tuple.
If the Serializable is of type Field, then it will be used instead of
being the value of the Field.
- Parameters:
- obj1 - An Serializable to match the first Field against.
- Returns:
- The Tuple that matches the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
inp
public SuperTuple inp(Serializable obj1,
Serializable obj2) throws TupleSpaceCommunicationException, TupleSpaceClientException, TupleSpaceServerException
- Note: inp() is deprecated.
Use take() instead.
- Retrieve a tuple from the space that has two Fields matching
specified Serializables. Do not block. Remove the Tuple
from the space. The value and type of the Serializables (e.g., String) will
be used to create the fields of the template tuple.
If the Serializable is of type Field, then it will be used instead of
being the value of the Field.
- Parameters:
- obj1 - An Serializable to match the first Field against.
- obj2 - An Serializable to match the second Field against.
- Returns:
- The Tuple that matches the template Tuple.
- Throws: TupleSpaceCommunicationException
- There are problems connecting
to the TupleSpace Server
- Throws: TupleSpaceServerException
- There was a problem executing the
command on the server.
- Throws: TupleSpaceClientException
- There were problems preparing the
command to be sent to the server.
main
public static void main(String argv[])
- Test routine.
All Packages Class Hierarchy This Package Previous Next Index