|
DODS 7.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.enhydra.dods.DODS
public class DODS
Main DODS class. There are two modes of usage: non-threading and threading. In non-threading mode, only one DatabaseManager is used for the whole application, no matter the application has one or more Threads. In threading mode, there is one DatabaseManager for every Thread. User needs, for every Thread, to define the DatabaseManager. If, for any Thread, the DatabaseManager is not defined, the default DatabaseManager is used.
Example for non-threading mode:
... try { String fileName = "discRack.conf"; DatabaseManager dbManager = StandardDatabaseManager.newInstance(fileName); DODS.register(dbManager); } catch (Exception e) { e.printStackTrace(); } ...
Constructor Summary | |
---|---|
DODS()
|
Method Summary | |
---|---|
static LogChannel |
configureStandardLogerChannel()
|
static DatabaseManager |
getDatabaseManager()
Returns the DatabaseManager object for the current thread. |
static DatabaseManager |
getDatabaseManager(java.lang.Thread thread)
Returns the DatabaseManager object for the given thread. |
static DatabaseManager |
getDefaultDatabaseManager()
Returns the default DatabaseManager. |
static LogChannel |
getDefaultLogChannel()
Returns the default logger. |
static LogChannel |
getLogChannel()
Returns the logger object for the current thread. |
static LogChannel |
getLogChannel(java.lang.Thread thread)
Returns the logger object for the given thread. |
protected static void |
init()
Initializes DODS. |
protected static boolean |
isDodsConfigured()
|
static boolean |
isThreading()
Returns the mode of usage. |
static void |
register(DatabaseManager databaseManager)
In threading mode, this method associates the DatabaseManager object with the current thread. |
static void |
register(java.lang.Thread thread,
DatabaseManager databaseManager)
Associates the given DatabaseManager object with given thread. |
static void |
registerDefault(DatabaseManager databaseManager)
Sets the default DatabaseManager. |
static void |
registerDefault(java.lang.String fileName)
Sets the default DatabaseManager. |
static void |
registerDefaultLogChannel(LogChannel channel)
Sets the default logChannel. |
static void |
registerLogChannel(LogChannel channel)
In threading mode, this method associates the channel object with the current thread. |
static void |
registerLogChannel(java.lang.Thread thread,
LogChannel channel)
Associates the given channel object with the given
thread. |
protected static void |
setDodsConfigured(boolean configured)
|
static void |
setThreading(boolean mode)
Sets mode of usage. |
static void |
shutdown()
Shutdowns all DatabaseManager s and
Loggers s. |
static void |
startup(java.lang.String fileName)
In threading mode, this method associates the DatabaseManager object with the current thread. |
static void |
startup(java.lang.Thread thread,
java.lang.String fileName)
Associates DatabaseManager created by the given fileName with given thread. |
static void |
startup(java.net.URL confURL,
java.lang.String confFile)
In threading mode, this method associates the DatabaseManager object with the current thread. |
static DatabaseManager |
unregister()
In threading mode, this method unregisters DatabaseManager associated with the current
thread. |
static DatabaseManager |
unregister(java.lang.Thread thread)
Unregisters DatabaseManager associated with the
given thread. |
static DatabaseManager |
unregisterDefault()
Unregisters default DatabaseManager . |
static LogChannel |
unregisterDefaultLogChannel()
Unregisters default Logger . |
static LogChannel |
unregisterLogChannel()
In threading mode, this method unregisters LogChannel associated with the current thread. |
static LogChannel |
unregisterLogChannel(java.lang.Thread thread)
Unregisters LogChannel associated with the given
thread. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DODS()
Method Detail |
---|
public static void registerDefault(DatabaseManager databaseManager)
databaseManager
- the DatabaseManager to be set as default.public static void registerDefault(java.lang.String fileName) throws ConfigException, DatabaseManagerException, java.sql.SQLException
fileName
- full path name of the application configuration
file.
ConfigException
DatabaseManagerException
java.sql.SQLException
public static void register(DatabaseManager databaseManager)
null
, it will also be set. In non-threading mode,
only default DatabaseManager will be set.
databaseManager
- the DatabaseManager to associate with
current thread.public static void startup(java.lang.String fileName) throws ConfigException, DatabaseManagerException, java.sql.SQLException
null
, it will also be set. In non-threading mode,
only default DatabaseManager will be set.
fileName
- full path name of the application configuration
file which will create DatabaseManager
associate
with current thread.
ConfigException
DatabaseManagerException
java.sql.SQLException
public static void startup(java.net.URL confURL, java.lang.String confFile) throws ConfigException, DatabaseManagerException, java.sql.SQLException
null
, it will also be set. In non-threading mode,
only default DatabaseManager will be set.
confURL
- Additional path to folder or *.jar file with
configuration file. If null use DODS classpath.confFile
- Name of conf file relativ to *.jar file or to
specifide folder (from confURL/DODS claspath).
ConfigException
DatabaseManagerException
java.sql.SQLException
public static void startup(java.lang.Thread thread, java.lang.String fileName) throws ConfigException, DatabaseManagerException, java.sql.SQLException
thread
- the thread to associate with
DatabaseManager
.fileName
- full path name of the application configuration
file which will create DatabaseManager
associate
with given thread.
ConfigException
DatabaseManagerException
java.sql.SQLException
public static LogChannel configureStandardLogerChannel() throws ConfigException
ConfigException
public static void register(java.lang.Thread thread, DatabaseManager databaseManager)
thread
- the thread to associate with
DatabaseManager
.databaseManager
- the DatabaseManager to associate the
Thread
.public static void registerDefaultLogChannel(LogChannel channel)
channel
- LogChannel that will be set as default LogChannel.public static void registerLogChannel(LogChannel channel)
channel
object with the current thread. In
non-threading mode, only default channel
will be
set.
channel
- LogChannel that will be set.public static void registerLogChannel(java.lang.Thread thread, LogChannel channel)
channel
object with the given
thread.
thread
- the thread to associate with channel
.channel
- the channel
to associate the
Thread
.public static DatabaseManager unregisterDefault() throws DODSException
DatabaseManager
. Call this
method to release default DatabaseManager
.
DatabaseManager
.
DODSException
- If an error occurs in unregistering the
DatabaseManager.public static DatabaseManager unregister() throws DODSException
DatabaseManager
associated with the current
thread. In non-threading mode, only default
DatabaseManager
will be unregistered. Call this
method to release DatabaseManager
.
DatabaseManager
.
DODSException
- If an error occurs in unregistering the
DatabaseManager.public static DatabaseManager unregister(java.lang.Thread thread) throws DODSException
DatabaseManager
associated with the
given thread. Call this method to release
DatabaseManager
.
DatabaseManager
.
DODSException
- If an error occurs in unregistering the
DatabaseManager.public static LogChannel unregisterDefaultLogChannel() throws DODSException
Logger
. Call this method to
release default Logger
.
Logger
.
DODSException
- If an error occurs in unregistering the
logger.public static LogChannel unregisterLogChannel() throws DODSException
LogChannel
associated with the current thread. In
non-threading mode, only default LogChannel
will
be unregistered. Call this method to release
LogChannel
.
LogChannel
.
DODSException
- If an error occurs in unregistering the
LogChannel.public static LogChannel unregisterLogChannel(java.lang.Thread thread) throws DODSException
LogChannel
associated with the given
thread. Call this method to release LogChannel
.
LogChannel
.
DODSException
- If an error occurs in unregistering the
LogChannel.public static DatabaseManager getDefaultDatabaseManager()
public static DatabaseManager getDatabaseManager()
DatabaseManager
will be returned.
public static DatabaseManager getDatabaseManager(java.lang.Thread thread)
thread
- the thread to associate with the
DatabaseManager
.
public static LogChannel getDefaultLogChannel()
public static LogChannel getLogChannel()
Logger
will be returned.
public static LogChannel getLogChannel(java.lang.Thread thread)
thread
- the thread to associate with the logger.
public static void shutdown() throws DODSException
DatabaseManager
s and
Loggers
s. Call this method to release and
shutdown all DatabaseManager
s and
Loggers
s.
DODSException
- If an error occurs in releasing
DatabaseManagers and loggers.public static boolean isThreading()
true
,
DODS uses multi threading mode. This means that DODS handles
multiple threads, like Enhydra application server (each
application in one Thread
). If this flag is
false
, there can be more then one
Thread
, but there is only one
DatabaseManager
for all Thread
s
(for the whole application).
true
if threading mode is used, otherwise
false
.public static void setThreading(boolean mode)
true
, DODS
uses multi threading mode. This means that DODS handles multiple
threads, like Enhydra application server (each application in one
Thread
). If this flag is false
,
there can be more then one Thread
, but there is
only one DatabaseManager
for all
Thread
s (for the whole application).
mode
- mode of usage.protected static void init()
protected static boolean isDodsConfigured()
protected static void setDodsConfigured(boolean configured)
configured
- The dodsConfigured to set.
|
DODS 7.3 API | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |