|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ibm.di.queue.MemBufferQ
public class MemBufferQ
A FIFO queue
Constructor Summary | |
---|---|
MemBufferQ(int nEntries)
Constructor Initializes the memory buffer pipe when paging is disabled |
|
MemBufferQ(int nEntries,
int pagesize)
Constructor Initializes the memory buffer pipe when paging is enabled |
Method Summary | |
---|---|
void |
actionPerformed(ActionEvent e)
|
void |
AddToChunk(Object x)
|
void |
blockAdd(boolean enable)
Enable disable blocking add this is used only when paging support is disabled. |
void |
enablePersistence(boolean enable)
enablePersistence : enable/disable paging support using system store |
void |
handle(int purpose)
handle : issues triggers to the registered callbacks |
void |
initDB(String sDBName,
String jdbcLogin,
String jdbcPassword,
String sTblName)
Initializes the system store paramemters. |
boolean |
isEmpty()
|
Object |
peek()
Same as read but does not remove data from the memq never use peek() for polling the memq in reader thread this is because the memq id implemented using a synchronized data structure and polling memq continuously would not relinquish control of memq to the writer thread as a result the reader will wait infinitely and writer would fail leading to loss of data. |
Object |
peekPage()
|
void |
purgeQueue()
Purges the queue. |
Object |
read()
synchronized method: The first item inserted in the queue and not yet removed. |
Object |
read(int timeout)
synchronized method: The first item inserted in the queue and not yet removed. |
void |
register(QCallback a,
int purpose)
Registers a callback which will be called when memQ is empty/full/data available it is assumed that the callback implements the handle()function. |
int |
size()
|
void |
terminate()
Terminates the system store threads. |
void |
terminate(boolean dropSystemStore)
terminates the system store threads and drops table if dropSystemStore set to true |
void |
unregister(QCallback a,
int purpose)
unregister : unregisters a callback |
void |
write(Object x)
write : add an object to the end of memq contains embedded logic that would trigger whenever memQ is full/empty or when an object is added to empty queue so that objects waiting for data can be triggered |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public MemBufferQ(int nEntries, int pagesize)
public MemBufferQ(int nEntries)
Method Detail |
---|
public void AddToChunk(Object x)
public void initDB(String sDBName, String jdbcLogin, String jdbcPassword, String sTblName) throws Exception
sDBName
- system store database namejdbcLogin
- username to connect to the dbjdbcPassword
- password to connect to the dbsTblName
- table name
Exception
- if system store is not initialized properlypublic boolean isEmpty()
public int size()
public Object read()
public Object read(int timeout)
public Object peekPage()
public void write(Object x) throws Exception
x
- object to be added
Exception
- if add failspublic Object peek()
register(QCallback a, int purpose)
public void register(QCallback a, int purpose)
a
- object to be triggeredpurpose
- full/empty/data availablepublic void unregister(QCallback a, int purpose) throws Exception
a
- object to be unregisteredpurpose
- full/empty/data available if -1 unregister the object from all
callbacks
Exception
- if callback object is not foundpublic void handle(int purpose)
purpose
- full/empty/data availablepublic void enablePersistence(boolean enable)
enable
- paging support enabled if true and disabled if falsepublic void blockAdd(boolean enable)
enable
- if true, add to memq blocks infinitely until there is space
for an object to be added to memq if false, add throws an
exception if memq is fullpublic void actionPerformed(ActionEvent e)
actionPerformed
in interface ActionListener
public void terminate()
public void terminate(boolean dropSystemStore)
dropSystemStore
- public void purgeQueue()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |