xmlBlaster 2.2.0 API

org.xmlBlaster.util.queue
Interface I_Storage

All Known Subinterfaces:
I_Map, I_Queue
All Known Implementing Classes:
CacheQueueInterceptorPlugin, JdbcQueue, JdbcQueueCommonTablePlugin, MapPlugin, PersistenceCachePlugin, RamQueuePlugin

public interface I_Storage


Method Summary
 void addStorageSizeListener(I_StorageSizeListener listener)
          Adds a storage size listener to the storage.
 long getMaxNumOfEntries()
          Returns the maximum number of elements for this queue
 long getNumOfBytes()
          Returns the amount of bytes currently in the queue If the implementation of this interface is not able to return the correct number of entries (for example if the implementation must make a remote call to a DB which is temporarly not available) it will return -1.
 long getNumOfEntries()
          Returns the number of elements in this queue.
 StorageId getStorageId()
          Returns the unique ID of this queue.
 I_StorageSizeListener[] getStorageSizeListeners()
           
 boolean hasStorageSizeListener(I_StorageSizeListener listener)
          Checks wether the specified listener is registered.
 boolean isShutdown()
          Performs what has to be done when the Map Plugin shuts down.
 boolean isTransient()
           
 void removeStorageSizeListener(I_StorageSizeListener listener)
          Removes the specified listener from the queue.
 

Method Detail

isTransient

boolean isTransient()
Returns:
true for RAM based queue, false for other types like CACHE and JDBC queues

getStorageId

StorageId getStorageId()
Returns the unique ID of this queue.

Returns:
For example "history_heronhello"

getMaxNumOfEntries

long getMaxNumOfEntries()
Returns the maximum number of elements for this queue

Returns:
The maximum number of elements in the queue

removeStorageSizeListener

void removeStorageSizeListener(I_StorageSizeListener listener)
Removes the specified listener from the queue.

Parameters:
listener - the listener to be removed. Currently only one. If you pass null, all queueSizeListeners are removed.
Throws:
java.lang.IllegalArgumentException - if the listener was not found

hasStorageSizeListener

boolean hasStorageSizeListener(I_StorageSizeListener listener)
Checks wether the specified listener is registered.

Parameters:
listener - the listener to check against. If you pass null it checks if at least one listener exists.
Returns:
true if the specified listener exists, false otherwise. If you passed null in the argument list it returns true if a listener exists.

getStorageSizeListeners

I_StorageSizeListener[] getStorageSizeListeners()
Returns:
the array of storage size listeners for this storage. It never returns null.

addStorageSizeListener

void addStorageSizeListener(I_StorageSizeListener listener)
Adds a storage size listener to the storage. Every time the number of storage entries changes we will fire a changed() event.

The changed() invocation is guaranteed to NOT be in any Queue specific synchronize

You can use this for example to add a threshold warning system.

Parameters:
listener - the listener to be added, adding the same listener multiple times will only remember one and fire once
Throws:
java.lang.IllegalArgumentException - if you pass null

getNumOfEntries

long getNumOfEntries()
Returns the number of elements in this queue. If the implementation of this interface is not able to return the correct number of entries (for example if the implementation must make a remote call to a DB which is temporary not available) it will return -1.

Returns:
int the number of elements

getNumOfBytes

long getNumOfBytes()
Returns the amount of bytes currently in the queue If the implementation of this interface is not able to return the correct number of entries (for example if the implementation must make a remote call to a DB which is temporarly not available) it will return -1.

Returns:
The number of elements currently in the queue

isShutdown

boolean isShutdown()
Performs what has to be done when the Map Plugin shuts down.


xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.