com.reuters.rc.db
Class DbManager

java.lang.Object
  |
  +--com.reuters.rc.db.DbManager

public class DbManager
extends java.lang.Object

DbManager is the starting point for the application clients that wishes to access an ADB-like agent through the intefaces in this package. Clients can set/get their choice of DbFactory implementations by using the static methods in this class. DbManager also provides static methods to set/get the default rv transport, rv queue and the timeout values.

Author:
Jawaid Hakim, Cavit Aydin
See Also:
DbFactory

Field Summary
protected static double DEFAULT_TIMEOUT
          Default timeout in seconds.
protected static com.tibco.tibrv.TibrvQueue rvQueue_
          Default TibrvQueue.
protected static com.tibco.tibrv.TibrvTransport rvTrans_
          Default TibrvTransport.
 
Method Summary
static com.tibco.tibrv.TibrvQueue getDefaultQueue()
          Get the default TibrvQueue.
static double getDefaultTimeout()
          Get the default request timeout.
static com.tibco.tibrv.TibrvTransport getDefaultTransport()
          Get the default TibrvTransport.
static DbFactory getFactory()
          Get the instance of the factory.
static void setDefault(double timeout)
          Set up a default request timeout.
static void setDefault(com.tibco.tibrv.TibrvQueue rvQueue)
          Set up a default TibrvQueue.
static void setDefault(com.tibco.tibrv.TibrvTransport rvTrans)
          Set up a default TibrvTransport.
static void setDefault(com.tibco.tibrv.TibrvTransport rvTrans, com.tibco.tibrv.TibrvQueue rvQueue)
          Set up a default TibrvTransport/TibrvQueue.
static void setDefault(com.tibco.tibrv.TibrvTransport rvTrans, com.tibco.tibrv.TibrvQueue rvQueue, double defaultTimeout)
          Set up a default TibrvTransport/TibrvQueue.
static void setFactory(DbFactory pFactory)
          Set the factory instance.
static void setFactory(java.lang.String pFactoryClassName)
          Set the factory instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rvTrans_

protected static com.tibco.tibrv.TibrvTransport rvTrans_
Default TibrvTransport.

rvQueue_

protected static com.tibco.tibrv.TibrvQueue rvQueue_
Default TibrvQueue.

DEFAULT_TIMEOUT

protected static double DEFAULT_TIMEOUT
Default timeout in seconds. TODO: read from a config file.
Method Detail

setDefault

public static final void setDefault(com.tibco.tibrv.TibrvTransport rvTrans,
                                    com.tibco.tibrv.TibrvQueue rvQueue,
                                    double defaultTimeout)
                             throws DbBusinessException,
                                    DbSystemException
Set up a default TibrvTransport/TibrvQueue.
Parameters:
rvTrans - Default TibrvTransport.
rvQueue - Default TibrvQueue.
defaultTimeout - Default timeout in seconds for requests.
See Also:
getDefaultTransport(), getDefaultQueue()

setDefault

public static final void setDefault(com.tibco.tibrv.TibrvTransport rvTrans,
                                    com.tibco.tibrv.TibrvQueue rvQueue)
                             throws DbBusinessException,
                                    DbSystemException
Set up a default TibrvTransport/TibrvQueue.
Parameters:
rvTrans - Default TibrvTransport.
rvQueue - Default TibrvQueue.
See Also:
getDefaultTransport(), getDefaultQueue()

setDefault

public static final void setDefault(com.tibco.tibrv.TibrvTransport rvTrans)
                             throws DbBusinessException
Set up a default TibrvTransport.
Parameters:
rvTrans - Default TibrvTransport.
See Also:
getDefaultTransport()

setDefault

public static final void setDefault(com.tibco.tibrv.TibrvQueue rvQueue)
                             throws DbBusinessException
Set up a default TibrvQueue.
Parameters:
rvQueue - Default TibrvQueue.
See Also:
getDefaultQueue()

setDefault

public static final void setDefault(double timeout)
                             throws DbBusinessException
Set up a default request timeout.
Parameters:
timeout - Default request timeout.
See Also:
getDefaultTimeout()

getDefaultTransport

public static final com.tibco.tibrv.TibrvTransport getDefaultTransport()
Get the default TibrvTransport.
Returns:
Default TibrvTransport. Returns null if no default transport has been set up.
See Also:
setDefault(TibrvTransport)

getDefaultQueue

public static final com.tibco.tibrv.TibrvQueue getDefaultQueue()
Get the default TibrvQueue.
Returns:
Default TibrvQueue. Returns null if no default queue has been set up.
See Also:
setDefault(TibrvQueue)

getDefaultTimeout

public static final double getDefaultTimeout()
Get the default request timeout.
Returns:
Default request timeout.

setFactory

public static final void setFactory(DbFactory pFactory)
                             throws DbBusinessException
Set the factory instance.
Parameters:
pFactory - Factory instance

setFactory

public static final void setFactory(java.lang.String pFactoryClassName)
                             throws DbBusinessException,
                                    DbSystemException
Set the factory instance.
Parameters:
pFactoryClassName - The name of the factory class.
Throws:
DbException -  

getFactory

public static final DbFactory getFactory()
                                  throws DbBusinessException
Get the instance of the factory.
Returns:
the factory class instance


Copyright © 2002-2003 Reuters. All Rights Reserved.