クラス org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseに対する継承グラフ

Inheritance graph
[凡例]
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseのコラボレーション図

Collaboration graph
[凡例]
すべてのメンバ一覧

説明

A VirtualDatabase represents a database from client point of view and hide the complexity of the cluster distribution to the client. The client always uses the virtual database name and the C-JDBC Controller will use the real connections when an SQL request comes in.

作者:
Emmanuel Cecchet

Mathieu Peltier

Nicolas Modrzyk

Vadim Kassin

バージョン:
1.0

VirtualDatabase.java65 行で定義されています。

Public メソッド

 VirtualDatabase (String controllerName, String name, int maxConnections, boolean pool, int minThreads, int maxThreads, long maxThreadIdleTime, int sqlShortFormLength, AbstractBlobFilter blobFilter)
boolean isDistributed ()
boolean checkUserAuthentication (String virtualLogin, String virtualPassword)
boolean checkAdminAuthentication (String adminLogin, String adminPassword)
ControllerResultSet execReadRequest (SelectRequest request) throws SQLException
int execWriteRequest (AbstractWriteRequest request) throws SQLException
ControllerResultSet execWriteRequestWithKeys (AbstractWriteRequest request) throws SQLException
ControllerResultSet execReadStoredProcedure (StoredProcedure proc) throws SQLException
long begin (String login) throws SQLException
void commit (long transactionId) throws SQLException
void rollback (long transactionId) throws SQLException
void backupBackendWithCheckpoint (String backendName, String checkpointName, ArrayList tables) throws VirtualDatabaseException
void addBackend (DatabaseBackend db) throws VirtualDatabaseException
void addBackend (DatabaseBackend db, boolean checkForCompliance) throws VirtualDatabaseException
void removeCheckpoint (String checkpointName) throws VirtualDatabaseException
void removeBackend (DatabaseBackend db) throws VirtualDatabaseException
ArrayList viewCheckpointNames ()
void enableBackend (String backendName) throws VirtualDatabaseException
void enableBackendFromCheckpoint (String backendName, String checkpointName) throws VirtualDatabaseException
DatabaseBackend getAndCheckBackend (String backendName, int testEnable) throws VirtualDatabaseException
void disableBackend (String backendName) throws VirtualDatabaseException
void disableAllBackend () throws VirtualDatabaseException
void enableAllBackend () throws VirtualDatabaseException
void enableAllBackend (String checkpoint) throws VirtualDatabaseException
void disableBackendForCheckpoint (String backendName, String checkpointName) throws VirtualDatabaseException
final void acquireReadLockBackendLists () throws InterruptedException
final void releaseReadLockBackendLists ()
AuthenticationManager getAuthenticationManager ()
void setAuthenticationManager (AuthenticationManager authenticationManager)
ArrayList getBackends ()
ArrayList getAllBackendNames () throws VirtualDatabaseException
String getDatabaseName ()
String getDatabaseProductName ()
int getSQLShortFormLength ()
VirtualDatabaseMetaData getMetaData ()
DatabaseSchema getDatabaseSchemaFromActiveBackendsAndRefreshDatabaseProductNames () throws SQLException
void setDatabaseSchema (DatabaseSchema schema, boolean isStatic)
RequestManager getRequestManager ()
void setRequestManager (RequestManager requestManager)
String getVirtualDatabaseName ()
SQLMonitoring getSQLMonitor ()
void setSQLMonitor (SQLMonitoring sqlMonitor)
boolean equals (Object other)
String getXml ()
String getBackendInformation (String backendName) throws VirtualDatabaseException
String getName ()
int getCurrentNbOfThreads ()
void addCurrentNbOfThread ()
void removeCurrentNbOfThread ()
int getMinNbOfThreads ()
boolean isPoolConnectionThreads ()
void setMinNbOfThreads (int minNbOfThreads)
void setPoolConnectionThreads (boolean poolConnectionThreads)
long getMaxThreadIdleTime ()
void setMaxThreadIdleTime (long maxThreadIdleTime)
int getMaxNbOfConnections ()
int getMaxNbOfThreads ()
ArrayList getPendingConnections ()
void setMaxNbOfConnections (int maxNbOfConnections)
void setMaxNbOfThreads (int maxNbOfThreads)
ArrayList getActiveThreads ()
String[] viewBackendInformation (String backendName) throws VirtualDatabaseException
void addIdleThread ()
void removeIdleThread ()
int getIdleThreads ()
ArrayList viewAllBackendNames () throws VirtualDatabaseException
ArrayList viewAllClientNames ()
void disableAllBackendForCheckpoint (String checkpoint) throws VirtualDatabaseException
synchronized void shutdown (int level)
void shutdown () throws VirtualDatabaseException
void setBlobFilter (AbstractBlobFilter filter)
AbstractBlobFilter getBlobFilter ()
String getBackendState (String backendName) throws VirtualDatabaseException
String viewOwningController ()
void restoreBackendFromBackupCheckpoint (String databaseBackendName, String checkpointName) throws VirtualDatabaseException, BackupException, OctopusException
void storeBackendsCheckpoint ()
boolean hasRecoveryLog ()

Public 変数

Trace logger = null

Static Public 変数

final int CHECK_BACKEND_ENABLE = 1
final int CHECK_BACKEND_DISABLE = 0
final int NO_CHECK_BACKEND = -1

Protected メソッド

int execWriteStoredProcedure (StoredProcedure proc) throws SQLException
String getDistributionXml ()

Protected 変数

String name
AuthenticationManager authenticationManager
ArrayList backends
ReadPrioritaryFIFOWriteLock rwLock
RequestManager requestManager
Trace requestLogger = null
int maxNbOfConnections
boolean poolConnectionThreads
long maxThreadIdleTime
int minNbOfThreads
int maxNbOfThreads
int currentNbOfThreads
VirtualDatabaseMetaData metadata

変数

String controllerName

Private 変数

ArrayList activeThreads = new ArrayList()
int idleThreads = 0
ArrayList pendingConnections = new ArrayList()
SQLMonitoring sqlMonitor = null
int sqlShortFormLength
AbstractBlobFilter blobFilter
String databaseProductNames = "C-JDBC"


コンストラクタとデストラクタ

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.VirtualDatabase String  controllerName,
String  name,
int  maxConnections,
boolean  pool,
int  minThreads,
int  maxThreads,
long  maxThreadIdleTime,
int  sqlShortFormLength,
AbstractBlobFilter  blobFilter
 

Creates a new VirtualDatabase instance.

引数:
name the virtual database name.
maxConnections maximum number of concurrent connections.
pool should we use a pool of threads for handling connections?
minThreads minimum number of threads in the pool
maxThreads maximum number of threads in the pool
maxThreadIdleTime maximum time a thread can remain idle before being removed from the pool.
sqlShortFormLength maximum number of characters of an SQL statement to diplay in traces or exceptions
blobFilter encoding method for blobs
controllerName of the controller we belong to

VirtualDatabase.java174 行で定義されています。

参照先 org.objectweb.cjdbc.common.log.Trace.getLogger(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.requestLogger, と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.rwLock.

00178   {
00179     this.controllerName = controllerName;
00180     this.name = name;
00181     this.maxNbOfConnections = maxConnections;
00182     this.poolConnectionThreads = pool;
00183     this.minNbOfThreads = minThreads;
00184     this.maxNbOfThreads = maxThreads;
00185     this.maxThreadIdleTime = maxThreadIdleTime;
00186     this.sqlShortFormLength = sqlShortFormLength;
00187     this.blobFilter = blobFilter;
00188     backends = new ArrayList();
00189     rwLock = new ReadPrioritaryFIFOWriteLock();
00190     logger = Trace.getLogger("org.objectweb.cjdbc.controller.virtualdatabase."
00191         + name);
00192     requestLogger = Trace
00193         .getLogger("org.objectweb.cjdbc.controller.virtualdatabase.request."
00194             + name);
00195   }


メソッド

final void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.acquireReadLockBackendLists  )  throws InterruptedException
 

Acquires a read lock on the backend lists (both enabled and disabled backends). This should be called prior traversing the backend ArrayList.

例外:
InterruptedException if an error occurs

VirtualDatabase.java1050 行で定義されています。

参照元 org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer.AbstractLoadBalancer(), org.objectweb.cjdbc.controller.loadbalancer.paralleldb.ParallelDB_RR.chooseBackendForReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.paralleldb.ParallelDB_LPRF.chooseBackendForReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2_RR.execReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2_LPRF.execReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb0.RAIDb0.execReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_LPRF.executeLPRF(), org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_RR.executeRoundRobinRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_WRR.executeWRR(), org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.isCompatibleBackend(), と org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveBackendsData().

