|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.xmlBlaster.util.queue.jdbc.JdbcQueueCommonTablePlugin
public final class JdbcQueueCommonTablePlugin
Persistence queue implementation on a DB based on JDBC.
Loaded via xmlBlaster.properties, there are three implementation.
org.xmlBlaster.util.queue.jdbc.JdbcQueueCommonTablePlugin
was the operational variant up to v1.6.2+ (2008-10) using one XB_ENTRIES table
org.xmlBlaster.util.queue.jdbc.JdbcQueue
is the new implementation since v1.6.3 using three tables XBSTORE, XBREF, XBMEAT
JdbcStorage[postgres]=org.xmlBlaster.util.queue.jdbc.JdbcQueue,\ url=jdbc:postgresql://localhost:5432/test,\ user=postgres,\ password=,\ connectionPoolSize=1,\ connectionBusyTimeout=90000,\ maxWaitingThreads=300,\ tableNamePrefix=XB_,\ entriesTableName=ENTRIES,\ dbAdmin=true
JdbcQueue
Field Summary | |
---|---|
private boolean |
debug
|
private int |
entryCounter
|
private Global |
glob
|
(package private) boolean |
isDown
|
private static boolean |
isWarned
|
private static java.util.logging.Logger |
log
|
private CommonTableDatabaseAccessor |
manager
|
private java.lang.String |
ME
|
private java.lang.Object |
modificationMonitor
Monitor object used to synchronize the count of sizes |
private boolean |
notifiedAboutAddOrRemove
|
private long |
numOfBytes
|
private long |
numOfEntries
|
private long |
numOfPersistentBytes
|
private long |
numOfPersistentEntries
|
private PluginInfo |
pluginInfo
|
private QueuePropertyBase |
property
|
private I_QueuePutListener |
putListener
|
private StorageId |
storageId
|
private StorageSizeListenerHelper |
storageSizeListenerHelper
|
Fields inherited from interface org.xmlBlaster.util.queue.I_Queue |
---|
IGNORE_PUT_INTERCEPTOR, USE_PUT_INTERCEPTOR |
Constructor Summary | |
---|---|
JdbcQueueCommonTablePlugin()
|
Method Summary | |
---|---|
void |
addPutListener(I_QueuePutListener l)
Register a listener which wants to be informed on put() events. |
void |
addStorageSizeListener(I_StorageSizeListener listener)
Adds a storage size listener to the storage. |
I_MapEntry |
change(I_MapEntry entry,
I_ChangeCallback callback)
|
I_MapEntry |
change(long uniqueId,
I_ChangeCallback callback)
This method is threadsafe because it makes a lookup for the updated entry within the synchronization point. |
long |
clear()
Clears everything and removes the queue (i.e. |
void |
destroy()
Cleans up the current queue (it deletes all the entries and frees the table used and cleans up all tables in the database). |
long |
embeddedObjectsToXml(java.io.OutputStream out,
java.util.Properties props)
Dump all entries of this map to the given output stream. |
long |
embeddedQueueObjectsToXml(java.io.OutputStream out,
java.util.Properties props)
NOTE: rename from embeddedObjectsToXml to embeddedQueueObjectsToXml as it used the map lookup and lost priority info Dump all entries of this queue to the given output stream. |
I_MapEntry |
get(long uniqueId)
Lookup entry without removing. |
I_MapEntry[] |
getAll(I_EntryFilter entryFilter)
Retrieve all entries in the storage, please take care on memory consumption. |
java.util.ArrayList |
getEntries(I_EntryFilter entryFilter)
Gets a copy of the entries (e.g the messages) in the queue. |
long[] |
getEntryReferences()
Gets the references of the entries in the queue. |
PluginInfo |
getInfo()
Enforced by I_StoragePlugin |
protected CommonTableDatabaseAccessor |
getJdbcQueueManagerCommonTable(PluginInfo pluginInfo)
Returns a JdbcManagerCommonTable for a specific queue. |
CommonTableDatabaseAccessor |
getManager()
|
long |
getMaxNumOfBytes()
returns the capacity (maximum bytes) for this queue |
long |
getMaxNumOfEntries()
Returns the maximum number of elements for this queue |
private long |
getNumOfBytes_()
It returns the size of the queue. |
long |
getNumOfBytes()
It returns the size of the queue. |
private long |
getNumOfEntries_()
It returns the size of the queue. |
long |
getNumOfEntries()
It returns the size of the queue. |
private long |
getNumOfPersistentBytes_(boolean verbose)
It returns the number of persistent entries in the queue. |
long |
getNumOfPersistentBytes()
It returns the number of persistent entries in the queue. |
private long |
getNumOfPersistentEntries_(boolean verbose)
It returns the number of persistent entries in the queue. |
long |
getNumOfPersistentEntries()
It returns the number of persistent entries in the queue. |
java.lang.Object |
getProperties()
Access the current queue configuration |
StorageId |
getStorageId()
Returns the unique ID of this queue |
I_StorageSizeListener[] |
getStorageSizeListeners()
|
java.lang.String |
getType()
Enforced by I_Plugin |
java.lang.String |
getVersion()
Enforced by I_Plugin |
boolean |
hasStorageSizeListener(I_StorageSizeListener listener)
Checks wether the specified listener is registered. |
void |
init(Global glob,
PluginInfo pluginInfo)
Enforced by I_Plugin |
void |
initialize(StorageId uniqueQueueId,
java.lang.Object userData)
Is called after the instance is created. |
boolean |
isNotifiedAboutAddOrRemove()
Defaults to false. |
boolean |
isShutdown()
Performs what has to be done when the Map Plugin shuts down. |
boolean |
isTransient()
|
I_QueueEntry |
peek()
Returns the first element in the queue but does not remove it from that queue (leaves it untouched). |
java.util.ArrayList |
peek(int numOfEntries,
long numOfBytes)
Returns maximum the first num element in the queue but does not remove it from that queue (leaves it untouched). |
java.util.ArrayList |
peekLowest(int numOfEntries,
long numOfBytes,
I_QueueEntry limitEntry,
boolean leaveOne)
Same as takeLowest but it does not remove the entries. |
java.util.ArrayList |
peekSamePriority(int numOfEntries,
long numOfBytes)
Returns maximum the first num element in the queue of highest priority but does not remove it from that queue (leaves it untouched). |
java.util.ArrayList |
peekStartAt(int numOfEntries,
long numOfBytes,
I_QueueEntry firstEntryExlusive)
Returns maximum the first num element in the queue but does not remove it from that queue (leaves it untouched). |
java.util.ArrayList |
peekWithLimitEntry(I_QueueEntry limitEntry)
Deprecated. |
java.util.ArrayList |
peekWithPriority(int numOfEntries,
long numOfBytes,
int minPriority,
int maxPriority)
Returns maximum given number of entries from the queue (none blocking). |
private boolean |
put(I_Entry entry)
Internally used for I_MapEntry and I_QueueEntry |
int |
put(I_MapEntry mapEntry)
Adds one entry and automatically increments the reference counter. |
void |
put(I_QueueEntry[] queueEntries,
boolean ignorePutInterceptor)
Puts one queue entry on top of the queue. |
void |
put(I_QueueEntry queueEntry,
boolean ignorePutInterceptor)
Puts one queue entry on top of the queue. |
boolean |
registerStorageProblemListener(I_StorageProblemListener listener)
registers a new listener to be notified. |
int |
remove()
Removes the first element in the queue This method does not block. |
int |
remove(I_MapEntry mapEntry)
|
int |
remove(long uniqueId)
|
long |
removeHead(I_QueueEntry toEntry)
removes the head of the queue until (but not included) the entry specified as the argument. |
long |
removeNum(long numOfEntries)
Removes max numOfEntries messages. |
I_MapEntry |
removeOldest()
Remove the oldest entry. |
void |
removePutListener(I_QueuePutListener l)
Remove the listener which wanted to be informed on put() events. |
int |
removeRandom(I_Entry entry)
Removes the given entry. |
boolean[] |
removeRandom(I_Entry[] queueEntries)
Removes the given entries. |
int |
removeRandom(long dataId)
Removes the given entry. |
boolean[] |
removeRandom(long[] dataIdArray)
Removes the given entries. |
void |
removeStorageSizeListener(I_StorageSizeListener listener)
Removes the specified listener from the queue. |
long |
removeWithLimitEntry(I_QueueEntry limitEntry,
boolean inclusive)
It removes the entries which are higher than the entry specified in the argument list. |
long |
removeWithPriority(long numOfEntries,
long numOfBytes,
int minPriority,
int maxPriority)
Removes max numOfEntries messages (or less depending on the numOfBytes). |
private void |
resetCounters()
This method resets all cached sizes and counters. |
private void |
setEntryCount(EntryCount entryCount)
|
void |
setNotifiedAboutAddOrRemove(boolean notify)
|
void |
setProperties(java.lang.Object userData)
Allows to overwrite properties which where passed on initialize() The properties which support hot configuration are depending on the used implementation |
void |
shutdown()
Shutdown the implementation, sync with data store |
private java.lang.String |
spaceLeft(long numOfEntries,
long sizeInBytes)
Check is storage is big enough for entry |
I_QueueEntry |
take()
Currently not supported by I_Queue. |
java.util.ArrayList |
take(int numOfEntries,
long numOfBytes)
Currently not supported by I_Queue. |
java.util.ArrayList |
takeLowest(int numOfEntries,
long numOfBytes,
I_QueueEntry limitEntry,
boolean leaveOne)
Takes entries from the back of the queue. |
java.util.ArrayList |
takeWithPriority(int numOfEntries,
long numOfBytes,
int minPriority,
int maxPriority)
Takes given number of entries out of the queue. |
java.lang.String |
toXml(java.lang.String extraOffset)
Dump state to XML string. |
boolean |
unRegisterStorageProblemListener(I_StorageProblemListener listener)
unregisters a listener. |
int |
update(I_QueueEntry queueEntry)
Updates the given message queue entry with a new value. |
void |
updateCounters(I_MapEntry entry)
|
java.lang.String |
usage()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private java.lang.String ME
private StorageId storageId
private boolean notifiedAboutAddOrRemove
private Global glob
private static java.util.logging.Logger log
private QueuePropertyBase property
private CommonTableDatabaseAccessor manager
private I_QueuePutListener putListener
private long numOfEntries
private long numOfPersistentEntries
private long numOfPersistentBytes
private long numOfBytes
boolean isDown
private java.lang.Object modificationMonitor
private PluginInfo pluginInfo
private boolean debug
private int entryCounter
private static boolean isWarned
private StorageSizeListenerHelper storageSizeListenerHelper
Constructor Detail |
---|
public JdbcQueueCommonTablePlugin()
Method Detail |
---|
public boolean isTransient()
isTransient
in interface I_Storage
private final void resetCounters()
private java.lang.String spaceLeft(long numOfEntries, long sizeInBytes)
mapEntry
- may not be null
protected CommonTableDatabaseAccessor getJdbcQueueManagerCommonTable(PluginInfo pluginInfo) throws XmlBlasterException
XmlBlasterException
public void initialize(StorageId uniqueQueueId, java.lang.Object userData) throws XmlBlasterException
initialize
in interface I_Map
initialize
in interface I_Queue
uniqueQueueId
- A unique name, allowing to create a unique name for a persistent store (e.g. file name)userData
- For example a Properties object or a String[] args object passing the configuration data
XmlBlasterException
I_Queue.initialize(StorageId, Object)
public void setProperties(java.lang.Object userData) throws XmlBlasterException
I_Map
setProperties
in interface I_Map
setProperties
in interface I_Queue
XmlBlasterException
I_Queue.setProperties(Object)
public java.lang.Object getProperties()
getProperties
in interface I_Map
getProperties
in interface I_Queue
public void setNotifiedAboutAddOrRemove(boolean notify)
setNotifiedAboutAddOrRemove
in interface I_Queue
public boolean isNotifiedAboutAddOrRemove()
I_Queue
isNotifiedAboutAddOrRemove
in interface I_Queue
public void addPutListener(I_QueuePutListener l)
I_Queue
addPutListener
in interface I_Queue
I_Queue.addPutListener(I_QueuePutListener)
public void removePutListener(I_QueuePutListener l)
I_Queue
removePutListener
in interface I_Queue
I_Queue.removePutListener(I_QueuePutListener)
public long[] getEntryReferences() throws XmlBlasterException
getEntryReferences
in interface I_Queue
XmlBlasterException
public java.util.ArrayList getEntries(I_EntryFilter entryFilter) throws XmlBlasterException
I_Queue
getEntries
in interface I_Queue
entryFilter
- if not null the you can control which entries to return
with the callback entryFilter.intercept(I_Entry).
XmlBlasterException
I_Queue.getEntries(I_EntryFilter)
public void put(I_QueueEntry queueEntry, boolean ignorePutInterceptor) throws XmlBlasterException
I_Queue
put
in interface I_Queue
ignorePutInterceptor
- if set to 'IGNORE_PUT_INTERCEPTOR=true' the put will not inform the
QueuePutListener that a put occurred.
XmlBlasterException
- in case an error occurs. Possible causes of
error can be a communication exception of the underlying implementation (jdbc, file system etc).I_Queue.put(I_QueueEntry, boolean)
private boolean put(I_Entry entry) throws XmlBlasterException
XmlBlasterException
public void put(I_QueueEntry[] queueEntries, boolean ignorePutInterceptor) throws XmlBlasterException
I_Queue
put
in interface I_Queue
ignorePutInterceptor
- if set to 'IGNORE_PUT_INTERCEPTOR=true' the put will not inform the
QueuePutListener that a put occurred.
XmlBlasterException
- in case an error occurs. Possible causes of
error can be a communication exception of the underlying implementation (jdbc, file system etc).I_Queue.put(I_QueueEntry[], boolean)
public StorageId getStorageId()
getStorageId
in interface I_Storage
public I_QueueEntry take() throws XmlBlasterException
XmlBlasterException
public java.util.ArrayList takeWithPriority(int numOfEntries, long numOfBytes, int minPriority, int maxPriority) throws XmlBlasterException
I_Queue
takeWithPriority
in interface I_Queue
numOfEntries
- Take numOfEntries entries, if -1 take all entries currently foundnumOfBytes
- so many entries are returned as not to exceed the amount specified. If the first
entry is bigger than this amount, it is returned anyway.minPriority
- The lower priority (inclusive), usually 0 lowest, 9 highestmaxPriority
- The higher priority (inclusive), usually 0 lowest, 9 highest
XmlBlasterException
- in case the underlying implementation gets an exception while retrieving the element.I_Queue.takeWithPriority(int,long,int,int)
public java.util.ArrayList take(int numOfEntries, long numOfBytes) throws XmlBlasterException
XmlBlasterException
public java.util.ArrayList takeLowest(int numOfEntries, long numOfBytes, I_QueueEntry limitEntry, boolean leaveOne) throws XmlBlasterException
I_Queue
takeLowest
in interface I_Queue
numOfEntries
- inclusive, zero up to numOfEntries, if -1 up to the whole queuenumOfBytes
- inclusive, and minimum one is returned (but not if limitEntry suppress it)leaveOne
- Usually set to false. (true for cache queue to never flush transient queue totally)
XmlBlasterException
I_Queue.takeLowest(int, long, I_QueueEntry, boolean)
public java.util.ArrayList peekLowest(int numOfEntries, long numOfBytes, I_QueueEntry limitEntry, boolean leaveOne) throws XmlBlasterException
I_Queue
peekLowest
in interface I_Queue
XmlBlasterException
I_Queue.peekLowest(int, long, I_QueueEntry, boolean)
public I_QueueEntry peek() throws XmlBlasterException
I_Queue
peek
in interface I_Queue
XmlBlasterException
- if the underlying implementation gets an exception.I_Queue.peek()
public java.util.ArrayList peek(int numOfEntries, long numOfBytes) throws XmlBlasterException
I_Queue
peek
in interface I_Queue
numOfEntries
- Access num entries, if -1 access all entries currently foundnumOfBytes
- is the maximum size in bytes of the array to return, -1 is unlimited .
XmlBlasterException
- if the underlying implementation gets an exception.I_Queue.peek(int,long)
public java.util.ArrayList peekStartAt(int numOfEntries, long numOfBytes, I_QueueEntry firstEntryExlusive) throws XmlBlasterException
I_Queue
peekStartAt
in interface I_Queue
numOfEntries
- Access num entries, if -1 access all entries currently foundnumOfBytes
- is the maximum size in bytes of the array to return, -1 is unlimited .
XmlBlasterException
- if the underlying implementation gets an exception.public java.util.ArrayList peekSamePriority(int numOfEntries, long numOfBytes) throws XmlBlasterException
I_Queue
peekSamePriority
in interface I_Queue
numOfEntries
- Access num entries, if -1 access all entries currently foundnumOfBytes
- so many entries are returned as not to exceed the amount specified. If the first
entry is bigger than this amount, it is returned anyway. -1 is unlimited.
XmlBlasterException
- if the underlying implementation gets an exception.I_Queue.peekSamePriority(int, long)
public java.util.ArrayList peekWithPriority(int numOfEntries, long numOfBytes, int minPriority, int maxPriority) throws XmlBlasterException
I_Queue
peekWithPriority
in interface I_Queue
numOfEntries
- Access num entries, if -1 take all entries currently foundnumOfBytes
- so many entries are returned as not to exceed the amount specified. If the first
entry is bigger than this amount, it is returned anyway.minPriority
- The lower priority (inclusive), usually 0 lowest, 9 highest, <0 is not allowedmaxPriority
- The higher priority (inclusive), usually 0 lowest, 9 highest, <0 is not allowed
XmlBlasterException
- in case the underlying implementation gets an exception while retrieving the element.I_Queue.peekWithPriority(int, long, int, int)
public java.util.ArrayList peekWithLimitEntry(I_QueueEntry limitEntry) throws XmlBlasterException
I_Queue
peekWithLimitEntry
in interface I_Queue
limitEntry
- the entry which limits the peek. Only entries of higher order, i.e.
entries having a higher priority, or same priority and lower uniqueId are
returned. If entryLimit is null or no entries are higher than entryLimit,
an empty list is returned.
Note: The limitEntry does not need to be in the queue.
XmlBlasterException
I_Queue.peekWithLimitEntry(I_QueueEntry)
public long removeWithLimitEntry(I_QueueEntry limitEntry, boolean inclusive) throws XmlBlasterException
I_Queue
removeWithLimitEntry
in interface I_Queue
limitEntry
- the entry which limits the remove. Only entries of higher order, i.e.
entries having a higher priority, or same priority and lower uniqueId are
deleted. If entryLimit is null or no entries are higher than entryLimit,
an empty list is returned.inclusive
- if 'true', then also the entry specified will be removed (if it exists). If false
the remove is exclusive, i.e. the specified entry is left in the queue.
Note: The limitEntry does not need to be in the queue.
XmlBlasterException
I_Queue.removeWithLimitEntry(I_QueueEntry, boolean)
public int remove() throws XmlBlasterException
remove
in interface I_Queue
XmlBlasterException
- if the underlying implementation gets an exception.public long removeNum(long numOfEntries) throws XmlBlasterException
removeNum
in interface I_Queue
numOfEntries
- Erase num entries or less if less entries are available, -1 erases everything
XmlBlasterException
- if the underlying implementation gets an exception.public int removeRandom(long dataId) throws XmlBlasterException
dataId
- the unique id. It must be unique within the storage area
of the implementing queue. In other words, if the underlying
implementation is on RAM, then the storage area is the JVM, that
is the queue must be unique in the same JVM. If the queue is a
jdbc, the dataId is unique in the DB used.
XmlBlasterException
public boolean[] removeRandom(long[] dataIdArray) throws XmlBlasterException
msgQueueEntry
- the entry to erase.
XmlBlasterException
public int removeRandom(I_Entry entry) throws XmlBlasterException
I_Queue
removeRandom
in interface I_Queue
entry
- The entry to erase.
XmlBlasterException
I_Queue.removeRandom(I_Entry)
public boolean[] removeRandom(I_Entry[] queueEntries) throws XmlBlasterException
I_Queue
removeRandom
in interface I_Queue
queueEntries
- the entries to erase.
XmlBlasterException
I_Queue.removeRandom(I_Entry[])
public long removeWithPriority(long numOfEntries, long numOfBytes, int minPriority, int maxPriority) throws XmlBlasterException
I_Queue
removeWithPriority
in interface I_Queue
numOfEntries
- Erase num entries or less if less entries are available, -1 erases everythingnumOfBytes
- so many entries are returned as not to exceed the amout specified. If the first
entry is bigger than this amount, it is returned anyway.minPriority
- The lower priority (inclusive), usually 0 lowest, 9 highestmaxPriority
- The higher priority (inclusive), usually 0 lowest, 9 highest
XmlBlasterException
- in case the underlying implementation gets an exception while retrieving the element.I_Queue.removeWithPriority(long, long, int, int)
private void setEntryCount(EntryCount entryCount)
private final long getNumOfEntries_() throws XmlBlasterException
XmlBlasterException
- if number is not retrievableI_Storage.getNumOfEntries()
public long getNumOfEntries()
getNumOfEntries
in interface I_Storage
I_Storage.getNumOfEntries()
private long getNumOfPersistentEntries_(boolean verbose) throws XmlBlasterException
verbose
- If true we throw an exception on errors, if false we ignore the error silently
XmlBlasterException
I_Queue.getNumOfPersistentEntries()
public long getNumOfPersistentEntries()
getNumOfPersistentEntries
in interface I_Map
getNumOfPersistentEntries
in interface I_Queue
I_Queue.getNumOfPersistentEntries()
public long getMaxNumOfEntries()
I_Storage
getMaxNumOfEntries
in interface I_Storage
I_Storage.getMaxNumOfEntries()
private long getNumOfBytes_() throws XmlBlasterException
XmlBlasterException
I_Storage.getNumOfBytes()
public long getNumOfBytes()
getNumOfBytes
in interface I_Storage
I_Storage.getNumOfBytes()
private long getNumOfPersistentBytes_(boolean verbose) throws XmlBlasterException
verbose
- If true we throw an exception on errors, if false we ignore the error silently
XmlBlasterException
I_Queue.getNumOfPersistentBytes()
public long getNumOfPersistentBytes()
getNumOfPersistentBytes
in interface I_Map
getNumOfPersistentBytes
in interface I_Queue
I_Queue.getNumOfPersistentBytes()
public long getMaxNumOfBytes()
I_Map
getMaxNumOfBytes
in interface I_Map
getMaxNumOfBytes
in interface I_Queue
I_Queue.getMaxNumOfBytes()
public int update(I_QueueEntry queueEntry) throws XmlBlasterException
XmlBlasterException
public CommonTableDatabaseAccessor getManager()
public long clear()
clear
in interface I_Map
clear
in interface I_Queue
public long removeHead(I_QueueEntry toEntry) throws XmlBlasterException
I_Queue
removeHead
in interface I_Queue
toEntry
- the entry until to remove.
XmlBlasterException
I_Queue.removeHead(I_QueueEntry)
public void shutdown()
shutdown
in interface I_Map
shutdown
in interface I_Plugin
shutdown
in interface I_Queue
public boolean isShutdown()
I_Storage
isShutdown
in interface I_Storage
public java.lang.String usage()
usage
in interface I_Map
usage
in interface I_Queue
public final java.lang.String toXml(java.lang.String extraOffset)
I_Queue
toXml
in interface I_Map
toXml
in interface I_Queue
extraOffset
- Indent the dump with given ASCII blanks
public void init(Global glob, PluginInfo pluginInfo)
init
in interface I_Plugin
I_Plugin.init(org.xmlBlaster.util.Global, PluginInfo)
public java.lang.String getType()
getType
in interface I_Plugin
public java.lang.String getVersion()
getVersion
in interface I_Plugin
public PluginInfo getInfo()
getInfo
in interface I_StoragePlugin
public void destroy() throws XmlBlasterException
destroy
in interface I_Map
XmlBlasterException
public I_MapEntry get(long uniqueId) throws XmlBlasterException
I_Map
get
in interface I_Map
XmlBlasterException
public I_MapEntry[] getAll(I_EntryFilter entryFilter) throws XmlBlasterException
I_Map
getAll
in interface I_Map
entryFilter
- null to get everything. If specified you can filter by this
callback the wanted entries.
XmlBlasterException
I_Map#getAll()
public int put(I_MapEntry mapEntry) throws XmlBlasterException
I_Map
put
in interface I_Map
XmlBlasterException
- in case an error occurs. Possible causes of
error can be a communication exception of the underlying implementation (jdbc, file system etc).I_Map.put(I_MapEntry)
public int remove(I_MapEntry mapEntry) throws XmlBlasterException
remove
in interface I_Map
XmlBlasterException
public int remove(long uniqueId) throws XmlBlasterException
remove
in interface I_Map
XmlBlasterException
public I_MapEntry removeOldest() throws XmlBlasterException
I_Map
removeOldest
in interface I_Map
XmlBlasterException
I_Map.removeOldest()
public boolean registerStorageProblemListener(I_StorageProblemListener listener)
I_StorageProblemNotifier
registerStorageProblemListener
in interface I_StorageProblemNotifier
I_StorageProblemNotifier.registerStorageProblemListener(I_StorageProblemListener)
public boolean unRegisterStorageProblemListener(I_StorageProblemListener listener)
I_StorageProblemNotifier
unRegisterStorageProblemListener
in interface I_StorageProblemNotifier
I_StorageProblemNotifier.unRegisterStorageProblemListener(I_StorageProblemListener)
public I_MapEntry change(I_MapEntry entry, I_ChangeCallback callback) throws XmlBlasterException
change
in interface I_Map
entry
- the entry to change. This is the old entry, i.e. the entry on which the modification
has to take place by callback.
Or it is the new entry and you can pass null for callback.
IMPORTANT: This method is not threadsafe since it does not make a lookup
to get the actual entry. The specified entry could be a dirty read, in which case the
current entry would be overwritten with this dirty value. If you want to work threadsafe
you should invoke change(long, callback). That method makes a lookup within the same
synchronization point.callback
- the object on which the callback method 'changeEntry' is invoked. The modification
of the object is done in that method. If you pass null, then the changeEntry is not invoked
and the processing continues with entry.
XmlBlasterException
- if something goes wrong when making the change (for example if the
entry is not in the map) or if the callback throws an exception.I_Map.change(I_MapEntry, I_ChangeCallback)
public void updateCounters(I_MapEntry entry) throws XmlBlasterException
updateCounters
in interface I_Map
entry
- the entry to change. This is the old entry, i.e. the entry on which the modification
has to take place by callback.
Or it is the new entry and you can pass null for callback.
IMPORTANT: This method is not threadsafe since it does not make a lookup
to get the actual entry. The specified entry could be a dirty read, in which case the
current entry would be overwritten with this dirty value. If you want to work threadsafe
you should invoke change(long, callback). That method makes a lookup within the same
synchronization point.
XmlBlasterException
- if something goes wrong when making the change (for example if the
entry is not in the map) or if the callback throws an exception.I_Map.change(I_MapEntry, I_ChangeCallback)
public I_MapEntry change(long uniqueId, I_ChangeCallback callback) throws XmlBlasterException
I_Map
change
in interface I_Map
uniqueId
- the uniqueId of the entry to change. This is the old entry, i.e. the entry on
which the modification has to take place.callback
- the object on which the callback method 'changeEntry' is invoked. The modification
of the object is done in that method. If you pass null, then the changeEntry is not invoked
and the processing continues with entry.
XmlBlasterException
- if something goes wrong when making the change (for example if the
entry is not in the map) or if the callback throws an exception.I_Map.change(long, I_ChangeCallback)
public void addStorageSizeListener(I_StorageSizeListener listener)
I_Storage
addStorageSizeListener
in interface I_Storage
listener
- the listener to be added, adding the same listener multiple times will only remember one and fire onceI_Storage.addStorageSizeListener(I_StorageSizeListener)
public void removeStorageSizeListener(I_StorageSizeListener listener)
I_Storage
removeStorageSizeListener
in interface I_Storage
listener
- the listener to be removed. Currently only one.
If you pass null, all queueSizeListeners are removed.I_Storage.removeStorageSizeListener(I_StorageSizeListener)
public boolean hasStorageSizeListener(I_StorageSizeListener listener)
I_Storage
hasStorageSizeListener
in interface I_Storage
listener
- the listener to check against. If you pass null
it checks if at least one listener exists.
I_Storage.hasStorageSizeListener(I_StorageSizeListener)
public I_StorageSizeListener[] getStorageSizeListeners()
getStorageSizeListeners
in interface I_Storage
I_Storage.getStorageSizeListeners()
public long embeddedQueueObjectsToXml(java.io.OutputStream out, java.util.Properties props) throws java.lang.Exception
I_Queue
embeddedQueueObjectsToXml
in interface I_Queue
out
- The output stream to dump the entriesprops
- Configuration properties, not yet specified, just pass null
java.lang.Exception
public long embeddedObjectsToXml(java.io.OutputStream out, java.util.Properties props) throws java.lang.Exception
I_Map
embeddedObjectsToXml
in interface I_Map
out
- The output stream to dump the entriesprops
- Configuration properties, not yet specified, just pass null
java.lang.Exception
I_Map.embeddedObjectsToXml(OutputStream, Properties)
|
xmlBlaster 2.2.0 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |