|
DODS 6.5 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.enhydra.dods.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 com.lutris.logging.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 com.lutris.logging.LogChannel |
getDefaultLogChannel()
Returns the default logger. |
static com.lutris.logging.LogChannel |
getLogChannel()
Returns the logger object for the current thread. |
static com.lutris.logging.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(com.lutris.logging.LogChannel channel)
Sets the default logChannel. |
static void |
registerLogChannel(com.lutris.logging.LogChannel channel)
In threading mode, this method associates the channel object with
the current thread. |
static void |
registerLogChannel(java.lang.Thread thread,
com.lutris.logging.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 com.lutris.logging.LogChannel |
unregisterDefaultLogChannel()
Unregisters default Logger . |
static com.lutris.logging.LogChannel |
unregisterLogChannel()
In threading mode, this method unregisters LogChannel
associated with the current thread. |
static com.lutris.logging.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 com.lutris.util.ConfigException, DatabaseManagerException, java.sql.SQLException
fileName
- full path name of the application configuration file.
com.lutris.util.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 com.lutris.util.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.
com.lutris.util.ConfigException
DatabaseManagerException
java.sql.SQLException
public static void startup(java.net.URL confURL, java.lang.String confFile) throws com.lutris.util.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).
com.lutris.util.ConfigException
DatabaseManagerException
java.sql.SQLException
public static void startup(java.lang.Thread thread, java.lang.String fileName) throws com.lutris.util.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.
com.lutris.util.ConfigException
DatabaseManagerException
java.sql.SQLException
public static com.lutris.logging.LogChannel configureStandardLogerChannel() throws com.lutris.util.ConfigException
com.lutris.util.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(com.lutris.logging.LogChannel channel)
channel
- LogChannel that will be set as default LogChannel.public static void registerLogChannel(com.lutris.logging.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, com.lutris.logging.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 com.lutris.logging.LogChannel unregisterDefaultLogChannel() throws DODSException
Logger
.
Call this method to release default Logger
.
Logger
.
DODSException
- If an error occurs in unregistering the logger.public static com.lutris.logging.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 com.lutris.logging.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 com.lutris.logging.LogChannel getDefaultLogChannel()
public static com.lutris.logging.LogChannel getLogChannel()
Logger
will be returned.
public static com.lutris.logging.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)
|
DODS 6.5 API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |