org.objectweb.cjdbc.controller.virtualdatabase
Class VirtualDatabase

java.lang.Object
  extended byorg.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabase
All Implemented Interfaces:
java.io.Serializable, VirtualDatabaseMBean
Direct Known Subclasses:
DistributedVirtualDatabase

public class VirtualDatabase
extends java.lang.Object
implements java.io.Serializable, VirtualDatabaseMBean

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.

Version:
1.0
Author:
Emmanuel Cecchet, Mathieu Peltier, Nicolas Modrzyk, Vadim Kassin
See Also:
Serialized Form

Field Summary
private  java.util.ArrayList activeThreads
           
protected  AuthenticationManager authenticationManager
          Authentification manager matching virtual database login/password to backends login/password
protected  java.util.ArrayList backends
          ArrayList of DatabaseBackend objects
protected  int currentNbOfThreads
          Current number of worker threads
protected  java.lang.String groupName
          Group name if this virtual database is hosted by multiple controllers
private  int idleThreads
           
protected  Trace logger
           
protected  int maxNbOfConnections
          Maximum number of concurrent accepted for this virtual database
protected  int maxNbOfThreads
          Maximum number of worker threads to fork
protected  long maxThreadIdleTime
          Maximum time a worker thread can remain idle before dying
protected  VirtualDatabaseMetaData metadata
          Virtual Database MetaData
protected  int minNbOfThreads
          Minimum number of worker threads to keep in the pool if poolConnectionThreads is true
protected  java.lang.String name
          Virtual database name
private  java.util.ArrayList pendingConnections
           
protected  boolean poolConnectionThreads
          If false one worker thread is forked per connection else
protected  Trace requestLogger
           
protected  RequestManager requestManager
          The request manager to use for this database
protected  ReadPrioritaryFIFOWriteLock rwLock
          Read/Write lock for backend list
 
Constructor Summary
VirtualDatabase(java.lang.String name, int maxConnections, boolean pool, int minThreads, int maxThreads, long maxThreadIdleTime)
          Creates a new VirtualDatabase instance.
 
Method Summary
 void acquireReadLockBackendLists()
          Acquires a read lock on the backend lists (both enabled and disabled backends).
 void addBackend(DatabaseBackend db)
          Add a backend to this virtual database.
 void addCurrentNbOfThread()
          Adds one to currentNbOfThreads.
 void addIdleThread()
          Method add an idle thread.
 int begin(java.lang.String login)
          Begins a new transaction and returns the corresponding transaction identifier.
 boolean checkAdminAuthentication(java.lang.String adminLogin, java.lang.String adminPassword)
          Checks if a given admin login/password is ok.
 boolean checkUserAuthentication(java.lang.String virtualLogin, java.lang.String virtualPassword)
          Checks if a given virtual login/password is ok.
 void commit(int transactionId)
          Commits a transaction given its id.
 void disableAllBackend()
          Prepare this virtual database for shutdown.
 void disableAllBackendForCheckpoint(java.lang.String checkpoint)
          Disable all backends and store a checkpoint
 void disableBackend(java.lang.String backendName)
          Disables a backend that is currently enabled on this virtual database (without further check).
 void disableBackendForCheckpoint(java.lang.String backendName, java.lang.String checkpointName)
          Disables a backend once all the pending write queries are executed.
 void enableAllBackend()
          Prepare this virtual database for startup.
 void enableAllBackend(java.lang.String checkpoint)
          Prepare this virtual database for startup.
 void enableBackend(java.lang.String backendName)
          Enables a backend that has been previously added to this virtual database and that is in the disabled state.
 void enableBackendFromCheckpoint(java.lang.String backendName, java.lang.String checkpointName)
          Plays all the queries since the given checkpoint and enables the backend when it is completely synchronized.
 boolean equals(java.lang.Object other)
          Two virtual databases are equal if they have the same name and group.
 java.sql.ResultSet execReadRequest(SelectRequest request)
          Performs a read request and returns the reply.
 java.sql.ResultSet execReadStoredProcedure(StoredProcedure proc)
          Call a stored procedure that returns a ResultSet.
 int execWriteRequest(AbstractWriteRequest request)
          Performs a write request and returns the number of rows affected.
 java.sql.ResultSet execWriteRequestWithKeys(AbstractWriteRequest request)
          Performs a write request and returns the auto generated keys.
protected  int execWriteStoredProcedure(StoredProcedure proc)
          Call a stored procedure that performs an update.
 java.util.ArrayList getActiveThreads()
          Returns the activeThreads.
 java.util.ArrayList getAllBackendNames()
           
private  DatabaseBackend getAndCheckBackendForDisable(java.lang.String backendName)
          Find the DatabaseBackend corresponding to the given backend name and check if it is possible to disable this backend.
private  DatabaseBackend getAndCheckBackendForEnable(java.lang.String backendName)
          Find the DatabaseBackend corresponding to the given backend name and check if it is possible to enable this backend.
 AuthenticationManager getAuthenticationManager()
          Returns the authentication manager of this virtual database.
 java.lang.String getBackendInformation(java.lang.String backendName)
          Return information about the specified backend.
 java.util.ArrayList getBackends()
          Return the list of all backends
 int getCurrentNbOfThreads()
          Returns the currentNbOfThreads.
 java.lang.String 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).
 DatabaseSchema getDatabaseSchemaFromActiveBackends()
          Get the current database schema from merging the schemas of all active backends.
 java.lang.String getGroupName()
          Returns the group name this virtual database belongs to.
 int getIdleThreads()
          Returns the number of idle zorker threads.
 java.lang.String getInformation()
          Gets information about this virtual database.
 int getMaxNbOfConnections()
          Returns the maxNbOfConnections.
 int getMaxNbOfThreads()
          Returns the maxNbOfThreads.
 long getMaxThreadIdleTime()
          Returns the maxThreadIdleTime.
 VirtualDatabaseMetaData getMetaData()
           
 int getMinNbOfThreads()
          Returns the minNbOfThreads.
 java.lang.String getName()
          Gets the virtual database name to be used by the client (C-JDBC driver)
 java.util.ArrayList getPendingConnections()
          Returns the pendingConnections.
 RequestManager getRequestManager()
          Gets the request manager associated to this database.
 java.lang.String getVirtualDatabaseName()
          Gets the virtual database name to be used by the client (C-JDBC driver)
 java.lang.String getXmlInformation()
          Retrieves this VirtualDatabase object in xml format
 boolean isDistributed()
          Is this virtual database distributed ?
 boolean isPoolConnectionThreads()
          Returns the poolConnectionThreads.
 void releaseReadLockBackendLists()
          Releases the read lock on the backend lists (both enabled and disabled backends).
 void removeBackend(DatabaseBackend db)
          Remove a backend from this virtual database.
 void removeCurrentNbOfThread()
          Substract one to currentNbOfThreads.
 void removeIdleThread()
          Remove an idle thread.
 void rollback(int transactionId)
          Rollbacks a transaction given its id.
 void setAuthenticationManager(AuthenticationManager authenticationManager)
          Sets the authentication manager for this virtual database.
 void 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.
 void setGroupName(java.lang.String groupName)
          Sets the group name used by the controllers hosting this virtual database.
 void setMaxNbOfConnections(int maxNbOfConnections)
          Sets the maxNbOfConnections.
 void setMaxNbOfThreads(int maxNbOfThreads)
          Sets the maxNbOfThreads.
 void setMaxThreadIdleTime(long maxThreadIdleTime)
          Sets the maxThreadIdleTime.
 void setMinNbOfThreads(int minNbOfThreads)
          Sets the minNbOfThreads.
 void setPoolConnectionThreads(boolean poolConnectionThreads)
          Sets the poolConnectionThreads.
 void setRequestManager(RequestManager requestManager)
          Sets a new request manager for this database.
 void shutdown(int level)
          Shutdown this virtual database.
 java.util.ArrayList viewAllBackendNames()
          Get the name of all DatabaseBackend names.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

name

protected java.lang.String name
Virtual database name


groupName

protected java.lang.String groupName
Group name if this virtual database is hosted by multiple controllers


authenticationManager

protected AuthenticationManager authenticationManager
Authentification manager matching virtual database login/password to backends login/password


backends

protected java.util.ArrayList backends
ArrayList of DatabaseBackend objects


rwLock

protected ReadPrioritaryFIFOWriteLock rwLock
Read/Write lock for backend list


requestManager

protected RequestManager requestManager
The request manager to use for this database


logger

protected Trace logger

requestLogger

protected Trace requestLogger

activeThreads

private java.util.ArrayList activeThreads

idleThreads

private int idleThreads

pendingConnections

private java.util.ArrayList pendingConnections

maxNbOfConnections

protected int maxNbOfConnections
Maximum number of concurrent accepted for this virtual database


poolConnectionThreads

protected boolean poolConnectionThreads
If false one worker thread is forked per connection else


maxThreadIdleTime

protected long maxThreadIdleTime
Maximum time a worker thread can remain idle before dying


minNbOfThreads

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


maxNbOfThreads

protected int maxNbOfThreads
Maximum number of worker threads to fork


currentNbOfThreads

protected int currentNbOfThreads
Current number of worker threads


metadata

protected VirtualDatabaseMetaData metadata
Virtual Database MetaData

Constructor Detail

VirtualDatabase

public VirtualDatabase(java.lang.String name,
                       int maxConnections,
                       boolean pool,
                       int minThreads,
                       int maxThreads,
                       long maxThreadIdleTime)
Creates a new VirtualDatabase instance.

Parameters:
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.
Method Detail

isDistributed

public boolean isDistributed()
Is this virtual database distributed ?

Returns:
false

checkUserAuthentication

public boolean checkUserAuthentication(java.lang.String virtualLogin,
                                       java.lang.String virtualPassword)
Checks if a given virtual login/password is ok.

Parameters:
virtualLogin - the virtual user login
virtualPassword - the virtual user password
Returns:
true if the login/password is known from the AuthenticationManager. Returns false if no AuthenticationManager is defined.

checkAdminAuthentication

public boolean checkAdminAuthentication(java.lang.String adminLogin,
                                        java.lang.String adminPassword)
Checks if a given admin login/password is ok.

Specified by:
checkAdminAuthentication in interface VirtualDatabaseMBean
Parameters:
adminLogin - admin user login
adminPassword - admin user password
Returns:
true if the login/password is known from the AuthenticationManager. Returns false if no AuthenticationManager is defined.

execReadRequest

public java.sql.ResultSet execReadRequest(SelectRequest request)
                                   throws java.sql.SQLException
Performs a read request and returns the reply.

Parameters:
request - the request to execute
Returns:
a java.sql.ResultSet value
Throws:
java.sql.SQLException - if the request fails

execWriteRequest

public int execWriteRequest(AbstractWriteRequest request)
                     throws java.sql.SQLException
Performs a write request and returns the number of rows affected.

Parameters:
request - the request to execute
Returns:
number of rows affected
Throws:
java.sql.SQLException - if the request fails

execWriteRequestWithKeys

public java.sql.ResultSet execWriteRequestWithKeys(AbstractWriteRequest request)
                                            throws java.sql.SQLException
Performs a write request and returns the auto generated keys.

Parameters:
request - the request to execute
Returns:
auto generated keys
Throws:
java.sql.SQLException - if the request fails

execReadStoredProcedure

public java.sql.ResultSet execReadStoredProcedure(StoredProcedure proc)
                                           throws java.sql.SQLException
Call a stored procedure that returns a ResultSet.

Parameters:
proc - the stored procedure call
Returns:
a java.sql.ResultSet value
Throws:
java.sql.SQLException - if an error occurs

execWriteStoredProcedure

protected int execWriteStoredProcedure(StoredProcedure proc)
                                throws java.sql.SQLException
Call a stored procedure that performs an update.

Parameters:
proc - the stored procedure call
Returns:
number of rows affected
Throws:
java.sql.SQLException - if an error occurs

begin

public int begin(java.lang.String login)
          throws java.sql.SQLException
Begins a new transaction and returns the corresponding transaction identifier. This method is called from the driver when Connection.setAutoCommit(boolean)is called with false argument.

Parameters:
login - the login used by the connection
Returns:
an unique transaction identifier
Throws:
java.sql.SQLException - if an error occurs

commit

public void commit(int transactionId)
            throws java.sql.SQLException
Commits a transaction given its id.

Parameters:
transactionId - the transaction id
Throws:
java.sql.SQLException - if an error occurs

rollback

