|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.TimerTask
org.jpos.space.TSpace<K,V>
public class TSpace<K,V>
TSpace implementation
| Field Summary | |
|---|---|
protected Map |
entries
|
static long |
GCDELAY
|
protected TSpace |
sl
|
| Constructor Summary | |
|---|---|
TSpace()
|
|
| Method Summary | |
|---|---|
void |
addListener(Object key,
SpaceListener listener)
add a SpaceListener associated with a given key |
void |
addListener(Object key,
SpaceListener listener,
long timeout)
add a SpaceListener associated with a given key for a given period of time. |
void |
dump(PrintStream p,
String indent)
|
boolean |
existAny(K[] keys)
|
boolean |
existAny(K[] keys,
long timeout)
|
void |
gc()
|
Map |
getEntries()
unstandard method (required for space replication) - use with care |
String |
getKeysAsString()
|
Set |
getKeySet()
|
V |
in(Object key)
Take an entry from the space, waiting forever until one exists. |
V |
in(Object key,
long timeout)
Take an entry from the space, waiting a limited amount of time until one exists. |
V |
inp(Object key)
In probe takes an entry from the space if one exists, return null otherwise. |
boolean |
isEmpty()
|
void |
notifyListeners(Object key,
Object value)
|
void |
out(K key,
V value)
Write a new entry into the Space |
void |
out(K key,
V value,
long timeout)
Write a new entry into the Space, with an timeout value |
void |
push(K key,
V value)
Write a new entry at the head of a queue. |
void |
push(K key,
V value,
long timeout)
Write a new entry at the head of the queue with a timeout value |
void |
put(K key,
V value)
Write a single entry at the head of the queue discarding the other entries |
void |
put(K key,
V value,
long timeout)
Write a single entry at the head of the queue discarding the other entries, with timeout. |
V |
rd(Object key)
Read an entry from the space, waiting forever until one exists. |
V |
rd(Object key,
long timeout)
Read an entry from the space, waiting a limited amount of time until one exists. |
V |
rdp(Object key)
Read probe reads an entry from the space if one exists, return null otherwise. |
void |
removeListener(Object key,
SpaceListener listener)
removes a SpaceListener associated with a given key |
void |
run()
|
void |
setEntries(Map entries)
unstandard method (required for space replication) - use with care |
int |
size(Object key)
|
| Methods inherited from class java.util.TimerTask |
|---|
cancel, scheduledExecutionTime |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Map entries
protected TSpace sl
public static final long GCDELAY
| Constructor Detail |
|---|
public TSpace()
| Method Detail |
|---|
public void out(K key,
V value)
Space
out in interface Space<K,V>key - Entry's keyvalue - Object value
public void out(K key,
V value,
long timeout)
Space
out in interface Space<K,V>key - Entry's keyvalue - Object valuetimeout - timeout valuepublic V rdp(Object key)
Space
rdp in interface Space<K,V>key - Entry's key
public V inp(Object key)
Space
inp in interface Space<K,V>key - Entry's key
public V in(Object key)
Space
in in interface Space<K,V>key - Entry's key
public V in(Object key,
long timeout)
Space
in in interface Space<K,V>key - Entry's keytimeout - millis to wait
public V rd(Object key)
Space
rd in interface Space<K,V>key - Entry's key
public V rd(Object key,
long timeout)
Space
rd in interface Space<K,V>key - Entry's keytimeout - millis to wait
public void run()
run in interface Runnablerun in class TimerTaskpublic void gc()
public int size(Object key)
size in interface LocalSpace<K,V>
public void addListener(Object key,
SpaceListener listener)
LocalSpace
addListener in interface LocalSpace<K,V>key - Entry's keylistener - a SpaceListener
public void addListener(Object key,
SpaceListener listener,
long timeout)
LocalSpace
addListener in interface LocalSpace<K,V>key - Entry's keylistener - a SpaceListener
public void removeListener(Object key,
SpaceListener listener)
LocalSpace
removeListener in interface LocalSpace<K,V>key - Entry's keylistener - the SpaceListenerpublic boolean isEmpty()
public Set getKeySet()
getKeySet in interface LocalSpace<K,V>public String getKeysAsString()
public void dump(PrintStream p,
String indent)
dump in interface Loggeable
public void notifyListeners(Object key,
Object value)
public void push(K key,
V value)
Space
push in interface Space<K,V>key - Entry's keyvalue - Object value
public void push(K key,
V value,
long timeout)
Space
push in interface Space<K,V>key - Entry's keyvalue - Object valuetimeout - timeout value
public void put(K key,
V value)
Space
put in interface Space<K,V>key - Entry's keyvalue - Object value
public void put(K key,
V value,
long timeout)
Space
put in interface Space<K,V>key - Entry's keyvalue - Object valuetimeout - timeout valuepublic boolean existAny(K[] keys)
existAny in interface Space<K,V>keys - array of keys to check
public boolean existAny(K[] keys,
long timeout)
existAny in interface Space<K,V>keys - array of keys to checktimeout - to wait for any of the entries to become available
public Map getEntries()
public void setEntries(Map entries)
entries - underlying entry map
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||