Class JESpace<K,V>
java.lang.Object
org.jpos.util.Log
org.jpos.space.JESpace<K,V>
- All Implemented Interfaces:
AutoCloseable, Runnable, LocalSpace<K,V>, PersistentSpace, Space<K, V>, Loggeable, LogSource
public class JESpace<K,V>
extends Log
implements LocalSpace<K,V>, PersistentSpace, Loggeable, Runnable
BerkeleyDB Jave Edition based persistent space implementation
- Since:
- 1.6.5
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final longstatic final longstatic final long -
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.voidclose()voiddump(PrintStream p, String indent) booleanbooleanvoidgc()static JESpacestatic JESpaceTake 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.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()intMethods inherited from class Log
createDebug, createDebug, createError, createError, createFatal, createFatal, createInfo, createInfo, createLogEvent, createLogEvent, createTrace, createTrace, createWarn, createWarn, debug, debug, error, error, fatal, fatal, getLog, getLogger, getRealm, info, info, setLogger, setLogger, setRealm, trace, trace, warn, warn
-
Field Details
-
GC_DELAY
- See Also:
-
DEFAULT_TXN_TIMEOUT
- See Also:
-
DEFAULT_LOCK_TIMEOUT
- See Also:
-
-
Constructor Details
-
JESpace
- Throws:
SpaceError
-
-
Method Details
-
out
-
out
-
push
-
push
-
rdp
-
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. -
inp
-
existAny
-
existAny
-
put
Description copied from interface:SpaceWrite a single entry at the head of the queue discarding the other entries, with timeout. -
put
-
gc
- Throws:
com.sleepycat.je.DatabaseException
-
run
-
close
-
getSpace
-
getSpace
-
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
-
getKeySet
-
size
-
dump
-