01051   {
01052     rwLock.acquireRead();
01053   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.addBackend DatabaseBackend  db,
boolean  checkForCompliance
throws VirtualDatabaseException
 

Add a backend to this virtual database.

引数:
db the database backend to add
checkForCompliance should load the driver ?
例外:
VirtualDatabaseException if an error occurs

VirtualDatabase.java595 行で定義されています。

00597   {
00598     if (db == null)
00599     {
00600       String msg = "Illegal null database backend in addBackend(DatabaseBackend) method";
00601       logger.error(msg);
00602       throw new VirtualDatabaseException(msg);
00603     }
00604 
00605     if (db.isReadEnabled())
00606     {
00607       String msg = "It is not allowed to add an enabled database.";
00608       logger.error(msg);
00609       throw new VirtualDatabaseException(msg);
00610     }
00611 
00612     try
00613     {
00614       rwLock.acquireWrite();
00615     }
00616     catch (InterruptedException e)
00617     {
00618       String msg = Translate.get(
00619           "loadbalancer.backendlist.acquire.writelock.failed", e);
00620       logger.error(msg);
00621       throw new VirtualDatabaseException(msg);
00622     }
00623 
00624     if (backends.indexOf(db) == -1)
00625     {
00626       // Initialize the driver and check the compliance
00627       try
00628       {
00629         if (logger.isDebugEnabled())
00630           logger.debug("Checking driver compliance");
00631         if (checkForCompliance)
00632           db.checkDriverCompliance(); // Also loads the
00633         // driver
00634       }
00635       catch (Exception e)
00636       {
00637         rwLock.releaseWrite();
00638         String msg = "Error while adding database backend " + db.getName()
00639             + " (" + e + ")";
00640         logger.warn(msg);
00641         throw new VirtualDatabaseException(msg);
00642       }
00643       db.setSqlShortFormLength(getSQLShortFormLength());
00644       backends.add(db);
00645 
00646       // Add the backend to the list
00647       if (logger.isDebugEnabled())
00648         logger.debug("Backend " + db.getName() + " added successfully");
00649 
00650       rwLock.releaseWrite(); // Relase the lock
00651     }
00652     else
00653     {
00654       rwLock.releaseWrite();
00655       String msg = "Duplicate backend " + db.getURL();
00656       logger.warn(msg);
00657       throw new VirtualDatabaseException(msg);
00658     }
00659 
00660   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.addBackend DatabaseBackend  db  )  throws VirtualDatabaseException
 

Add a backend to this virtual database.

引数:
db the database backend to add
例外:
VirtualDatabaseException if an error occurs

VirtualDatabase.java583 行で定義されています。

00584   {
00585     this.addBackend(db, true);
00586   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.addCurrentNbOfThread  ) 
 

Adds one to currentNbOfThreads. Warning! This method is not synchronized.

VirtualDatabase.java1433 行で定義されています。

参照元 org.objectweb.cjdbc.controller.core.ControllerWorkerThread.run().

01434   {
01435     currentNbOfThreads++;
01436   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.addIdleThread  ) 
 

Method add an idle thread. Warning! This method must be called in a synchronized block on activeThreads.

VirtualDatabase.java1581 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().

01582   {
01583     idleThreads++;
01584   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.backupBackendWithCheckpoint String  backendName,
String  checkpointName,
ArrayList  tables
throws VirtualDatabaseException
 

参照:
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBean.backupBackendWithCheckpoint

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java560 行で定義されています。

00562   {
00563     try
00564     {
00565       DatabaseBackend db = getAndCheckBackend(backendName, NO_CHECK_BACKEND);
00566       requestManager.backupBackendWithCheckpoint(db, checkpointName, tables, db
00567           .isReadEnabled());
00568     }
00569     catch (SQLException sql)
00570     {
00571       throw new VirtualDatabaseException(sql.getMessage());
00572     }
00573   }

long org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.begin String  login  )  throws SQLException
 

Begins a new transaction and returns the corresponding transaction identifier. This method is called from the driver when org.objectweb.cjdbc.driver.Connection#setAutoCommit(boolean)is called with false argument.

引数:
login the login used by the connection
戻り値:
an unique transaction identifier
例外:
SQLException if an error occurs

VirtualDatabase.java492 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().

00493   {
00494     try
00495     {
00496       long tid = requestManager.begin(login);
00497       if (requestLogger.isInfoEnabled())
00498         requestLogger.info("B " + tid);
00499       return tid;
00500     }
00501     catch (SQLException e)
00502     {
00503       String msg = "Begin failed (" + e.getMessage() + ")";
00504       logger.warn(msg);
00505       throw e;
00506     }
00507   }

boolean org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.checkAdminAuthentication String  adminLogin,
String  adminPassword
 

Checks if a given admin login/password is ok.

引数:
adminLogin admin user login
adminPassword admin user password
戻り値:
true if the login/password is known from the AuthenticationManager. Returns false if no AuthenticationManager is defined.

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java241 行で定義されています。

参照先 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.authenticationManager, org.objectweb.cjdbc.common.log.Trace.error(), と org.objectweb.cjdbc.controller.authentication.AuthenticationManager.isValidAdminUser().

00243   {
00244     if (authenticationManager == null)
00245     {
00246       logger.error("No authentification manager defined to check admin login '"
00247           + adminLogin + "'");
00248       return false;
00249     }
00250     else
00251       return authenticationManager.isValidAdminUser(new VirtualDatabaseUser(
00252           adminLogin, adminPassword));
00253   }

boolean org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.checkUserAuthentication String  virtualLogin,
String  virtualPassword
 

Checks if a given virtual login/password is ok.

引数:
virtualLogin the virtual user login
virtualPassword the virtual user password
戻り値:
true if the login/password is known from the AuthenticationManager. Returns false if no AuthenticationManager is defined.

VirtualDatabase.java218 行で定義されています。

参照先 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.authenticationManager, org.objectweb.cjdbc.common.log.Trace.error(), と org.objectweb.cjdbc.controller.authentication.AuthenticationManager.isValidVirtualUser().

00220   {
00221     if (authenticationManager == null)
00222     {
00223       logger.error("No authentification manager defined to check login '"
00224           + virtualLogin + "'");
00225       return false;
00226     }
00227     else
00228       return authenticationManager.isValidVirtualUser(new VirtualDatabaseUser(
00229           virtualLogin, virtualPassword));
00230   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.commit long  transactionId  )  throws SQLException
 

Commits a transaction given its id.

引数:
transactionId the transaction id
例外:
SQLException if an error occurs

VirtualDatabase.java515 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run(), と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.setRequestParameters().

00516   {
00517     try
00518     {
00519       if (requestLogger.isInfoEnabled())
00520         requestLogger.info("C " + transactionId);
00521       requestManager.commit(transactionId);
00522     }
00523     catch (SQLException e)
00524     {
00525       String msg = "Commit of transaction '" + transactionId + "' failed ("
00526           + e.getMessage() + ")";
00527       logger.warn(msg);
00528       throw e;
00529     }
00530   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.disableAllBackend  )  throws VirtualDatabaseException
 

Prepare this virtual database for shutdown. This turns off all the backends by cutting communication from this database. This does not prevents other virtual database to use shared backends. This doesn't create checkpoints either.

例外:
VirtualDatabaseException if an error occurs

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java944 行で定義されています。

参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.getName(), と org.objectweb.cjdbc.controller.backend.DatabaseBackend.isReadEnabled.

参照元 org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManager.completeFailedOnAllBackends(), と org.objectweb.cjdbc.controller.core.Controller.removeVirtualDatabase().

00945   {
00946     try
00947     {
00948       int size = this.backends.size();
00949       DatabaseBackend dbe;
00950       for (int i = 0; i < size; i++)
00951       {
00952         dbe = (DatabaseBackend) backends.get(i);
00953         if (dbe.isReadEnabled())
00954           requestManager.disableBackend(getAndCheckBackend(dbe.getName(),
00955               CHECK_BACKEND_DISABLE));
00956       }
00957     }
00958     catch (Exception e)
00959     {
00960       throw new VirtualDatabaseException(e.getMessage());
00961     }
00962   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.disableAllBackendForCheckpoint String  checkpoint  )  throws VirtualDatabaseException
 

参照:
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBean.disableAllBackendForCheckpoint(java.lang.String)

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java1633 行で定義されています。

01635   {
01636     if (checkpoint == null)
01637     {
01638       disableAllBackend();
01639       return;
01640     }
01641 
01642     try
01643     {
01644       this.acquireReadLockBackendLists();
01645       requestManager.disableBackendsForCheckpoint(backends, checkpoint);
01646       this.releaseReadLockBackendLists();
01647     }
01648     catch (Exception e)
01649     {
01650       throw new VirtualDatabaseException(e.getMessage());
01651     }
01652   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.disableBackend String  backendName  )  throws VirtualDatabaseException
 

参照:
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBean.disableBackend

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java917 行で定義されています。

00919   {
00920     try
00921     {
00922       requestManager.disableBackend(getAndCheckBackend(backendName,
00923           CHECK_BACKEND_DISABLE));
00924       requestManager.setDatabaseSchema(
00925           getDatabaseSchemaFromActiveBackendsAndRefreshDatabaseProductNames(),
00926           false);
00927     }
00928     catch (Exception e)
00929     {
00930       logger.error("An error occured while disabling backend " + backendName
00931           + " (" + e + ")");
00932       throw new VirtualDatabaseException(e.getMessage());
00933     }
00934   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.disableBackendForCheckpoint String  backendName,
String  checkpointName
throws VirtualDatabaseException
 

参照:
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBean.disableBackendForCheckpoint

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java1024 行で定義されています。

01026   {
01027     try
01028     {
01029       requestManager.disableBackendForCheckpoint(getAndCheckBackend(
01030           backendName, CHECK_BACKEND_DISABLE), checkpointName);
01031       requestManager.setDatabaseSchema(
01032           getDatabaseSchemaFromActiveBackendsAndRefreshDatabaseProductNames(),
01033           false);
01034     }
01035     catch (Exception e)
01036     {
01037       logger.error("An error occured while disabling backend " + backendName
01038           + " (" + e + ")");
01039       throw new VirtualDatabaseException(e.getMessage());
01040     }
01041   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.enableAllBackend String  checkpoint  )  throws VirtualDatabaseException
 

Prepare this virtual database for startup. This turns on all the backends

引数:
checkpoint checkpoint for recovery log
例外:
VirtualDatabaseException if fails

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java995 行で定義されています。

参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.isReadEnabled.

00997   {
00998     try
00999     {
01000       int size = this.backends.size();
01001       DatabaseBackend dbe;
01002       for (int i = 0; i < size; i++)
01003       {
01004         dbe = (DatabaseBackend) backends.get(i);
01005         if (!dbe.isReadEnabled())
01006         {
01007           if (checkpoint == null)
01008             enableBackend(((DatabaseBackend) backends.get(i)).getName());
01009           else
01010             enableBackendFromCheckpoint(((DatabaseBackend) backends.get(i))
01011                 .getName(), checkpoint);
01012         }
01013       }
01014     }
01015     catch (Exception e)
01016     {
01017       throw new VirtualDatabaseException(e.getMessage());
01018     }
01019   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.enableAllBackend  )  throws VirtualDatabaseException
 

Prepare this virtual database for startup. This turns on all the backends

例外:
VirtualDatabaseException if fails

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java969 行で定義されています。

参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.isReadEnabled.

00970   {
00971     try
00972     {
00973       int size = this.backends.size();
00974       DatabaseBackend dbe;
00975       for (int i = 0; i < size; i++)
00976       {
00977         dbe = (DatabaseBackend) backends.get(i);
00978         if (!dbe.isReadEnabled())
00979           enableBackend(((DatabaseBackend) backends.get(i)).getName());
00980       }
00981     }
00982     catch (Exception e)
00983     {
00984       logger.error(e);
00985       throw new VirtualDatabaseException(e.getMessage());
00986     }
00987   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.enableBackend String  backendName  )  throws VirtualDatabaseException
 

参照:
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBean.enableBackend

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java753 行で定義されています。

参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.getDatabaseProductName(), と org.objectweb.cjdbc.controller.backend.DatabaseBackend.getLastKnownCheckpoint().

00754   {
00755     // Call the Request Manager
00756     try
00757     {
00758       DatabaseBackend backend = getAndCheckBackend(backendName,
00759           CHECK_BACKEND_ENABLE);
00760       String lastCheckpoint = backend.getLastKnownCheckpoint();
00761       if (lastCheckpoint != null)
00762       {
00763         requestManager.enableBackendFromCheckpoint(backend, lastCheckpoint);
00764       }
00765       else
00766         requestManager.enableBackend(backend);
00767 
00768       // Update the list of database product names
00769       if (databaseProductNames.indexOf(backend.getDatabaseProductName()) == -1)
00770         databaseProductNames += "," + backend.getDatabaseProductName();
00771     }
00772     catch (Exception e)
00773     {
00774       throw new VirtualDatabaseException(e.getMessage());
00775     }
00776   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.enableBackendFromCheckpoint String  backendName,
String  checkpointName
throws VirtualDatabaseException
 

参照:
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBean.enableBackendFromCheckpoint

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java781 行で定義されています。

参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.getDatabaseProductName().

00783   {
00784     // Call the Request Manager
00785     try
00786     {
00787       DatabaseBackend backend = getAndCheckBackend(backendName,
00788           CHECK_BACKEND_ENABLE);
00789       requestManager.enableBackendFromCheckpoint(backend, checkpointName);
00790 
00791       // Update the list of database product names
00792       if (databaseProductNames.indexOf(backend.getDatabaseProductName()) == -1)
00793         databaseProductNames += "," + backend.getDatabaseProductName();
00794     }
00795     catch (Exception e)
00796     {
00797       throw new VirtualDatabaseException(
00798           "Failed to enable backend from checkpoint: " + e);
00799     }
00800   }

boolean org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.equals Object  other  ) 
 

Two virtual databases are equal if they have the same name and group.

引数:
other the object to compare with
戻り値:
true if the two virtual databases are equals

org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabaseで再定義されています。

VirtualDatabase.java1294 行で定義されています。

参照先 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getDatabaseName().

01295   {
01296     if ((other == null) || (!(other instanceof VirtualDatabase)))
01297       return false;
01298     else
01299     {
01300       VirtualDatabase db = (VirtualDatabase) other;
01301       return name.equals(db.getDatabaseName());
01302     }
01303   }

ControllerResultSet org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execReadRequest SelectRequest  request  )  throws SQLException
 

Performs a read request and returns the reply.

引数:
request the request to execute
戻り値:
a ControllerResultSet value
例外:
SQLException if the request fails

VirtualDatabase.java262 行で定義されています。

参照先 org.objectweb.cjdbc.controller.requestmanager.RequestManager.execReadRequest(), org.objectweb.cjdbc.common.log.Trace.info(), org.objectweb.cjdbc.common.log.Trace.isInfoEnabled(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.logError(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.logRequestTime(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.requestLogger, org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.sqlMonitor, と org.objectweb.cjdbc.common.log.Trace.warn().

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().

00264   {
00265     if (request == null)
00266     {
00267       String msg = "Request failed (null read request received)";
00268       logger.warn(msg);
00269       throw new SQLException(msg);
00270     }
00271 
00272     try
00273     {
00274       if (requestLogger.isInfoEnabled())
00275         requestLogger.info("S " + request.getTransactionId() + " "
00276             + request.getSQL());
00277 
00278       long start = 0;
00279       if (sqlMonitor != null)
00280         start = System.currentTimeMillis();
00281 
00282       ControllerResultSet rs = requestManager.execReadRequest(request);
00283 
00284       if (sqlMonitor != null)
00285         sqlMonitor.logRequestTime(request, System.currentTimeMillis() - start);
00286 
00287       return rs;
00288     }
00289     catch (SQLException e)
00290     {
00291       String msg = "Request '" + request.getId() + "' failed ("
00292           + e.getMessage() + ")";
00293       logger.warn(msg);
00294       if (sqlMonitor != null)
00295         sqlMonitor.logError(request);
00296       throw e;
00297     }
00298   }

ControllerResultSet org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execReadStoredProcedure StoredProcedure  proc  )  throws SQLException
 

Call a stored procedure that returns a ResultSet.

引数:
proc the stored procedure call
戻り値:
a java.sql.ResultSet value
例外:
SQLException if an error occurs

VirtualDatabase.java397 行で定義されています。

参照先 org.objectweb.cjdbc.controller.requestmanager.RequestManager.execReadStoredProcedure(), org.objectweb.cjdbc.common.log.Trace.info(), org.objectweb.cjdbc.common.log.Trace.isInfoEnabled(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.logError(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.logRequestTime(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.requestLogger, org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.sqlMonitor, と org.objectweb.cjdbc.common.log.Trace.warn().

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().

00399   {
00400     if (proc == null)
00401     {
00402       String msg = "Request failed (null stored procedure received)";
00403       logger.warn(msg);
00404       throw new SQLException(msg);
00405     }
00406 
00407     try
00408     {
00409       if (requestLogger.isInfoEnabled())
00410         requestLogger
00411             .info("S " + proc.getTransactionId() + " " + proc.getSQL());
00412 
00413       long start = 0;
00414       if (sqlMonitor != null)
00415         start = System.currentTimeMillis();
00416 
00417       ControllerResultSet rs = requestManager.execReadStoredProcedure(proc);
00418 
00419       if (sqlMonitor != null)
00420         sqlMonitor.logRequestTime(proc, System.currentTimeMillis() - start);
00421 
00422       return rs;
00423     }
00424     catch (SQLException e)
00425     {
00426       String msg = Translate.get("loadbalancer.storedprocedure.failed",
00427           new String[]{String.valueOf(proc.getId()), e.getMessage()});
00428       logger.warn(msg);
00429       if (sqlMonitor != null)
00430         sqlMonitor.logError(proc);
00431       throw e;
00432     }
00433   }

int org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execWriteRequest AbstractWriteRequest  request  )  throws SQLException
 

Performs a write request and returns the number of rows affected.

引数:
request the request to execute
戻り値:
number of rows affected
例外:
SQLException if the request fails

VirtualDatabase.java307 行で定義されています。

参照先 org.objectweb.cjdbc.controller.requestmanager.RequestManager.execWriteRequest(), org.objectweb.cjdbc.common.log.Trace.info(), org.objectweb.cjdbc.common.log.Trace.isInfoEnabled(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.logError(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.logRequestTime(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.requestLogger, org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.sqlMonitor, と org.objectweb.cjdbc.common.log.Trace.warn().

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().

00308   {
00309     if (request == null)
00310     {
00311       String msg = "Request failed (null write request received)";
00312       logger.warn(msg);
00313       throw new SQLException(msg);
00314     }
00315 
00316     try
00317     {
00318       if (requestLogger.isInfoEnabled())
00319         requestLogger.info("W " + request.getTransactionId() + " "
00320             + request.getSQL());
00321 
00322       long start = 0;
00323       if (sqlMonitor != null)
00324         start = System.currentTimeMillis();
00325 
00326       int result = requestManager.execWriteRequest(request);
00327 
00328       if (sqlMonitor != null)
00329         sqlMonitor.logRequestTime(request, System.currentTimeMillis() - start);
00330 
00331       return result;
00332     }
00333     catch (SQLException e)
00334     {
00335       String msg = "Request '" + request.getId() + "' failed ("
00336           + e.getMessage() + ")";
00337       logger.warn(msg);
00338       if (sqlMonitor != null)
00339         sqlMonitor.logError(request);
00340       throw e;
00341     }
00342   }

ControllerResultSet org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execWriteRequestWithKeys AbstractWriteRequest  request  )  throws SQLException
 

Performs a write request and returns the auto generated keys.

引数:
request the request to execute
戻り値:
auto generated keys
例外:
SQLException if the request fails

VirtualDatabase.java351 行で定義されています。

参照先 org.objectweb.cjdbc.controller.requestmanager.RequestManager.execWriteRequestWithKeys(), org.objectweb.cjdbc.common.log.Trace.info(), org.objectweb.cjdbc.common.log.Trace.isInfoEnabled(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.logError(), org.objectweb.cjdbc.controller.monitoring.SQLMonitoring.logRequestTime(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.requestLogger, org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.sqlMonitor, と org.objectweb.cjdbc.common.log.Trace.warn().

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().

00353   {
00354     if (request == null)
00355     {
00356       String msg = "Request failed (null write request received)";
00357       logger.warn(msg);
00358       throw new SQLException(msg);
00359     }
00360 
00361     try
00362     {
00363       if (requestLogger.isInfoEnabled())
00364         requestLogger.info("W " + request.getTransactionId() + " "
00365             + request.getSQL());
00366 
00367       long start = 0;
00368       if (sqlMonitor != null)
00369         start = System.currentTimeMillis();
00370 
00371       ControllerResultSet result = requestManager
00372           .execWriteRequestWithKeys(request);
00373 
00374       if (sqlMonitor != null)
00375         sqlMonitor.logRequestTime(request, System.currentTimeMillis() - start);
00376 
00377       return result;
00378     }
00379     catch (SQLException e)
00380     {
00381       String msg = "Request '" + request.getId() + "' failed ("
00382           + e.getMessage() + ")";
00383       logger.warn(msg);
00384       if (sqlMonitor != null)
00385         sqlMonitor.logError(request);
00386       throw e;
00387     }
00388   }

int org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execWriteStoredProcedure StoredProcedure  proc  )  throws SQLException [protected]
 

Call a stored procedure that performs an update.

引数:
proc the stored procedure call
戻り値:
number of rows affected
例外:
SQLException if an error occurs

VirtualDatabase.java442 行で定義されています。

00444   {
00445     if (proc == null)
00446     {
00447       String msg = "Request failed (null stored procedure received)";
00448       logger.warn(msg);
00449       throw new SQLException(msg);
00450     }
00451 
00452     try
00453     {
00454       if (requestLogger.isInfoEnabled())
00455         requestLogger
00456             .info("W " + proc.getTransactionId() + " " + proc.getSQL());
00457 
00458       long start = 0;
00459       if (sqlMonitor != null)
00460         start = System.currentTimeMillis();
00461 
00462       int result = requestManager.execWriteStoredProcedure(proc);
00463 
00464       if (sqlMonitor != null)
00465         sqlMonitor.logRequestTime(proc, System.currentTimeMillis() - start);
00466 
00467       return result;
00468     }
00469     catch (SQLException e)
00470     {
00471       String msg = Translate.get("loadbalancer.storedprocedure.failed",
00472           new String[]{String.valueOf(proc.getId()), e.getMessage()});
00473       logger.warn(msg);
00474       if (sqlMonitor != null)
00475         sqlMonitor.logError(proc);
00476       throw e;
00477     }
00478   }

ArrayList org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getActiveThreads  ) 
 

Returns the activeThreads.

戻り値:
ArrayList

VirtualDatabase.java1562 行で定義されています。

参照元 org.objectweb.cjdbc.common.monitor.client.AbstractClientDataCollector.checkClientIndex(), org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveClientsData(), org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveVirtualDatabasesData(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run(), org.objectweb.cjdbc.controller.core.ControllerWorkerThread.run(), org.objectweb.cjdbc.common.monitor.client.AbstractClientDataCollector.setClientIndex(), と org.objectweb.cjdbc.controller.core.shutdown.VirtualDatabaseShutdownThread.terminateClients().

01563   {
01564     return activeThreads;
01565   }

ArrayList org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getAllBackendNames  )  throws VirtualDatabaseException
 

参照:
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBean.viewAllBackendNames

VirtualDatabase.java1102 行で定義されています。

01103   {
01104     try
01105     {
01106       acquireReadLockBackendLists();
01107     }
01108     catch (InterruptedException e)
01109     {
01110       String msg = "Unable to acquire read lock on backend list in getAllBackendNames ("
01111           + e + ")";
01112       logger.error(msg);
01113       throw new VirtualDatabaseException(msg);
01114     }
01115 
01116     int size = backends.size();
01117     ArrayList result = new ArrayList();
01118     for (int i = 0; i < size; i++)
01119     {
01120       result.add(((DatabaseBackend) backends.get(i)).getName());
01121     }
01122 
01123     releaseReadLockBackendLists();
01124     return result;
01125   }

DatabaseBackend org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getAndCheckBackend String  backendName,
int  testEnable
throws VirtualDatabaseException
 

Find the DatabaseBackend corresponding to the given backend name and check if it is possible to disable this backend. In the case enable, this method also updates the virtual database schema by merging it with the one provided by this backend.

引数:
backendName backend to look for
testEnable NO_CHECK_BACKEND no check is done, if CHECK_BACKEND_DISABLE check for disable, if CHECK_BACKEND_ENABLE check for enable, else do not check
戻り値:
the backend to disable
例外:
VirtualDatabaseException if an error occurs

VirtualDatabase.java815 行で定義されています。

参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.checkDatabaseSchema(), org.objectweb.cjdbc.controller.backend.DatabaseBackend.getDatabaseSchema(), org.objectweb.cjdbc.controller.backend.DatabaseBackend.getName(), org.objectweb.cjdbc.controller.backend.DatabaseBackend.initializeConnections(), と org.objectweb.cjdbc.controller.backend.DatabaseBackend.isReadEnabled.

参照元 org.objectweb.cjdbc.common.monitor.backend.AbstractBackendDataCollector.collectValue().

00817   {
00818     try
00819     {
00820       acquireReadLockBackendLists();
00821     }
00822     catch (InterruptedException e)
00823     {
00824       String msg = "Unable to acquire read lock on backend list in getAndCheckBackend ("
00825           + e + ")";
00826       logger.error(msg);
00827       throw new VirtualDatabaseException(msg);
00828     }
00829 
00830     // Find the backend
00831     int size = backends.size();
00832     DatabaseBackend b = null;
00833     for (int i = 0; i < size; i++)
00834     {
00835       b = (DatabaseBackend) backends.get(i);
00836       if (b.getName().equals(backendName))
00837         break;
00838       else
00839         b = null;
00840     }
00841 
00842     // Check not null
00843     if (b == null)
00844     {
00845       releaseReadLockBackendLists();
00846       String msg = "Trying to access a non-existing backend " + backendName;
00847       logger.warn(msg);
00848       throw new VirtualDatabaseException(msg);
00849     }
00850 
00851     // Check enable/disable
00852     switch (testEnable)
00853     {
00854       case NO_CHECK_BACKEND :
00855         break;
00856       case CHECK_BACKEND_DISABLE :
00857         if (!b.isReadEnabled())
00858         {
00859           releaseReadLockBackendLists();
00860           String msg = "Backend " + backendName + " is already disabled";
00861           logger.warn(msg);
00862           throw new VirtualDatabaseException(msg);
00863         }
00864         break;
00865       case CHECK_BACKEND_ENABLE :
00866         if (b.isReadEnabled())
00867         {
00868           releaseReadLockBackendLists();
00869           String msg = "Backend " + backendName + " is already enabled";
00870           logger.warn(msg);
00871           throw new VirtualDatabaseException(msg);
00872         }
00873         break;
00874       default :
00875         String msg = "Unexpected parameter in getAndCheckBackend(...)";
00876         logger.error(msg);
00877         throw new VirtualDatabaseException(msg);
00878     }
00879 
00880     releaseReadLockBackendLists();
00881 
00882     if (testEnable == CHECK_BACKEND_ENABLE)
00883     {
00884       // Initialize backend for enable
00885       try
00886       {
00887         if (logger.isDebugEnabled())
00888           logger.debug("Initializing connections for backend " + b.getName());
00889         b.initializeConnections();
00890 
00891         if (logger.isDebugEnabled())
00892           logger.debug("Checking schema for backend " + b.getName());
00893         b.checkDatabaseSchema();
00894 
00895         DatabaseSchema backendSchema = b.getDatabaseSchema();
00896 
00897         if (backendSchema != null)
00898           requestManager.mergeDatabaseSchema(backendSchema);
00899         else
00900           logger.warn("Backend " + b.getName() + " has no defined schema.");
00901       }
00902       catch (SQLException e)
00903       {
00904         String msg = "Error while initalizing database backend " + b.getName()
00905             + " (" + e + ")";
00906         logger.warn(msg);
00907         throw new VirtualDatabaseException(msg);
00908       }
00909     }
00910 
00911     return b;
00912   }

AuthenticationManager org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getAuthenticationManager  ) 
 

Returns the authentication manager of this virtual database.

戻り値:
an AuthenticationManager instance

VirtualDatabase.java1072 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMetaData.getTablePrivileges(), org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.isCompatible(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run(), と org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.VirtualDatabaseConfiguration().

01073   {
01074     return authenticationManager;
01075   }

String org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getBackendInformation String  backendName  )  throws VirtualDatabaseException
 

参照:
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBean.getBackendInformation(String)

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java1367 行で定義されています。

参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.getName(), と org.objectweb.cjdbc.controller.backend.DatabaseBackend.getXml().

01369   {
01370     try
01371     {
01372       acquireReadLockBackendLists();
01373     }
01374     catch (InterruptedException e)
01375     {
01376       String msg = "Unable to acquire read lock on backend list in getBackendInformation ("
01377           + e + ")";
01378       logger.error(msg);
01379       throw new VirtualDatabaseException(msg);
01380     }
01381 
01382     // Find the backend
01383     int size = backends.size();
01384     DatabaseBackend b = null;
01385     for (int i = 0; i < size; i++)
01386     {
01387       b = (DatabaseBackend) backends.get(i);
01388       if (b.getName().equals(backendName))
01389         break;
01390       else
01391         b = null;
01392     }
01393 
01394     if (b == null)
01395     {
01396       releaseReadLockBackendLists();
01397       String msg = "Backend " + backendName + " does not exists.";
01398       logger.warn(msg);
01399       throw new VirtualDatabaseException(msg);
01400     }
01401 
01402     releaseReadLockBackendLists();
01403     return b.getXml();
01404   }

ArrayList org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getBackends  ) 
 

Return the list of all backends

戻り値:
ArrayList of DatabaseBackend Objects

VirtualDatabase.java1094 行で定義されています。

参照元 org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer.AbstractLoadBalancer(), org.objectweb.cjdbc.controller.loadbalancer.paralleldb.ParallelDB_RR.chooseBackendForReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.paralleldb.ParallelDB_LPRF.chooseBackendForReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2_RR.execReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2_LPRF.execReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb0.RAIDb0.execReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_LPRF.executeLPRF(), org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_RR.executeRoundRobinRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_WRR.executeWRR(), org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2.execWriteRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1ec_RR.getInformation(), org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveBackendsData(), org.objectweb.cjdbc.controller.requestmanager.RequestManager.setBackendsLastKnownCheckpointFromRecoveryLog(), と org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.VirtualDatabaseConfiguration().

01095   {
01096     return backends;
01097   }

String org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getBackendState String  backendName  )  throws VirtualDatabaseException
 

参照:
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBean.getBackendState(java.lang.String)

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java1704 行で定義されています。

参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.isReadEnabled.

01706   {
01707     DatabaseBackend backend = getAndCheckBackend(backendName, NO_CHECK_BACKEND);
01708     // Backend cannot be null, otherwise the above throws an
01709     // VirtualDatabaseException
01710     return "" + backend.isReadEnabled();
01711   }

AbstractBlobFilter org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getBlobFilter  ) 
 

Returns the blobFilter associated to this virtual database

戻り値:
Returns the blobFilter.

VirtualDatabase.java1696 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().

01697   {
01698     return blobFilter;
01699   }

int org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getCurrentNbOfThreads  ) 
 

Returns the currentNbOfThreads.

戻り値:
int

VirtualDatabase.java1425 行で定義されています。

参照元 org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveVirtualDatabasesData(), と org.objectweb.cjdbc.controller.core.ControllerWorkerThread.run().

01426   {
01427     return currentNbOfThreads;
01428   }

String org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getDatabaseName  ) 
 

Gets the virtual database name to be used by the client (C-JDBC driver) This method should be used for local references only (it is faster). For remote RMI calls, use getVirtualDatabaseName().

戻り値:
the virtual database name
参照:
VirtualDatabase.getVirtualDatabaseName()

VirtualDatabase.java1135 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.equals(), org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.equals(), org.objectweb.cjdbc.controller.requestmanager.RequestManager.initRequestManagerVariables(), と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().

01136   {
01137     return name;
01138   }

String org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getDatabaseProductName  ) 
 

