|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.intersys.objects.CacheDatabase
This class is used to establish a connection to the Cache server
for Java clients.
Connection parameters depend on parameters passed to method
getConnection
and values for a number of system
properties.
The following properties may be set by users:
com.intersys.cache.statistics
. Determines whether
to gather statistics about client side cache usage. Possible values
for this property are:
true
false
com.intersys.cache.type
Determines client side
cache type. Possible values for this property are:
ant
: normal caching
lazy
: lazy caching (not currently implemented).
none
: no client side caching, all requests always
go directly to Cache database.
com.intersys.classes.update.system
Determines
whether to auto update Java projection of system classes if they
are outdated. Possible values for this property are:
true
: Update Java projection of system classes
if they are outdated.
false
: Throw an exception if Java projection of
system classes are outdated
1
: The same as true
.
0
: The same as false
.
true
. Note, that java class files are
not updated, and update effective only for this particular JVM
process. If com.intersys.debug
property is on, update
is logged.
com.intersys.classes.update.user
Determines
whether to auto update Java classes, generated from Cache if they
are outdated. Possible values for this property are:
true
: Update Java projection of system classes
if they are outdated.
false
: Throw an exception if Java projection of
system classes are outdated
nocheck
: Bypass consistency check completely
1
: The same as true
.
0
: The same as false
.
-1
: The same as nocheck
.
true
. Note, that java class files are
not updated, and update affects only for this particular JVM
process. If com.intersys.debug
property is on, update
is logged.
NB: Setting this value to true
may be dangerous
because both check for outdateness and update itself do not affect
all posssible incompatibility problems.
com.intersys.debug
. Enables debug information be
logged into log file. Possible values for this property are:
0
means no
information is logged.
true
, the same as 1.
false
, the same as 0.
com.intersys.debug.threads
. Causes thread id to
be printed before any message in log file. Possible values for this
property are:
true
: print thread id.
false
: do not print thread id.
false
and any positive number has the same effect as true
.
com.intersys.debugReferenceCount
Enables debug
information about reference counting, opening and closing objects
to be logged into log file. Possible values for this property are:
0
means no
information is logged.
true
, the same as 1.
false
, the same as 0.
com.intersys.debug.logfile
Name of the log
file. If not specified, standard output is used for logging. Note,
that unless any of debug properties set to true or positive value
nothing is logged.
com.intersys.debugConnection.file
. Name of the
log file for JDBC log. If it is specified in connection URL, then
the value from URL is used. If neither this property is set nor log
file specified in URL, JDBC connection is not logged. This should
be normal situation because JDBC log files are quite large and
logging takes extra time.
com.intersys.profile.segments
. Number of
profiling segments. See method setNumberOfProfiles(int)
for
more information. Note, that property value takes precedence over
value set in method call.
com.intersys.cache.CacheOnClose
com.intersys.debugCache
Field Summary | |
static int |
ANT
|
static int |
DEFAULT
|
static int |
LAZY
|
static int |
NONE
|
Constructor Summary | |
CacheDatabase()
|
Method Summary | |
static Database |
getDatabase(Connection connection)
Attempts to establish a connection to the Cache server using existing JDBC connection to it. |
static Database |
getDatabase(String connectionString)
Attempts to establish a connection to the Cache server at given URL for user "_SYSTEM" with password "sys". |
static Database |
getDatabase(String connectionString,
String user,
String password)
Attempts to establish a connection to the Cache server at given URL. |
static Database |
getDatabase(String connectionString,
String user,
String password,
int cacheType)
Attempts to establish a connection to the Cache server at given URL. |
static Database |
getDatabase(String connectionString,
String user,
String password,
int cacheType,
boolean bUseStatistics)
Attempts to establish a connection to the Cache server at given URL. |
static Database |
getLightDatabase(Connection connection)
Attempts to establish a "Light" connection to the Cache server using existing JDBC connection to it. |
static Database |
getLightDatabase(String connectionString,
String user,
String password)
Attempts to establish a "Light" connection to the Cache server at given URL. |
static int |
getNumberOfProfiles()
Returns number of segments to gather profiling information. |
static Database |
getReadOnlyDatabase(Connection connection)
|
static Database |
getReadOnlyDatabase(String url,
String user,
String password)
|
static void |
setNumberOfProfiles(int n)
Sets number of segments to gather profiling information. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int DEFAULT
public static final int NONE
public static final int ANT
public static final int LAZY
Constructor Detail |
public CacheDatabase()
Method Detail |
public static Database getDatabase(String connectionString, String user, String password) throws CacheException
com.intersys.cache.type
. Possible values for this
property are:
ant
: normal caching
lazy
: lazy caching (not currently implemented).
none
: no client side caching, all requests always
go directly to Cache database.
com.intersys.cache.type
is not
defined or has value default
system default type
is assumed, currently ant
Whether to gather statistics for cache usage is determined from
the value of system property
com.intersys.cache.statistics
. Possible values for
this property are:
true
false
com.intersys.cache.statistics
is
not defined statistics is not gathered.
connectionString
- connection stringuser
- User name for Cache database. If null
user "_SYSTEM" is assumed.password
- Password for user of Cache. If
null
password "SYS" is used.
com.intersys.objects.Database
CacheException
- if connection can not be esatblished for
any reason.Database.printStatistics(java.io.PrintStream)
,
Database.printStatistics()
public static Database getDatabase(String connectionString) throws CacheException
com.intersys.cache.type
. Possible values for this
property are:
ant
: normal caching
lazy
: lazy caching
none
: no client side caching, all requests always
go directly to Cache database.
com.intersys.cache.type
is not
defined or has value default
system default type
is assumed, currently ant
Whether to gather statistics for cache usage is determined from
the value of system property
com.intersys.cache.statistics
. Possible values for
this property are:
true
false
com.intersys.cache.statistics
is
not defined statistics is not gathered.
connectionString
- connection stringcom.intersys.objects.Database
CacheException
- if connection can not be esatblished for
any reason.Database.printStatistics(java.io.PrintStream)
,
Database.printStatistics()
public static Database getDatabase(Connection connection) throws CacheException
com.intersys.cache.type
. Possible values for this
property are:
ant
: normal caching
lazy
: lazy caching
none
: no client side caching, all requests always
go directly to Cache database.
com.intersys.cache.type
is not
defined or has value default
system default type
is assumed, currently ant
Whether to gather statistics for cache usage is determined from
the value of system property
com.intersys.cache.statistics
. Possible values for
this property are:
true
false
com.intersys.cache.statistics
is
not defined statistics is not gathered.
connection
- JDBC connection represented as
java.sql.Connection
object.
com.intersys.objects.Database
CacheException
- if connection can not be esatblished for
any reason.Database.printStatistics(java.io.PrintStream)
,
Database.printStatistics()
public static Database getDatabase(String connectionString, String user, String password, int cacheType, boolean bUseStatistics) throws CacheException
connectionString
- connection stringcacheType
- type of internal cache. Possible values:
com.intersys.objects.CacheDatabase.NONE
: no
client side caching, all requests always go directly to Cache
database.
com.intersys.objects.CacheDatabase.ANT
:
normal caching.
com.intersys.objects.CacheDatabase.LAZY
: lazy
caching, not yet implemented option.
com.intersys.objects.CacheDatabase.DEFAULT
(or any negative value): cache type is determined from system
properties.
com.intersys.cache.type
. Possible values for this
property are:
ant
: normal caching
lazy
: lazy caching
none
: no client side caching, all requests always
go directly to Cache database.
com.intersys.cache.type
is not
defined or has value default
system default type
is assumed, currently ant
bUseStatistics
- if true, then statistics for cache usage
will be gathered and can be printed later by calling method
printStatistics
user
- User name for Cache database. If null
user "_SYSTEM" is assumed.password
- Password for user of Cache. If
null
password "SYS" is used.
com.intersys.objects.Database
CacheException
- if connection can not be esatblished for
any reason.Database.printStatistics(java.io.PrintStream)
,
Database.printStatistics()
public static Database getDatabase(String connectionString, String user, String password, int cacheType) throws CacheException
com.intersys.cache.statistics
. Possible values for
this property are:
true
false
com.intersys.cache.statistics
is
not defined statistics is not gathered.
connectionString
- connection stringcacheType
- type of internal cache. Possible values:
com.intersys.objects.CacheDatabase.NONE
: no
client side caching, all requests always go directly to Cache
database.
com.intersys.objects.CacheDatabase.ANT
:
normal caching.
com.intersys.objects.CacheDatabase.LAZY
: lazy
caching, not yet implemented option.
com.intersys.objects.CacheDatabase.DEFAULT
(or any negative value): cache type is determined from system
properties.
com.intersys.cache.type
. Possible values for this
property are:
ant
: normal caching
lazy
: lazy caching
none
: no client side caching, all requests always
go directly to Cache database.
com.intersys.cache.type
is not
defined or has value default
system default type
is assumed, currently ant
user
- User name for Cache database. If null
user "_SYSTEM" is assumed.password
- Password for user of Cache. If
null
password "SYS" is used.
com.intersys.objects.Database
CacheException
- if connection can not be esatblished for
any reason.Database.printStatistics(java.io.PrintStream)
,
Database.printStatistics()
public static Database getLightDatabase(String connectionString, String user, String password) throws CacheException
connectionString
- connection string in URL format, for
example: user
- User name for Cache database. If null
user "_SYSTEM" is assumed.password
- Password for user of Cache. If
null
password "SYS" is used.
com.intersys.objects.Database
CacheException
- if connection can not be esatblished for
any reason.public static Database getLightDatabase(Connection connection) throws CacheException
connection
- JDBC connection represented as
java.sql.Connection
object.
com.intersys.objects.Database
CacheException
- if connection can not be esatblished for
any reason.public static Database getReadOnlyDatabase(Connection connection) throws CacheException
CacheException
public static Database getReadOnlyDatabase(String url, String user, String password) throws CacheException
CacheException
public static void setNumberOfProfiles(int n)
com.intersys.profile.segments
takes precedence
over value set using this method.
n
- number of profiling segments.Database.getNumberOfServerCalls(int)
,
Database.getServerTime(int)
,
Database.setProfileOn(int)
,
Database.setProfileOn(int)
,
getNumberOfProfiles()
public static int getNumberOfProfiles()
Database.getNumberOfServerCalls(int)
,
Database.getServerTime(int)
,
Database.setProfileOn(int)
,
Database.setProfileOn(int)
,
getNumberOfProfiles()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |