| java.lang.Object com.mckoi.database.TransactionSystem com.mckoi.database.DatabaseSystem
DatabaseSystem | final public class DatabaseSystem extends TransactionSystem (Code) | | This class provides information about shared resources available for the
entire database system running in this VM. Shared information includes
configuration details, DataCellCache, plug-ins, user management, etc.
author: Tobias Downer |
DatabaseSystem | public DatabaseSystem()(Code) | | Constructor.
|
dispose | public void dispose()(Code) | | Disposes all the resources associated with this DatabaseSystem and
invalidates this object.
|
execute | void execute(User user, DatabaseConnection database, Runnable runner)(Code) | | Executes database functions from the 'run' method of the given runnable
instance on the first available worker thread. All database functions
must go through a worker thread. If we ensure this, we can easily stop
all database functions from executing if need be. Also, we only need to
have a certain number of threads active at any one time rather than a
unique thread for each connection.
|
getStatementCache | public StatementCache getStatementCache()(Code) | | Returns the StatementCache that is used to cache StatementTree objects
that are being queried by the database. This is used to reduce the
SQL command parsing overhead.
If this method returns 'null' then statement caching is disabled.
|
getUserManager | UserManager getUserManager()(Code) | | Returns the UserManager object that handles users that are connected
to the database. The aim of this class is to unify the way users are
handled by the engine. It allows us to perform queries to see who's
connected, and any inter-user communication (triggers).
|
hasShutDown | boolean hasShutDown()(Code) | | Returns true if 'shutDown' method has been called.
|
init | public void init(DBConfig config)(Code) | | Inits the DatabaseSystem with the configuration properties of the system.
This can only be called once, and should be called at database boot time.
|
logQueries | public boolean logQueries()(Code) | | If query logging is enabled (all queries are output to 'commands.log' in
the log directory), this returns true. Otherwise it returns false.
|
prepareTransactionCheckConstraint | public Transaction.CheckExpression prepareTransactionCheckConstraint(DataTableDef table_def, Transaction.CheckExpression check)(Code) | | Given a Transaction.CheckExpression, this will prepare the expression and
return a new prepared CheckExpression.
A DatabaseSystem resolves the variables (ignoring case if necessary) and
the functions of the expression.
|
registerShutDownDelegate | void registerShutDownDelegate(Runnable delegate)(Code) | | Registers the delegate that is executed when the shutdown thread
is activated. Only one delegate may be registered with the database
system. This is only called once and shuts down the relevant
database services.
|
setIsExecutingCommands | void setIsExecutingCommands(boolean status)(Code) | | Controls whether the database system is allowed to execute commands or
not. If this is set to true, then calls to 'execute' will be executed
as soon as there is a free worker thread available. Otherwise no
commands are executed until this is enabled.
|
startShutDownThread | void startShutDownThread()(Code) | | This starts the ShutDown thread that is used to shut down the database
server. Since the actual shutdown method is dependent on the type of
database we are running (server or stand-alone) we delegate the
shutdown method to the registered shutdown delegate.
|
waitUntilAllWorkersQuiet | void waitUntilAllWorkersQuiet()(Code) | | Waits until all executing commands have stopped. This is best called
right after a call to 'setIsExecutingCommands(false)'. If these two
commands are run, the database is in a known state where no commands
can be executed.
NOTE: This can't be called from the WorkerThread. Deadlock will
result if we were allowed to do this.
|
waitUntilShutdown | void waitUntilShutdown()(Code) | | Wait until the shutdown thread has completed. (Shutdown process
has finished).
|
|
|