参照:
org.objectweb.cjdbc.driver.DatabaseMetaData.getDatabaseProductName()

VirtualDatabase.java1143 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().

01144   {
01145     return databaseProductNames;
01146   }

DatabaseSchema org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getDatabaseSchemaFromActiveBackendsAndRefreshDatabaseProductNames  )  throws SQLException
 

Get the current database schema from merging the schemas of all active backends. This is needed when a backend is disabled.

戻り値:
the current database schema dynamically gathered
例外:
SQLException if an error occurs

VirtualDatabase.java1179 行で定義されています。

参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.getDatabaseProductName(), org.objectweb.cjdbc.controller.backend.DatabaseBackend.getDatabaseSchema(), org.objectweb.cjdbc.controller.backend.DatabaseBackend.isReadEnabled, と org.objectweb.cjdbc.common.sql.schema.DatabaseSchema.mergeSchema().

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMetaData.getDatabaseSchema().

01181   {
01182     try
01183     {
01184       acquireReadLockBackendLists();
01185     }
01186     catch (InterruptedException e)
01187     {
01188       String msg = "Unable to acquire read lock on backend list in getDatabaseSchemaFromActiveBackends ("
01189           + e + ")";
01190       logger.error(msg);
01191       throw new SQLException(msg);
01192     }
01193     // Build the new schema from all active backend's schemas
01194     int size = backends.size();
01195     DatabaseSchema schema = null;
01196     DatabaseBackend b = null;
01197     String dbProductNames = "C-JDBC";
01198     for (int i = 0; i < size; i++)
01199     {
01200       b = (DatabaseBackend) backends.get(i);
01201       if (b.isReadEnabled())
01202       {
01203         if (schema == null)
01204           schema = b.getDatabaseSchema();
01205         else
01206           schema.mergeSchema(b.getDatabaseSchema());
01207       }
01208 
01209       // Update the list of database product names
01210       if (dbProductNames.indexOf(b.getDatabaseProductName()) == -1)
01211         dbProductNames += "," + b.getDatabaseProductName();
01212     }
01213 
01214     releaseReadLockBackendLists();
01215     databaseProductNames = dbProductNames;
01216     logger.debug("getDatabaseSchemaFromActiveBackends - end");
01217     return schema;
01218   }

String org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getDistributionXml  )  [protected]
 

Get the XML dump of the Distribution element if any.

戻り値:
""

org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabaseで再定義されています。

VirtualDatabase.java1359 行で定義されています。

01360   {
01361     return "";
01362   }

int org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getIdleThreads  ) 
 

Returns the number of idle zorker threads. Warning! This method must be called in a synchronized block on activeThreads.

戻り値:
int

VirtualDatabase.java1601 行で定義されています。

参照元 org.objectweb.cjdbc.controller.core.ControllerWorkerThread.run().

01602   {
01603     return idleThreads;
01604   }

int org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getMaxNbOfConnections  ) 
 

Returns the maxNbOfConnections.

戻り値:
int

VirtualDatabase.java1512 行で定義されています。

参照元 org.objectweb.cjdbc.controller.core.ControllerWorkerThread.run().

01513   {
01514     return maxNbOfConnections;
01515   }

int org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getMaxNbOfThreads  ) 
 

Returns the maxNbOfThreads.

戻り値:
int

VirtualDatabase.java1522 行で定義されています。

参照元 org.objectweb.cjdbc.controller.core.ControllerWorkerThread.run().

01523   {
01524     return maxNbOfThreads;
01525   }

long org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getMaxThreadIdleTime  ) 
 