public void rollback(int transactionId)
              throws java.sql.SQLException
Rollbacks a transaction given its id.

Parameters:
transactionId - the transaction id
Throws:
java.sql.SQLException - if an error occurs

addBackend

public void addBackend(DatabaseBackend db)
                throws VirtualDatabaseException
Add a backend to this virtual database.

Parameters:
db - the database backend to add
Throws:
VirtualDatabaseException - if an error occurs

removeBackend

public void removeBackend(DatabaseBackend db)
                   throws VirtualDatabaseException
Remove a backend from this virtual database.

Parameters:
db - the database backend to remove
Throws:
VirtualDatabaseException - if an error occurs

getAndCheckBackendForEnable

private DatabaseBackend getAndCheckBackendForEnable(java.lang.String backendName)
                                             throws VirtualDatabaseException
Find the DatabaseBackend corresponding to the given backend name and check if it is possible to enable this backend. This method also updates the virtual database schema by merging it with the one provided by this backend.

Parameters:
backendName - backend to look for
Returns:
the backend to enable
Throws:
VirtualDatabaseException - if an error occurs

enableBackend

public void enableBackend(java.lang.String backendName)
                   throws VirtualDatabaseException
Description copied from interface: VirtualDatabaseMBean
Enables a backend that has been previously added to this virtual database and that is in the disabled state. The backend is enabled without further check.

Specified by:
enableBackend in interface VirtualDatabaseMBean
Parameters:
backendName - The database backend logical name to enable
Throws:
VirtualDatabaseException - in case of communication-related error
See Also:
VirtualDatabaseManagementInterface#enableBackend(String)

enableBackendFromCheckpoint

public void enableBackendFromCheckpoint(java.lang.String backendName,
                                        java.lang.String checkpointName)
                                 throws VirtualDatabaseException
Description copied from interface: VirtualDatabaseMBean
Plays all the queries since the given checkpoint and enables the backend when it is completely synchronized. The backend must have been previously added to this virtual database and be in the disabled state

Specified by:
enableBackendFromCheckpoint in interface VirtualDatabaseMBean
Parameters:
backendName - The database backend logical name to enable
checkpointName - the checkpoint name to restart from
Throws:
VirtualDatabaseException - in case of communication-related error
See Also:
VirtualDatabaseManagementInterface#enableBackendFromCheckpoint(String, String)

getAndCheckBackendForDisable

private DatabaseBackend getAndCheckBackendForDisable(java.lang.String backendName)
                                              throws VirtualDatabaseException
Find the DatabaseBackend corresponding to the given backend name and check if it is possible to disable this backend.

Parameters:
backendName - backend to look for
Returns:
the backend to disable
Throws:
VirtualDatabaseException - if an error occurs

disableBackend

public void disableBackend(java.lang.String backendName)
                    throws VirtualDatabaseException
Description copied from interface: VirtualDatabaseMBean
Disables a backend that is currently enabled on this virtual database (without further check).

Specified by:
disableBackend in interface VirtualDatabaseMBean
Parameters:
backendName - The database backend logical name to enable
Throws:
VirtualDatabaseException - in case of communication-related error
See Also:
VirtualDatabaseManagementInterface#disableBackend(String)

disableAllBackend

public void disableAllBackend()
                       throws VirtualDatabaseException
Prepare this virtual database for shutdown. This turns off all the backends bu cutting communication from this database. This does not prevents other virtual database to use shared backends. This doesn't create checkpoints either.

Specified by:
disableAllBackend in interface VirtualDatabaseMBean
Throws:
VirtualDatabaseException - if fails
See Also:
getAndCheckBackendForDisable(java.lang.String)

enableAllBackend

public void enableAllBackend()
                      throws VirtualDatabaseException
Prepare this virtual database for startup. This turns on all the backends

Specified by:
enableAllBackend in interface VirtualDatabaseMBean
Throws:
VirtualDatabaseException - if fails

enableAllBackend

public void enableAllBackend(java.lang.String checkpoint)
                      throws VirtualDatabaseException
Prepare this virtual database for startup. This turns on all the backends

Specified by:
enableAllBackend in interface VirtualDatabaseMBean
Parameters:
checkpoint - checkpoint for recovery log
Throws:
VirtualDatabaseException - if fails

