public abstract class GlobalStd extends SuperGlobal implements DataObjectConstructionDetails, ConnectionRecovery
SessionStd
,
JspSessionStd
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
browserPath |
static boolean |
cloudVersion
Indicates we are in cloud context.
|
static java.awt.Color |
COLOR_FOR_HINTS |
ConnectionPool |
connectionPool
The connection pool
|
ConnectionSpecification |
connectionSpecification
The specifications to connect to the essential or only database
|
java.lang.String |
contextPath
The application's context path.
|
static java.awt.Cursor |
DEFAULT_CURSOR |
boolean |
encryptPasswords
Whether passwords are to encrypt before they are stored into database.
|
static boolean |
FRAMEWORK_BETA_FUNCTIONS_ACTIVATED |
IdManager |
idManager
The identity manager to get unique primary keys
|
static int |
LANG_DE |
static int |
LANG_DK |
static int |
LANG_EN |
static int |
LANG_ES |
static int |
LANG_FR |
static int |
LANG_IT |
static int |
LANG_MA |
static int |
LANG_NL |
static int |
LANG_TR |
static int |
LANG_ZH |
static java.util.Locale |
locale |
ConnectionHolder |
mainConnectionHolder
The holder of the main connection, which may be the only connection or the session comprehensive connection
|
static long |
milliessForConnectionCheck |
static int |
NO_LICENCE_KEY_MEANS_EVALUATION
Let user evaluate application if no license key has been entered, yet
|
static int |
NO_LICENCE_KEY_MEANS_FORCE_INPUT
Force input of license key before program starts to run at all
|
static int |
NO_LICENCE_KEY_MEANS_NO_LIMITATION
Input of license key is not necessary
|
static boolean |
readOnly |
static boolean |
suppressChangeLogToDB |
boolean |
useScrollDivision
Whether scroll divisions between header and buttons should be used.
|
static java.awt.Cursor |
WAIT_CURSOR |
BUNDLE_NAME_DE, BUNDLE_NAME_DK, BUNDLE_NAME_EN, BUNDLE_NAME_ES, BUNDLE_NAME_FR, BUNDLE_NAME_IT, BUNDLE_NAME_NL, BUNDLE_NAME_TR, BUNDLE_NAME_ZH, DENMARK, NETHERLANDS, resourceBundles, SPAIN, TURKEY
Modifier | Constructor and Description |
---|---|
protected |
GlobalStd()
Constructs a new global objects container.
|
protected |
GlobalStd(java.lang.String applicationName)
Constructs a new global objects container.
|
Modifier and Type | Method and Description |
---|---|
static java.lang.String |
addDoubleQuoteToPathIfNecessary(java.lang.String systemCall) |
void |
closeMainConnection()
Closes the main connection.
|
void |
createGlobalDataObjects() |
boolean |
createOrCheckConnections()
Creates the main connection or checks all connections.
|
void |
destroyGlobalDataObjects() |
protected static void |
destroyInstanceStd() |
protected void |
finalize() |
java.io.File |
getAllUserDir()
Returns the directory for all users to write since May. 2010 there's no such property, yet.
|
static java.lang.String |
getBrowserPath() |
java.sql.Connection |
getConnection()
Returns the connection to use.
|
int |
getDatabaseType()
Returns the database type of the main connection.
|
int |
getDatabaseType(java.sql.Connection connection)
Returns the database type of the connection as specified.
|
boolean |
getDerbyInstanceAlreadyBooted() |
java.io.File |
getDownloadDir() |
static java.lang.String |
getEigeneDateien() |
IdManager |
getIdManager()
Returns the IdManager to use.
|
static GlobalStd |
getInstanceStd()
Returns the singleton instance of Global.
|
long |
getLastDbConnectionRecovery()
Returns the time of last database connection recovery in milliseconds.
|
static java.util.Locale |
getLocaleForLanguage(int language) |
java.sql.Connection |
getMainConnection()
Returns the main connection.
|
ConnectionHolder |
getMainConnectionHolder()
Returns the main connection holder.
|
ParametersFromPropertyFilesStd |
getParametersFromPropertyFiles()
Returns parameter from property file if exists.
|
java.sql.Connection |
getPrivateConnection()
Returns a private connection according to the main connection specifications.
|
ConnectionHolder |
getPrivateConnectionHolder()
Returns a private ConnectionHolder according to the main connection specifications.
|
protected java.util.Properties |
getProperties(java.lang.String propertyFileName) |
java.lang.String |
getStatementToCheckIfConnectionBroken()
Return the statement to be used to check whether connection is broken
|
void |
invalidateConnections()
Invalidates the connection(s) that the have to be rebuild when needed next
time.
|
static boolean |
isAvailableLookAndFeel(java.lang.String lookAndFeelName) |
boolean |
isDbConnected() |
boolean |
isDbConnectedAndConnectionNotClosed(java.lang.String existingTableName) |
boolean |
isDbMySQLorDerivative() |
boolean |
isFrameworkPersistenceFunctionalityUsed()
Returns true if framework persistence functionality is used.
|
static boolean |
isLinuxOrMac() |
static boolean |
isMac() |
boolean |
isMainConnOracle() |
static boolean |
isRunningInApplet() |
boolean |
isSeparateConnectionEachThread() |
static boolean |
isShutdownRequested() |
static boolean |
isTomcatWebapp()
Returns true if this application is running as a Tomcat web application (JSP/servlet).
|
static boolean |
isWindowsPlatform()
Try to determine whether this application is running under
Windows or some other platform by examining the "os.name" property.
|
static boolean |
isX86() |
protected void |
rebuildGlobalDataObjects()
Rebuild global data objects.
|
java.sql.Connection |
recover(java.sql.Connection connection)
Returns the same connection as passed or a new connection if the implementation of this interface decides to return
another connection, e.g. because the old connection was closed due to inactivity on the part of the database.
|
void |
setLastDbConnectionRecoveryNow()
Sets a time marker: the last database connection recovery happened right now.
|
void |
setLocalJavaDBOwnJREData(java.lang.String javaBinPath,
java.lang.String javaDbPath,
java.lang.String hostname)
Sets the parameters for DB server.
|
static void |
setLookAndFeel(java.lang.String lookAndFeelName) |
void |
setSeparateConnectionEachThread(boolean separateConnectionEachThread)
Sets on the flag to use separate connections for each thread.
|
void |
setStatementToCheckIfConnectionBroken(java.lang.String statementToCheckIfConnectionBroken)
Sets the statement to be used to check whether connection is broken.
|
void |
shutdownLocalDB()
Proceeds a shutdown in case of a DB task running in an own JRE - uses specifications passed with
startLocalJavaDBOwnJRE(String, String, String, String, String, String)
Be advised that this will not stop the DB controller in system tray - this controller will still run,
but without any responsibility. |
void |
shutdownLocalDBEmbedded(java.lang.String databaseFolder)
Proceeds a shutdown for the specified database folder in case of embedded usage.
|
void |
shutdownLocalDBIfStarted()
Proceeds a shutdown if the database has been previously started.
|
void |
startLocalJavaDBOwnJRE(java.lang.String trayImagePath,
java.lang.String javaBinPath,
java.lang.String jarFilePath,
java.lang.String javaDbPath,
java.lang.String hostname,
java.lang.String dbFileDir)
Starts a Java DB task running locally in an own JRE.
|
void |
takeBackConnection(java.sql.Connection connectionToGiveBack)
Takes back a connection.
|
void |
takeBackConnection(ConnectionHolder connectionHolderToGiveBack)
Takes back a connection holder.
|
getHomeDir, getResourceString, getResourceString, getSoundDirectory, getSuperInstance, getUserTempDir, getWorkingDir, getWorkingDirAbsolutPath, playSound, playSound, playSound, setHomeDir
public static final java.awt.Cursor DEFAULT_CURSOR
public static final java.awt.Cursor WAIT_CURSOR
public static final java.awt.Color COLOR_FOR_HINTS
public static final int LANG_DE
public static final int LANG_EN
public static final int LANG_ES
public static final int LANG_MA
public static final int LANG_FR
public static final int LANG_TR
public static final int LANG_ZH
public static final int LANG_NL
public static final int LANG_DK
public static final int LANG_IT
public static long milliessForConnectionCheck
public static final boolean FRAMEWORK_BETA_FUNCTIONS_ACTIVATED
public static final int NO_LICENCE_KEY_MEANS_NO_LIMITATION
public static final int NO_LICENCE_KEY_MEANS_EVALUATION
public static final int NO_LICENCE_KEY_MEANS_FORCE_INPUT
public static boolean readOnly
public static java.util.Locale locale
public static boolean suppressChangeLogToDB
public ConnectionSpecification connectionSpecification
public ConnectionHolder mainConnectionHolder
public ConnectionPool connectionPool
public IdManager idManager
public java.lang.String contextPath
public boolean useScrollDivision
public Global() {
useScrollDivision = false;
}
public boolean encryptPasswords
public static java.lang.String browserPath
public static boolean cloudVersion
protected GlobalStd()
protected GlobalStd(java.lang.String applicationName)
public static boolean isRunningInApplet()
public static java.lang.String getEigeneDateien()
public static boolean isTomcatWebapp()
public static java.lang.String getBrowserPath()
public static boolean isAvailableLookAndFeel(java.lang.String lookAndFeelName)
public static void setLookAndFeel(java.lang.String lookAndFeelName)
public static boolean isWindowsPlatform()
public static boolean isLinuxOrMac()
public static boolean isMac()
public static boolean isX86()
public static boolean isShutdownRequested()
public static java.util.Locale getLocaleForLanguage(int language)
public static GlobalStd getInstanceStd()
protected static void destroyInstanceStd()
public void setStatementToCheckIfConnectionBroken(java.lang.String statementToCheckIfConnectionBroken)
statementToCheckIfConnectionBroken
- the statement to check whether connection is broken - a valid select statement for the used database like 'select field1 from table1'public java.lang.String getStatementToCheckIfConnectionBroken()
public void setSeparateConnectionEachThread(boolean separateConnectionEachThread)
separateConnectionEachThread
- whether or not separate DB connection are to used for each threadpublic boolean isSeparateConnectionEachThread()
public boolean isDbConnected()
public boolean isDbConnectedAndConnectionNotClosed(java.lang.String existingTableName)
public boolean isDbMySQLorDerivative()
public void setLastDbConnectionRecoveryNow()
public long getLastDbConnectionRecovery()
public void createGlobalDataObjects()
public void destroyGlobalDataObjects()
protected java.util.Properties getProperties(java.lang.String propertyFileName)
public java.io.File getAllUserDir()
public java.io.File getDownloadDir()
public void startLocalJavaDBOwnJRE(java.lang.String trayImagePath, java.lang.String javaBinPath, java.lang.String jarFilePath, java.lang.String javaDbPath, java.lang.String hostname, java.lang.String dbFileDir)
trayImagePath
- the path to the image used for the tray iconjavaBinPath
- the path to java bin folder to usejarFilePath
- the path to the jar file containing the DB controller classjavaDbPath
- the folder where Java DB is locatedhostname
- the host name to usedbFileDir
- the directory where data should be stored (without database name)shutdownLocalDB()
public void setLocalJavaDBOwnJREData(java.lang.String javaBinPath, java.lang.String javaDbPath, java.lang.String hostname)
javaBinPath
- the path to java bin folder to usejavaDbPath
- the folder where Java DB is locatedhostname
- the host name to usepublic static java.lang.String addDoubleQuoteToPathIfNecessary(java.lang.String systemCall)
public void shutdownLocalDBIfStarted()
public void shutdownLocalDBEmbedded(java.lang.String databaseFolder)
databaseFolder
- the folder of the database to shutdown including the application's specific database namepublic void shutdownLocalDB()
startLocalJavaDBOwnJRE(String, String, String, String, String, String)
Be advised that this will not stop the DB controller in system tray - this controller will still run,
but without any responsibility.public boolean isMainConnOracle()
public int getDatabaseType()
ConnectionHolder.DERBY
,
ConnectionHolder.MS_SQL_SERVER
public int getDatabaseType(java.sql.Connection connection)
connection
- the connection whose type is to determine.ConnectionHolder.DERBY
,
ConnectionHolder.MS_SQL_SERVER
public boolean isFrameworkPersistenceFunctionalityUsed()
public void invalidateConnections()
public boolean createOrCheckConnections()
public java.sql.Connection recover(java.sql.Connection connection)
ConnectionRecovery
recover
in interface ConnectionRecovery
connection
- the connection to check and replace if it isn't open any moreprotected final void rebuildGlobalDataObjects()
public ConnectionHolder getMainConnectionHolder()
public java.sql.Connection getMainConnection()
public void closeMainConnection()
public java.sql.Connection getPrivateConnection()
takeBackConnection(Connection)
public ConnectionHolder getPrivateConnectionHolder()
takeBackConnection(ConnectionHolder)
public void takeBackConnection(ConnectionHolder connectionHolderToGiveBack)
connectionHolderToGiveBack
- the connection holder to give back.getPrivateConnectionHolder()
public void takeBackConnection(java.sql.Connection connectionToGiveBack)
connectionToGiveBack
- the connection to give back.getPrivateConnection()
public boolean getDerbyInstanceAlreadyBooted()
public java.sql.Connection getConnection()
getConnection
in interface DataObjectConstructionDetails
DataObjectConstructionDetails
public IdManager getIdManager()
getIdManager
in interface DataObjectConstructionDetails
public ParametersFromPropertyFilesStd getParametersFromPropertyFiles()
protected void finalize() throws java.lang.Throwable
finalize
in class java.lang.Object
java.lang.Throwable
Copyright 1998-2023 Christoph Mueller, Kaerntner Str. 56, D-70469 Stuttgart, Germany, https://www.perpus.de