Returns the maxThreadIdleTime.

戻り値:
long

VirtualDatabase.java1492 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().

01493   {
01494     return maxThreadIdleTime;
01495   }

VirtualDatabaseMetaData org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getMetaData  ) 
 

参照:
org.objectweb.cjdbc.driver.DatabaseMetaData
戻り値:
associated metada for this database

VirtualDatabase.java1163 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().

01164   {
01165     if (metadata == null)
01166     {
01167       metadata = new VirtualDatabaseMetaData(this);
01168     }
01169     return metadata;
01170   }

int org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getMinNbOfThreads  ) 
 

Returns the minNbOfThreads.

戻り値:
int

VirtualDatabase.java1452 行で定義されています。

参照元 org.objectweb.cjdbc.controller.core.ControllerWorkerThread.run().

01453   {
01454     return minNbOfThreads;
01455   }

String org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getName  ) 
 

Gets the virtual database name to be used by the client (C-JDBC driver)

戻り値:
the virtual database name

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java1415 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.isCompatible(), org.objectweb.cjdbc.controller.jmx.CjdbcJmxAgent.registerMBean(), org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveVirtualDatabasesData(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run(), org.objectweb.cjdbc.controller.requestmanager.RequestManager.setBackendsLastKnownCheckpointFromRecoveryLog(), org.objectweb.cjdbc.controller.core.shutdown.VirtualDatabaseShutdownThread.terminateClients(), org.objectweb.cjdbc.controller.jmx.CjdbcJmxAgent.unregisterMBean(), org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.VirtualDatabaseConfiguration(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMetaData.VirtualDatabaseMetaData(), org.objectweb.cjdbc.controller.core.shutdown.VirtualDatabaseShutdownThread.VirtualDatabaseShutdownThread(), と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.VirtualDatabaseWorkerThread().

01416   {
01417     return name;
01418   }

ArrayList org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getPendingConnections  ) 
 

Returns the pendingConnections.

戻り値:
ArrayList

VirtualDatabase.java1532 行で定義されています。

参照元 org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveVirtualDatabasesData(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run(), と org.objectweb.cjdbc.controller.core.ControllerWorkerThread.run().

01533   {
01534     return pendingConnections;
01535   }

RequestManager org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getRequestManager  ) 
 

Gets the request manager associated to this database.

戻り値:
a RequestManager instance

VirtualDatabase.java1242 行で定義されています。

参照元 org.objectweb.cjdbc.common.monitor.scheduler.AbstractSchedulerDataCollector.collectValue(), org.objectweb.cjdbc.common.monitor.cache.AbstractCacheStatsDataCollector.collectValue(), org.objectweb.cjdbc.controller.core.Controller.isCacheEnableForDatabase(), org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.isCompatible(), org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveCacheData(), org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveCacheStatsData(), org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveSchedulerData(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run(), org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.VirtualDatabaseConfiguration(), と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMetaData.VirtualDatabaseMetaData().

01243   {
01244     return requestManager;
01245   }

SQLMonitoring org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getSQLMonitor  ) 
 

Returns the current SQL monitor

戻り値:
a SQLMonitoring instance or null if no monitor is defined

VirtualDatabase.java1273 行で定義されています。

参照元 org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveSQLStats().

01274   {
01275     return sqlMonitor;
01276   }

int org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getSQLShortFormLength  ) 
 

