com.ibm.di.queue
Class MemBufferQFactory

java.lang.Object
  extended by com.ibm.di.queue.MemBufferQFactory

public class MemBufferQFactory
extends java.lang.Object

This class provides a global lookup table functionality. Every config instance has a hashtable associated with it where:

key : Thread.currentThread().getThreadGroup().getName()
object : hashtable of memory buffer pipes
Hash table of memory buffer pipes has :
key : any name specified by the user
object : MemBufferQ object.

This enables sharing of memory buffer pipes between two threads based on names giving it a named pipe like functionality.


Constructor Summary
MemBufferQFactory()
           
 
Method Summary
 void deleteQueue(java.lang.String pipeName)
          Deletes queue from memory
static java.util.Vector getActiveInstances()
          Gets all currently active instances.
static MemBufferQFactory getInstance()
          create a MemBufferQ factory for the current instance.
static MemBufferQFactory getInstance(java.lang.String inst)
          Get the MemBufferQ Factory for a particular instance.
 MemBufferQ getPipe(java.lang.String pipeName)
          Returns a reference to a memory buffer pipe.
static java.util.Vector getPipesForInstance(java.lang.String instName)
          Returns all active pipes for the specified instance.
 boolean isDoNotInitDB()
           
 MemBufferQ newPipe(java.lang.String pipeName, int watermark)
          Deprecated. 
 MemBufferQ newPipe(java.lang.String pipeName, int watermark, int pagesize)
          Returns reference to a memory buffer pipe.
 boolean queueExists(java.lang.String pipeName)
          Checks if queue exists in memory.
 void setDoNotInitDB(boolean doNotInitDB)
           
static void setLog(Log l)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemBufferQFactory

public MemBufferQFactory()
Method Detail

setLog

public static void setLog(Log l)

getInstance

public static MemBufferQFactory getInstance(java.lang.String inst)
Get the MemBufferQ Factory for a particular instance.

Parameters:
inst - The instance name
Returns:
MemBufferQFactory object for that instance

getInstance

public static MemBufferQFactory getInstance()
create a MemBufferQ factory for the current instance.


getPipe

public MemBufferQ getPipe(java.lang.String pipeName)
                   throws java.lang.Exception
Returns a reference to a memory buffer pipe.

Parameters:
pipeName - The name of memory buffer pipe of that instance
Returns:
Returns a refernce to MemBufferQ object if one exists else null
Throws:
java.lang.Exception - if either instName or pipeName is null

queueExists

public boolean queueExists(java.lang.String pipeName)
Checks if queue exists in memory.

Parameters:
pipeName - The name of the queue.
Returns:
Returns true if the queue exists. Otherwise, false is returned.

newPipe

@Deprecated
public MemBufferQ newPipe(java.lang.String pipeName,
                                     int watermark)
                   throws java.lang.Exception
Deprecated. 

Returns reference to a memory buffer pipe.

Parameters:
pipeName - The name of memory buffer pipe of that instance if not found create a memory buffer pipe with that name with paging disabled, only watermark specified and return refernce to the newly created pipe.
Returns:
A refernce to MemBufferQ object.
Throws:
java.lang.Exception - if either instName or pipeName is null

newPipe

public MemBufferQ newPipe(java.lang.String pipeName,
                          int watermark,
                          int pagesize)
                   throws java.lang.Exception
Returns reference to a memory buffer pipe.

Parameters:
pipeName - A name of memory buffer pipe of that instance if not found create a memory buffer pipe with that name with paging enabled and return refernce to the newly created pipe
Returns:
A refernce to MemBufferQ object
Throws:
java.lang.Exception - if either instName or pipeName is null.

getPipesForInstance

public static java.util.Vector getPipesForInstance(java.lang.String instName)
Returns all active pipes for the specified instance.

Parameters:
instName - An instance name.
Returns:
All active pipes in the specified instance

getActiveInstances

public static java.util.Vector getActiveInstances()
Gets all currently active instances.

Returns:
All active instances.

deleteQueue

public void deleteQueue(java.lang.String pipeName)
                 throws java.lang.Exception
Deletes queue from memory

Parameters:
pipeName -
Throws:
java.lang.Exception

isDoNotInitDB

public boolean isDoNotInitDB()

setDoNotInitDB

public void setDoNotInitDB(boolean doNotInitDB)