disableBackendForCheckpoint

public void disableBackendForCheckpoint(java.lang.String backendName,
                                        java.lang.String checkpointName)
                                 throws VirtualDatabaseException
Description copied from interface: VirtualDatabaseMBean
Disables a backend once all the pending write queries are executed. A checkpoint is inserted in the recovery log. The backend must belong to this virtual database and be in the enabled state.

Specified by:
disableBackendForCheckpoint in interface VirtualDatabaseMBean
Parameters:
backendName - The database backend logical name to disable
checkpointName - the checkpoint name to store
Throws:
VirtualDatabaseException - in case of communication-related error
See Also:
VirtualDatabaseManagementInterface#disableBackendForCheckpoint(String, String)

acquireReadLockBackendLists

public final void acquireReadLockBackendLists()
                                       throws java.lang.InterruptedException
Acquires a read lock on the backend lists (both enabled and disabled backends). This should be called prior traversing the backend ArrayList.

Throws:
java.lang.InterruptedException - if an error occurs

releaseReadLockBackendLists

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


getAuthenticationManager

public AuthenticationManager getAuthenticationManager()
Returns the authentication manager of this virtual database.

Returns:
an AuthenticationManager instance

setAuthenticationManager

public void setAuthenticationManager(AuthenticationManager authenticationManager)
Sets the authentication manager for this virtual database.

Parameters:
authenticationManager - the AuthenticationManager to set

getBackends

public java.util.ArrayList getBackends()
Return the list of all backends

Returns:
ArrayList of DatabaseBackend Objects

getAllBackendNames

public java.util.ArrayList getAllBackendNames()
                                       throws VirtualDatabaseException
Throws:
VirtualDatabaseException
See Also:
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseManagementInterface#getAllBackendNames()

getDatabaseName

public java.lang.String 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().

Returns:
the virtual database name
See Also:
getVirtualDatabaseName()

getMetaData

public VirtualDatabaseMetaData getMetaData()
Returns:
associated metada for this database
See Also:
DatabaseMetaData

getDatabaseSchemaFromActiveBackends

public DatabaseSchema getDatabaseSchemaFromActiveBackends()
                                                   throws java.sql.SQLException
Get the current database schema from merging the schemas of all active backends. This is needed when a backend is disabled.

Returns:
the current database schema dynamically gathered
Throws:
java.sql.SQLException - if an error occurs

setDatabaseSchema

public void 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.

Parameters:
schema - the new database shema
isStatic - true if the schema should be static

getGroupName

public java.lang.String getGroupName()
Returns the group name this virtual database belongs to.

Returns:
a String value. Returns null if this virtual database is standalone

setGroupName

public void setGroupName(java.lang.String groupName)
Sets the group name used by the controllers hosting this virtual database.

Parameters:
groupName - the group name to set

getRequestManager

public RequestManager getRequestManager()
Gets the request manager associated to this database.

Returns:
a RequestManager instance

setRequestManager

public void setRequestManager(RequestManager requestManager)
Sets a new request manager for this database.

Parameters:
requestManager - the new request manager.

getVirtualDatabaseName

public java.lang.String getVirtualDatabaseName()
Gets the virtual database name to be used by the client (C-JDBC driver)

Returns:
the virtual database name

equals

public boolean equals(java.lang.Object other)
Two virtual databases are equal if they have the same name and group.

Parameters:
other - the object to compare with
Returns:
true if the two virtual databases are equals

getXmlInformation

public java.lang.String getXmlInformation()
                                   throws VirtualDatabaseException
Retrieves this VirtualDatabase object in xml format

Returns:
xml formatted string that conforms to c-jdbc.dtd
Throws:
VirtualDatabaseException - if remote communication failed

getInformation

public java.lang.String getInformation()
Gets information about this virtual database.

Returns:
a String value containing information

getBackendInformation

public java.lang.String getBackendInformation(java.lang.String backendName)
                                       throws VirtualDatabaseException
Description copied from interface: VirtualDatabaseMBean
Return information about the specified backend.

Specified by:
getBackendInformation in interface VirtualDatabaseMBean
Parameters:
backendName - the backend logical name
Returns:
String the backend information
Throws:
VirtualDatabaseException - if an error occurs
See Also:
org.objectweb.cjdbc.controller.virtualdatabase.VirtualDatabaseManagementInterface#getBackendInformation(String)