Return the sql short form length to use when reporting an error.

戻り値:
sql short form length
参照:
org.objectweb.cjdbc.common.sql.AbstractRequest.getSQLShortForm(int)

VirtualDatabase.java1154 行で定義されています。

参照元 org.objectweb.cjdbc.controller.loadbalancer.paralleldb.ParallelDB_RR.chooseBackendForReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.paralleldb.ParallelDB_LPRF.chooseBackendForReadRequest(), org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManager.completeFailedOnAllBackends(), org.objectweb.cjdbc.controller.requestmanager.distributed.SingleDBDistributedRequestManager.execDistributedWriteRequest(), org.objectweb.cjdbc.controller.requestmanager.distributed.RAIDb2DistributedRequestManager.execDistributedWriteRequest(), org.objectweb.cjdbc.controller.requestmanager.distributed.RAIDb1DistributedRequestManager.execDistributedWriteRequest(), org.objectweb.cjdbc.controller.loadbalancer.singledb.SingleDB.execReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2_RR.execReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2_LPRF.execReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb0.RAIDb0.execReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.paralleldb.ParallelDB.execReadRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_LPRF.executeLPRF(), org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_RR.executeRoundRobinRequest(), org.objectweb.cjdbc.controller.loadbalancer.raidb1.RAIDb1_WRR.executeWRR(), と org.objectweb.cjdbc.controller.loadbalancer.raidb2.RAIDb2.execWriteRequest().

01155   {
01156     return sqlShortFormLength;
01157   }

String org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getVirtualDatabaseName  ) 
 

Gets the virtual database name to be used by the client (C-JDBC driver)

戻り値:
the virtual database name

VirtualDatabase.java1262 行で定義されています。

01263   {
01264     return name;
01265   }

String org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.getXml  ) 
 

Retrieves this VirtualDatabase object in xml format

戻り値:
xml formatted string that conforms to c-jdbc.dtd

VirtualDatabase.java1310 行で定義されています。

参照元 org.objectweb.cjdbc.controller.core.Controller.viewDatabaseXml().

01311   {
01312     StringBuffer info = new StringBuffer();
01313     info.append("<" + DatabasesXmlTags.ELT_VirtualDatabase + " "
01314         + DatabasesXmlTags.ATT_name + "=\"" + this.getName() + "\" "
01315         + DatabasesXmlTags.ATT_maxNbOfConnections + "=\""
01316         + this.getMaxNbOfConnections() + "\" "
01317         + DatabasesXmlTags.ATT_poolThreads + "=\""
01318         + this.isPoolConnectionThreads() + "\" "
01319         + DatabasesXmlTags.ATT_minNbOfThreads + "=\""
01320         + this.getMinNbOfThreads() + "\" "
01321         + DatabasesXmlTags.ATT_maxNbOfThreads + "=\""
01322         + this.getMaxNbOfThreads() + "\" "
01323         + DatabasesXmlTags.ATT_maxThreadIdleTime + "=\""
01324         + this.getMaxThreadIdleTime() / 1000
01325         + DatabasesXmlTags.ATT_sqlDumpLength + "=\"" + this.sqlShortFormLength
01326         + "\" " + DatabasesXmlTags.ATT_blobEncodingMethod + "=\""
01327         + this.blobFilter.getXml() + "\">");
01328 
01329     info.append(getDistributionXml());
01330 
01331     if (this.getSQLMonitor() != null)
01332       info.append(sqlMonitor.getXml());
01333     if (this.getAuthenticationManager() != null)
01334       info.append(authenticationManager.getXml());
01335 
01336     try
01337     {
01338       acquireReadLockBackendLists();
01339       int size = backends.size();
01340       for (int i = 0; i < size; i++)
01341         info.append(((DatabaseBackend) backends.get(i)).getXml());
01342       releaseReadLockBackendLists();
01343     }
01344     catch (InterruptedException e)
01345     {
01346       logger.error(Translate.get("virtualdatabase.fail.read.lock", e));
01347     }
01348     if (requestManager != null)
01349       info.append(requestManager.getXml());
01350     info.append("</" + DatabasesXmlTags.ELT_VirtualDatabase + ">");
01351     return info.toString();
01352   }

