|
|||||||||
| Home >> All >> com >> lutris >> appserver >> server >> sql >> [ standard overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
com.lutris.appserver.server.sql.standard
Class StandardObjectIdAllocator

java.lang.Objectcom.lutris.appserver.server.sql.standard.StandardObjectIdAllocator
- All Implemented Interfaces:
- com.lutris.appserver.server.sql.ObjectIdAllocator
- public class StandardObjectIdAllocator
- extends java.lang.Object
- implements com.lutris.appserver.server.sql.ObjectIdAllocator
- extends java.lang.Object
Object ids can only be created via this manager. Ensures that all object ids are unique across all objects in this logical database. Also ensures good performance for allocating object ids.
The configuration data is specified in the section:
DatabaseManager.DB.dbName.ObjectId
Configuration fields are:
-
CacheSize- The number of object id's to cache between database queries. Optional, if not specified, then it defaults to 1024. -
MinValue- The starting number of Object ID allocation. This will only be used if the Object ID table is empty and thus is useful in development and testing. Optional, if not specified it defaults to 100000000000000000. Note that the largest number that can be associated with an OID in LBS is "database: DECIMAL(19,0)"
- Since:
- LBS1.8
- Version:
- $Revision: 1.7.12.1 $
| Field Summary | |
private long |
cacheSize
Default cache size if 1K. |
private com.lutris.appserver.server.sql.ObjectId |
current
The object id mos recently allocated. |
private com.lutris.logging.LogChannel |
log
The log channel. |
private static int |
LOG_THRESHOLD
If allocation of object id's fails (because the contents of the table are modified by another process) this object id manager will keep trying to allocate object ids until it succeeds. |
private com.lutris.appserver.server.sql.LogicalDatabase |
logicalDatabase
Reference to the logical database for easy access to the connection pool. |
private com.lutris.appserver.server.sql.ObjectId |
max
The maximum object id in the cache. |
private com.lutris.appserver.server.sql.ObjectId |
next
The next object id that will be allocated. |
private java.lang.String |
oidMinValue
Starting value for object id creation, if table is empty. |
| Constructor Summary | |
protected |
StandardObjectIdAllocator(com.lutris.appserver.server.sql.LogicalDatabase logicalDatabase,
com.lutris.util.Config objIdConfig)
Initialize the object id manager. |
| Method Summary | |
com.lutris.appserver.server.sql.ObjectId |
allocate()
Allocates a new object id. |
private void |
updateCache()
Updates the cache of object id's. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
max
private com.lutris.appserver.server.sql.ObjectId max
- The maximum object id in the cache.
current
private com.lutris.appserver.server.sql.ObjectId current
- The object id mos recently allocated.
next
private com.lutris.appserver.server.sql.ObjectId next
- The next object id that will be allocated.
cacheSize
private long cacheSize
- Default cache size if 1K. Note that if the
application is started and stopped frequently
you should drop this value in order not
to waste object ids.
oidMinValue
private java.lang.String oidMinValue
- Starting value for object id creation, if table is empty.
This is a string because very large numbers are possible.
logicalDatabase
private com.lutris.appserver.server.sql.LogicalDatabase logicalDatabase
- Reference to the logical database for easy access to the
connection pool.
LOG_THRESHOLD
private static final int LOG_THRESHOLD
- If allocation of object id's fails (because the contents of
the table are modified by another process) this object
id manager will keep trying to allocate object ids
until it succeeds. If it fails more than LOG_THRESHOLD
times, then it will log a message to the system.
- See Also:
- Constant Field Values
log
private com.lutris.logging.LogChannel log
- The log channel.
| Constructor Detail |
StandardObjectIdAllocator
protected StandardObjectIdAllocator(com.lutris.appserver.server.sql.LogicalDatabase logicalDatabase, com.lutris.util.Config objIdConfig) throws com.lutris.util.ConfigException
- Initialize the object id manager.
| Method Detail |
allocate
public com.lutris.appserver.server.sql.ObjectId allocate()
- Allocates a new object id.
- Specified by:
allocatein interfacecom.lutris.appserver.server.sql.ObjectIdAllocator
updateCache
private void updateCache()
- Updates the cache of object id's.
|
|||||||||
| Home >> All >> com >> lutris >> appserver >> server >> sql >> [ standard overview ] | PREV CLASS NEXT CLASS | ||||||||
SUMMARY: JAVADOC | SOURCE | DOWNLOAD | NESTED | FIELD | CONSTR | METHOD |
DETAIL: FIELD | CONSTR | METHOD | ||||||||
JAVADOC
com.lutris.appserver.server.sql.standard.StandardObjectIdAllocator