Class TSpace<K,V>
java.lang.Object
org.jpos.space.TSpace<K,V>
- All Implemented Interfaces:
AutoCloseable, Runnable, LocalSpace<K,V>, Space<K, V>, Loggeable
TSpace implementation
- Since:
- !.4.9
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddListener(Object key, SpaceListener listener) add a SpaceListener associated with a given keyvoidaddListener(Object key, SpaceListener listener, long timeout) add a SpaceListener associated with a given key for a given period of time.voiddump(PrintStream p, String indent) booleanbooleanvoidgc()unstandard method (required for space replication) - use with careTake an entry from the space, waiting forever until one exists.Take an entry from the space, waiting a limited amount of time until one exists.In probe takes an entry from the space if one exists, return null otherwise.booleanisEmpty()voidnotifyListeners(Object key, Object value) voidNrd (not read) waits forever until Key is not present in space.
Resolution for expiring entries is implementation dependant, but a minimum one-second is suggested.Nrd (not read) waits up to timeout until Key is not present in space.
Resolution for expiring entries is implementation dependant, but a minimum one-second is suggested.voidWrite a new entry into the SpacevoidWrite a new entry into the Space, with an timeout valuevoidWrite a new entry at the head of a queue.voidWrite a new entry at the head of the queue with a timeout valuevoidWrite a single entry at the head of the queue discarding the other entriesvoidWrite a single entry at the head of the queue discarding the other entries, with timeout.Read an entry from the space, waiting forever until one exists.Read an entry from the space, waiting a limited amount of time until one exists.Read probe reads an entry from the space if one exists, return null otherwise.voidremoveListener(Object key, SpaceListener listener) removes a SpaceListener associated with a given keyvoidrun()voidsetEntries(Map entries) unstandard method (required for space replication) - use with careint
-
Field Details
-
entries
-
sl
-
GCDELAY
- See Also:
-
-
Constructor Details
-
TSpace
public TSpace()
-
-
Method Details
-
out
-
out
-
rdp
-
inp
-
in
-
in
-
rd
-
rd
-
nrd
Description copied from interface:SpaceNrd (not read) waits forever until Key is not present in space.
Resolution for expiring entries is implementation dependant, but a minimum one-second is suggested. -
nrd
Description copied from interface:SpaceNrd (not read) waits up to timeout until Key is not present in space.
Resolution for expiring entries is implementation dependant, but a minimum one-second is suggested. -
run
-
gc
-
size
-
addListener
Description copied from interface:LocalSpaceadd a SpaceListener associated with a given key- Specified by:
addListenerin interfaceLocalSpace<K,V> - Parameters:
key- Entry's keylistener- a SpaceListener
-
addListener
Description copied from interface:LocalSpaceadd a SpaceListener associated with a given key for a given period of time. Warning: not supported by all space implementations.- Specified by:
addListenerin interfaceLocalSpace<K,V> - Parameters:
key- Entry's keylistener- a SpaceListenertimeout- listener registration timeout in millis
-
removeListener
Description copied from interface:LocalSpaceremoves a SpaceListener associated with a given key- Specified by:
removeListenerin interfaceLocalSpace<K,V> - Parameters:
key- Entry's keylistener- the SpaceListener
-
isEmpty
-
getKeySet
-
getKeysAsString
-
dump
-
notifyListeners
-
push
-
push
-
put
-
put
Description copied from interface:SpaceWrite a single entry at the head of the queue discarding the other entries, with timeout. -
existAny
-
existAny
-
getEntries
unstandard method (required for space replication) - use with care- Returns:
- underlying entry map
-
setEntries
unstandard method (required for space replication) - use with care- Parameters:
entries- underlying entry map
-