boolean org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.hasRecoveryLog  ) 
 

参照:
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBean.hasRecoveryLog()

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java1747 行で定義されています。

01748   {
01749     AbstractRecoveryLog log = requestManager.getRecoveryLog();
01750     if (log == null)
01751       return false;
01752     else
01753       return true;
01754   }

boolean org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.isDistributed  ) 
 

Is this virtual database distributed ?

戻り値:
false

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabaseで再定義されています。

VirtualDatabase.java202 行で定義されています。

参照元 org.objectweb.cjdbc.controller.core.Controller.isDistributedVirtualDatabase().

00203   {
00204     return false;
00205   }

boolean org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.isPoolConnectionThreads  ) 
 

Returns the poolConnectionThreads.

戻り値:
boolean

VirtualDatabase.java1462 行で定義されています。

01463   {
01464     return poolConnectionThreads;
01465   }

final void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.releaseReadLockBackendLists  ) 
 

Releases the read lock on the backend lists (both enabled and disabled backends). This should be called after traversing the backend ArrayList.

VirtualDatabase.java1060 行で定義されています。

参照元 org.objectweb.cjdbc.controller.loadbalancer.AbstractLoadBalancer.AbstractLoadBalancer(), org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabase.isCompatibleBackend(), と org.objectweb.cjdbc.controller.monitoring.datacollector.DataCollector.retrieveBackendsData().

01061   {
01062     rwLock.releaseRead();
01063   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.removeBackend DatabaseBackend  db  )  throws VirtualDatabaseException
 

Remove a backend from this virtual database.

引数:
db the database backend to remove
例外:
VirtualDatabaseException if an error occurs

VirtualDatabase.java687 行で定義されています。

00688   {
00689     if (db == null)
00690     {
00691       String msg = "Illegal null database backend in removeBackend(DatabaseBackend) method";
00692       logger.error(msg);
00693       throw new VirtualDatabaseException(msg);
00694     }
00695 
00696     try
00697     {
00698       rwLock.acquireWrite();
00699     }
00700     catch (InterruptedException e)
00701     {
00702       String msg = Translate.get(
00703           "loadbalancer.backendlist.acquire.writelock.failed", e);
00704       logger.error(msg);
00705       throw new VirtualDatabaseException(msg);
00706     }
00707 
00708     // Sanity checks
00709     int idx = backends.indexOf(db);
00710     if (idx == -1)
00711     {
00712       rwLock.releaseWrite(); // Release the lock
00713       String msg = "Trying to remove a non-existing backend " + db.getName();
00714       logger.warn(msg);
00715       throw new VirtualDatabaseException(msg);
00716     }
00717 
00718     if (((DatabaseBackend) backends.get(idx)).isReadEnabled())
00719     {
00720       rwLock.releaseWrite(); // Release the lock
00721       String msg = "Trying to remove an enabled backend " + db.getName();
00722       logger.error(msg);
00723       throw new VirtualDatabaseException(msg);
00724     }
00725 
00726     // Remove it
00727     backends.remove(idx);
00728     rwLock.releaseWrite(); // Relase the lock
00729 
00730     if (logger.isDebugEnabled())
00731       logger.debug("Backend " + db.getName() + " removed successfully");
00732   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.removeCheckpoint String  checkpointName  )  throws VirtualDatabaseException
 

Remove a checkpoint from the recovery log of this virtual database

引数:
checkpointName to remove
例外:
VirtualDatabaseException if an error occurs

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java668 行で定義されています。

00670   {
00671     try
00672     {
00673       requestManager.removeCheckpoint(checkpointName);
00674     }
00675     catch (Exception e)
00676     {
00677       throw new VirtualDatabaseException(e.getMessage());
00678     }
00679   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.removeCurrentNbOfThread  ) 
 

Substract one to currentNbOfThreads. Warning! This method is not synchronized.

VirtualDatabase.java1442 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().

01443   {
01444     currentNbOfThreads--;
01445   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.removeIdleThread  ) 
 

Remove an idle thread. Warning! This method must be called in a synchronized block on activeThreads.

VirtualDatabase.java1590 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().

01591   {
01592     idleThreads--;
01593   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.restoreBackendFromBackupCheckpoint String  databaseBackendName,
String  checkpointName
throws VirtualDatabaseException, BackupException, OctopusException
 

参照:
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBean.restoreBackendFromBackupCheckpoint(java.lang.String, java.lang.String)

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java1725 行で定義されています。

01728   {
01729     DatabaseBackend backend = getAndCheckBackend(databaseBackendName,
01730         NO_CHECK_BACKEND);
01731     // Backend cannot be null, otherwise the above throws an
01732     // VirtualDatabaseException
01733     requestManager.restoreBackendFromBackupCheckpoint(backend, checkpointName);
01734   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.rollback long  transactionId  )  throws SQLException
 

Rollbacks a transaction given its id.

引数:
transactionId the transaction id
例外:
SQLException if an error occurs

VirtualDatabase.java538 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().

00539   {
00540     try
00541     {
00542       if (requestLogger.isInfoEnabled())
00543         requestLogger.info("R " + transactionId);
00544       requestManager.rollback(transactionId);
00545     }
00546     catch (SQLException e)
00547     {
00548       String msg = "Rollback of transaction '" + transactionId + "' failed ("
00549           + e.getMessage() + ")";
00550       logger.warn(msg);
00551       throw e;
00552     }
00553   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.setAuthenticationManager AuthenticationManager  authenticationManager  ) 
 

Sets the authentication manager for this virtual database.

引数:
authenticationManager the AuthenticationManager to set

VirtualDatabase.java1083 行で定義されています。

01085   {
01086     this.authenticationManager = authenticationManager;
01087   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.setBlobFilter AbstractBlobFilter  filter  ) 
 

Sets the blob encoder

引数:
filter blob encode

VirtualDatabase.java1686 行で定義されています。

01687   {
01688     this.blobFilter = filter;
01689   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.setDatabaseSchema DatabaseSchema  schema,
boolean  isStatic
 

Sets a new database schema for this database if no one exist or merge the given schema to the existing one. A static schema can only be replaced by another static schema.

引数:
schema the new database shema
isStatic true if the schema should be static

VirtualDatabase.java1228 行で定義されています。

01229   {
01230     if (requestManager != null)
01231       requestManager.setDatabaseSchema(schema, isStatic);
01232     else
01233       logger
01234           .warn("Unable to set database schema, no request manager has been defined.");
01235   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.setMaxNbOfConnections int  maxNbOfConnections  ) 
 

Sets the maxNbOfConnections.

引数:
maxNbOfConnections The maxNbOfConnections to set

VirtualDatabase.java1542 行で定義されています。

01543   {
01544     this.maxNbOfConnections = maxNbOfConnections;
01545   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.setMaxNbOfThreads int  maxNbOfThreads  ) 
 

Sets the maxNbOfThreads.

引数:
maxNbOfThreads The maxNbOfThreads to set

VirtualDatabase.java1552 行で定義されています。

01553   {
01554     this.maxNbOfThreads = maxNbOfThreads;
01555   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.setMaxThreadIdleTime long  maxThreadIdleTime  ) 
 

Sets the maxThreadIdleTime.

引数:
maxThreadIdleTime The maxThreadIdleTime to set

VirtualDatabase.java1502 行で定義されています。

01503   {
01504     this.maxThreadIdleTime = maxThreadIdleTime;
01505   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.setMinNbOfThreads int  minNbOfThreads  ) 
 

Sets the minNbOfThreads.

引数:
minNbOfThreads The minNbOfThreads to set

VirtualDatabase.java1472 行で定義されています。

01473   {
01474     this.minNbOfThreads = minNbOfThreads;
01475   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.setPoolConnectionThreads boolean  poolConnectionThreads  ) 
 

Sets the poolConnectionThreads.

引数:
poolConnectionThreads The poolConnectionThreads to set

VirtualDatabase.java1482 行で定義されています。

01483   {
01484     this.poolConnectionThreads = poolConnectionThreads;
01485   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.setRequestManager RequestManager  requestManager  ) 
 

Sets a new request manager for this database.

引数:
requestManager the new request manager.

org.objectweb.cjdbc.controller.virtualdatabase.DistributedVirtualDatabaseで再定義されています。

VirtualDatabase.java1252 行で定義されています。

01253   {
01254     this.requestManager = requestManager;
01255   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.setSQLMonitor SQLMonitoring  sqlMonitor  ) 
 

Sets a new SQL Monitor

引数:
sqlMonitor the new SQL monitor

VirtualDatabase.java1283 行で定義されています。

01284   {
01285     this.sqlMonitor = sqlMonitor;
01286   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.shutdown  )  throws VirtualDatabaseException
 

Shutdown this virtual database in fast mode, disconnect clients

例外:
VirtualDatabaseException if fails

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java1674 行で定義されています。

参照先 org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread.run().

01675   {
01676     VirtualDatabaseShutdownThread shutdown = new VirtualDatabaseShutdownThread(
01677         this, ControllerConstants.CONTROLLER_SHUTDOWN_FAST);
01678     shutdown.run();
01679   }

synchronized void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.shutdown int  level  ) 
 

Shutdown this virtual database. Finish all threads and stop connection to backends

引数:
level Smart or Fast

VirtualDatabase.java1662 行で定義されています。

参照先 org.objectweb.cjdbc.controller.core.shutdown.ShutdownThread.run().

参照元 org.objectweb.cjdbc.controller.core.Controller.shutdownDatabase().

01663   {
01664     VirtualDatabaseShutdownThread vdst = new VirtualDatabaseShutdownThread(
01665         this, level);
01666     vdst.run();
01667   }

void org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.storeBackendsCheckpoint  ) 
 