getName

public java.lang.String getName()
Gets the virtual database name to be used by the client (C-JDBC driver)

Specified by:
getName in interface VirtualDatabaseMBean
Returns:
the virtual database name

getCurrentNbOfThreads

public int getCurrentNbOfThreads()
Returns the currentNbOfThreads.

Returns:
int

addCurrentNbOfThread

public void addCurrentNbOfThread()
Adds one to currentNbOfThreads. Warning! This method is not synchronized.


removeCurrentNbOfThread

public void removeCurrentNbOfThread()
Substract one to currentNbOfThreads. Warning! This method is not synchronized.


getMinNbOfThreads

public int getMinNbOfThreads()
Returns the minNbOfThreads.

Returns:
int

isPoolConnectionThreads

public boolean isPoolConnectionThreads()
Returns the poolConnectionThreads.

Returns:
boolean

setMinNbOfThreads

public void setMinNbOfThreads(int minNbOfThreads)
Sets the minNbOfThreads.

Parameters:
minNbOfThreads - The minNbOfThreads to set

setPoolConnectionThreads

public void setPoolConnectionThreads(boolean poolConnectionThreads)
Sets the poolConnectionThreads.

Parameters:
poolConnectionThreads - The poolConnectionThreads to set

getMaxThreadIdleTime

public long getMaxThreadIdleTime()
Returns the maxThreadIdleTime.

Returns:
long

setMaxThreadIdleTime

public void setMaxThreadIdleTime(long maxThreadIdleTime)
Sets the maxThreadIdleTime.

Parameters:
maxThreadIdleTime - The maxThreadIdleTime to set

getMaxNbOfConnections

public int getMaxNbOfConnections()
Returns the maxNbOfConnections.

Returns:
int

getMaxNbOfThreads

public int getMaxNbOfThreads()
Returns the maxNbOfThreads.

Returns:
int

getPendingConnections

public java.util.ArrayList getPendingConnections()
Returns the pendingConnections.

Returns:
ArrayList

setMaxNbOfConnections

public void setMaxNbOfConnections(int maxNbOfConnections)
Sets the maxNbOfConnections.

Parameters:
maxNbOfConnections - The maxNbOfConnections to set

setMaxNbOfThreads

public void setMaxNbOfThreads(int maxNbOfThreads)
Sets the maxNbOfThreads.

Parameters:
maxNbOfThreads - The maxNbOfThreads to set

getActiveThreads

public java.util.ArrayList getActiveThreads()
Returns the activeThreads.

Returns:
ArrayList

addIdleThread

public void addIdleThread()
Method add an idle thread. Warning! This method must be called in a synchronized block on activeThreads.


removeIdleThread

public void removeIdleThread()
Remove an idle thread. Warning! This method must be called in a synchronized block on activeThreads.


getIdleThreads

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

Returns:
int

viewAllBackendNames

public java.util.ArrayList viewAllBackendNames()
                                        throws VirtualDatabaseException
Description copied from interface: VirtualDatabaseMBean
Get the name of all DatabaseBackend names.

Specified by:
viewAllBackendNames in interface VirtualDatabaseMBean
Returns:
ArrayList ArrayList of String representing database backend names
Throws:
VirtualDatabaseException - if an error occurs
See Also:
VirtualDatabaseMBean.viewAllBackendNames()

disableAllBackendForCheckpoint

public void disableAllBackendForCheckpoint(java.lang.String checkpoint)
                                    throws VirtualDatabaseException
Description copied from interface: VirtualDatabaseMBean
Disable all backends and store a checkpoint

Specified by:
disableAllBackendForCheckpoint in interface VirtualDatabaseMBean
Parameters:
checkpoint - the name of the checkpoitn
Throws:
VirtualDatabaseException - if fails
See Also:
VirtualDatabaseMBean.disableAllBackendForCheckpoint(java.lang.String)

shutdown

public void shutdown(int level)
Shutdown this virtual database. Finish all threads and stop connection to backends

Parameters:
level - Smart or Fast


Copyright © 2002, 2003 - ObjectWeb Consortium - All Rights Reserved.