Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.lutris.appserver.server.sql.standard
Class StandardLogicalDatabase  view StandardLogicalDatabase download StandardLogicalDatabase.java

java.lang.Object
  extended bycom.lutris.appserver.server.sql.standard.StandardLogicalDatabase
All Implemented Interfaces:
com.lutris.appserver.server.sql.LogicalDatabase

public class StandardLogicalDatabase
extends java.lang.Object
implements com.lutris.appserver.server.sql.LogicalDatabase

Represents a logical database. Each logical database has a connection allocator and a object id allocator. The standard implementation of a local database is used when the database is described as of type Standard in DatabaseManager.DB.dbname.ClassType

The configuration data is specified in the section: DatabaseManager.DB.dbName

The following is a description of the sub fields:

Since:
LBS1.8
Version:
$Revision: 1.6.12.1 $

Field Summary
protected  com.lutris.appserver.server.sql.ConnectionAllocator connectionAllocator
          Database connection allocator.
protected  java.lang.String dbName
          The symbolic name of this logical database.
protected  java.sql.Driver driver
          Driver object object.
protected  com.lutris.appserver.server.sql.ObjectIdAllocator objectIdAllocator
          Object id manager.
 
Constructor Summary
StandardLogicalDatabase()
          Default constructor to configure a single logical database.
StandardLogicalDatabase(java.lang.String dbName, com.lutris.util.Config dbConfig)
          Creates and configures a single logical database.
 
Method Summary
 com.lutris.appserver.server.sql.DBConnection allocateConnection()
          Return the connection allocator object associated with this logical database.
 com.lutris.appserver.server.sql.ObjectId allocateObjectId()
          Return an object id for this logical database.
 com.lutris.appserver.server.sql.DBQuery createQuery()
          Return a query for use on this logical database.
 com.lutris.appserver.server.sql.DBTransaction createTransaction()
          Return a transaction for use on this logical database.
 int getActiveConnectionCount()
          Return the number of currently active connections.
 int getMaxConnectionCount()
          Return the maximum number of connections active at one time.
 java.util.Date getMaxConnectionCountDate()
          Return the time when the maximum connection count occured.
 java.lang.String getName()
          Return the symbolic name of this logical database.
 long getRequestCount()
          Return the number of database requests.
 java.lang.String getType()
          Return a description of the logical database type.
 void init(java.lang.String dbName, com.lutris.util.Config dbConfig)
          Initialize a single logical database.
 com.lutris.appserver.server.sql.ConnectionAllocator loadConnectionAllocator(com.lutris.util.Config connectionConfig)
          Return the connection allocator.
 com.lutris.appserver.server.sql.ObjectIdAllocator loadObjectIdAllocator(com.lutris.util.Config objIdConfig)
          Return the object id allocator.
 void resetMaxConnectionCount()
          Reset the maximum connection count and date.
 void shutdown()
          Immediately shutdown the logical database.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

connectionAllocator

protected com.lutris.appserver.server.sql.ConnectionAllocator connectionAllocator
Database connection allocator.


objectIdAllocator

protected com.lutris.appserver.server.sql.ObjectIdAllocator objectIdAllocator
Object id manager.


driver

protected java.sql.Driver driver
Driver object object. Important: a reference to this must be maintained or the driver class might be garbage collected out from under us.


dbName

protected java.lang.String dbName
The symbolic name of this logical database.

Constructor Detail

StandardLogicalDatabase

public StandardLogicalDatabase()
Default constructor to configure a single logical database. Note that the init() method must be called to configure the database.


StandardLogicalDatabase

public StandardLogicalDatabase(java.lang.String dbName,
                               com.lutris.util.Config dbConfig)
                        throws com.lutris.util.ConfigException,
                               java.sql.SQLException
Creates and configures a single logical database.

Method Detail

init

public void init(java.lang.String dbName,
                 com.lutris.util.Config dbConfig)
          throws com.lutris.util.ConfigException,
                 java.sql.SQLException
Initialize a single logical database. Used after the default constructor is called.

Specified by:
init in interface com.lutris.appserver.server.sql.LogicalDatabase

loadConnectionAllocator

public com.lutris.appserver.server.sql.ConnectionAllocator loadConnectionAllocator(com.lutris.util.Config connectionConfig)
                                                                            throws com.lutris.util.ConfigException
Return the connection allocator.


loadObjectIdAllocator

public com.lutris.appserver.server.sql.ObjectIdAllocator loadObjectIdAllocator(com.lutris.util.Config objIdConfig)
                                                                        throws com.lutris.util.ConfigException
Return the object id allocator.


allocateConnection

public com.lutris.appserver.server.sql.DBConnection allocateConnection()
                                                                throws java.sql.SQLException
Return the connection allocator object associated with this logical database.

Specified by:
allocateConnection in interface com.lutris.appserver.server.sql.LogicalDatabase

allocateObjectId

public com.lutris.appserver.server.sql.ObjectId allocateObjectId()
                                                          throws com.lutris.appserver.server.sql.ObjectIdException
Return an object id for this logical database.

Specified by:
allocateObjectId in interface com.lutris.appserver.server.sql.LogicalDatabase

createTransaction

public com.lutris.appserver.server.sql.DBTransaction createTransaction()
                                                                throws java.sql.SQLException
Return a transaction for use on this logical database.

Specified by:
createTransaction in interface com.lutris.appserver.server.sql.LogicalDatabase

createQuery

public com.lutris.appserver.server.sql.DBQuery createQuery()
                                                    throws java.sql.SQLException
Return a query for use on this logical database.

Specified by:
createQuery in interface com.lutris.appserver.server.sql.LogicalDatabase

shutdown

public void shutdown()
Immediately shutdown the logical database. This is normally only called by the database manager on shutdown.

Specified by:
shutdown in interface com.lutris.appserver.server.sql.LogicalDatabase

getName

public java.lang.String getName()
Return the symbolic name of this logical database.

Specified by:
getName in interface com.lutris.appserver.server.sql.LogicalDatabase

getType

public java.lang.String getType()
Return a description of the logical database type.

Specified by:
getType in interface com.lutris.appserver.server.sql.LogicalDatabase

getActiveConnectionCount

public int getActiveConnectionCount()
Return the number of currently active connections.

Specified by:
getActiveConnectionCount in interface com.lutris.appserver.server.sql.LogicalDatabase

getMaxConnectionCount

public int getMaxConnectionCount()
Return the maximum number of connections active at one time.

Specified by:
getMaxConnectionCount in interface com.lutris.appserver.server.sql.LogicalDatabase

getMaxConnectionCountDate

public java.util.Date getMaxConnectionCountDate()
Return the time when the maximum connection count occured.

Specified by:
getMaxConnectionCountDate in interface com.lutris.appserver.server.sql.LogicalDatabase

resetMaxConnectionCount

public void resetMaxConnectionCount()
Reset the maximum connection count and date.

Specified by:
resetMaxConnectionCount in interface com.lutris.appserver.server.sql.LogicalDatabase

getRequestCount

public long getRequestCount()
Return the number of database requests.

Specified by:
getRequestCount in interface com.lutris.appserver.server.sql.LogicalDatabase