Write the checkpoints for all backends on the recovery log

VirtualDatabase.java1739 行で定義されています。

01740   {
01741     requestManager.storeBackendsCheckpoint(this.name, getBackends());
01742   }

ArrayList org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.viewAllBackendNames  )  throws VirtualDatabaseException
 

参照:
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBean.viewAllBackendNames()

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java1609 行で定義されています。

参照元 org.objectweb.cjdbc.controller.core.Controller.listBackends().

01610   {
01611     return this.getAllBackendNames();
01612   }

ArrayList org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.viewAllClientNames  ) 
 

Get all users connected to that database

戻り値:
an ArrayList of strings containing the clients username

VirtualDatabase.java1620 行で定義されています。

参照元 org.objectweb.cjdbc.controller.core.Controller.listDatabaseClients().

01621   {
01622     ArrayList list = this.getActiveThreads();
01623     int size = list.size();
01624     ArrayList clients = new ArrayList(size);
01625     for (int i = 0; i < list.size(); i++)
01626       clients.add(((VirtualDatabaseWorkerThread) list.get(i)).getUser());
01627     return clients;
01628   }

String [] org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.viewBackendInformation String  backendName  )  throws VirtualDatabaseException
 

参照:
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBean.viewBackendInformation(java.lang.String)

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java1570 行で定義されています。

参照先 org.objectweb.cjdbc.controller.backend.DatabaseBackend.getBackendData().

01572   {
01573     DatabaseBackend backend = getAndCheckBackend(backendName, NO_CHECK_BACKEND);
01574     return backend.getBackendData();
01575   }

ArrayList org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.viewCheckpointNames  ) 
 

参照:
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBean.viewCheckpointNames()

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java737 行で定義されています。

参照先 org.objectweb.cjdbc.controller.recoverylog.AbstractRecoveryLog.getCheckpointNames().

00738   {
00739     try
00740     {
00741       AbstractRecoveryLog recoveryLog = requestManager.getRecoveryLog();
00742       return recoveryLog.getCheckpointNames();
00743     }
00744     catch (SQLException e)
00745     {
00746       return new ArrayList();
00747     }
00748   }

String org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.viewOwningController  ) 
 

参照:
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBean.viewOwningController()

org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseMBeanに実装されています.

VirtualDatabase.java1716 行で定義されています。

01717   {
01718     return controllerName;
01719   }


変数

ArrayList org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.activeThreads = new ArrayList() [private]
 

VirtualDatabase.java107 行で定義されています。

AuthenticationManager org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.authenticationManager [protected]
 

Authentification manager matching virtual database login/password to backends login/password

VirtualDatabase.java91 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.checkAdminAuthentication(), と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.checkUserAuthentication().

ArrayList org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.backends [protected]
 

ArrayList of DatabaseBackend objects

VirtualDatabase.java94 行で定義されています。

AbstractBlobFilter org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.blobFilter [private]
 

The filter used to store blobs in the database

VirtualDatabase.java150 行で定義されています。

final int org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.CHECK_BACKEND_DISABLE = 0 [static]
 

Use for method getAndCheck

VirtualDatabase.java142 行で定義されています。

final int org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.CHECK_BACKEND_ENABLE = 1 [static]
 

Use for method getAndCheck

VirtualDatabase.java140 行で定義されています。

String org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.controllerName [package]
 

The controller we belong to

VirtualDatabase.java153 行で定義されています。

int org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.currentNbOfThreads [protected]
 

Current number of worker threads

VirtualDatabase.java132 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().

String org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.databaseProductNames = "C-JDBC" [private]
 

Comma separated list of database product names (one instance per name)

VirtualDatabase.java155 行で定義されています。

int org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.idleThreads = 0 [private]
 

VirtualDatabase.java109 行で定義されています。

Trace org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.logger = null
 

Virtual database logger

VirtualDatabase.java103 行で定義されています。

参照元 org.objectweb.cjdbc.controller.requestmanager.distributed.DistributedRequestManager.enableBackend(), org.objectweb.cjdbc.controller.virtualdatabase.protocol.VirtualDatabaseConfiguration.isCompatible(), と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.VirtualDatabaseWorkerThread().

int org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.maxNbOfConnections [protected]
 

Maximum number of concurrent accepted for this virtual database

VirtualDatabase.java114 行で定義されています。

int org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.maxNbOfThreads [protected]
 

Maximum number of worker threads to fork

VirtualDatabase.java129 行で定義されています。

long org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.maxThreadIdleTime [protected]
 

Maximum time a worker thread can remain idle before dying

VirtualDatabase.java120 行で定義されています。

VirtualDatabaseMetaData org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.metadata [protected]
 

Virtual Database MetaData

VirtualDatabase.java135 行で定義されています。

int org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.minNbOfThreads [protected]
 

Minimum number of worker threads to keep in the pool if poolConnectionThreads is true

VirtualDatabase.java126 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().

String org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.name [protected]
 

Virtual database name

VirtualDatabase.java85 行で定義されています。

final int org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.NO_CHECK_BACKEND = -1 [static]
 

Use for method getAndCheck

VirtualDatabase.java144 行で定義されています。

ArrayList org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.pendingConnections = new ArrayList() [private]
 

VirtualDatabase.java111 行で定義されています。

boolean org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.poolConnectionThreads [protected]
 

If false one worker thread is forked per connection else

VirtualDatabase.java117 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseWorkerThread.run().

Trace org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.requestLogger = null [protected]
 

VirtualDatabase.java104 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execReadRequest(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execReadStoredProcedure(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execWriteRequest(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execWriteRequestWithKeys(), と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.VirtualDatabase().

RequestManager org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.requestManager [protected]
 

The request manager to use for this database

VirtualDatabase.java100 行で定義されています。

ReadPrioritaryFIFOWriteLock org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.rwLock [protected]
 

Read/Write lock for backend list

VirtualDatabase.java97 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.VirtualDatabase().

SQLMonitoring org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.sqlMonitor = null [private]
 

VirtualDatabase.java137 行で定義されています。

参照元 org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execReadRequest(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execReadStoredProcedure(), org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execWriteRequest(), と org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.execWriteRequestWithKeys().

int org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase.sqlShortFormLength [private]
 

Short form of SQL statements to include in traces and exceptions

VirtualDatabase.java147 行で定義されています。


このクラスの説明は次のファイルから生成されました:
CJDBCversion1.0rc6に対してWed May 5 18:03:08 2004に生成されました。 doxygen 1.3.6