|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.jcorporate.expresso.core.dbobj.NextNumber
com.jcorporate.expresso.core.dbobj.NextNumberImpl
this class is a SOLITAIRE, used in NextNumber
NextNumber - Manages in-memory, database independent autoincrement values. This
version is not cluster safe. See Expresso Enterprise for a cluster-safe version.| Field Summary | |
protected EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap |
contextMap
Top level hashMap - This level separates the db contexts. |
| Fields inherited from class com.jcorporate.expresso.core.dbobj.NextNumber |
CHECK_PARAMETERS, DEFAULT_CLASS_HANDLER, log, theInstance |
| Constructor Summary | |
NextNumberImpl()
Create the base level hashes for each db key. |
|
| Method Summary | |
protected void |
checkParams(String db,
DBObject callingObject,
String fieldName)
All parameters are fully checked to avoid potential NullPointerExceptions |
long |
getNext(String db,
DBObject callingDBObject,
String fieldName)
Get the nextnumber for this dbobject. |
void |
initialize(String db,
DBObject callingObject)
Initializes hash entries for all auto-inc fields in a particular DBOBject. |
void |
registerField(String db,
DBObject callingDBOBject,
String fieldName)
Register a field for next number information. |
void |
reset(String db)
Reset the counts for the paritcular db each subsequent operation will require a new getMax(). |
void |
reset(String db,
DBObject callingObject)
Clears the table on a particular dbobject. |
| Methods inherited from class com.jcorporate.expresso.core.dbobj.NextNumber |
destroy, getInstance, getKey, getMax |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected volatile EDU.oswego.cs.dl.util.concurrent.ConcurrentReaderHashMap contextMap
| Constructor Detail |
public NextNumberImpl()
| Method Detail |
public void initialize(String db,
DBObject callingObject)
throws DBException
db - The db to hook this nextnumber object to.callingObject - the object to initialize from.
DBException
public void registerField(String db,
DBObject callingDBOBject,
String fieldName)
throws DBException
registerField in class NextNumberdb - The database context to work with.callingDBOBject - The calling database object to register the field forfieldName - The field name to register into the NextNumber engine
DBException
protected void checkParams(String db,
DBObject callingObject,
String fieldName)
throws DBException
db - The context to get this out of.callingObject - - the DBObject that this nextnumber object belongs to.fieldName - - the field name within the callingObject that this nextnumber belongs to.
DBException
public long getNext(String db,
DBObject callingDBObject,
String fieldName)
throws DBException
getNext in class NextNumberdb - The datacontext. MAKE SURE THIS IS CORRECT or else you will get duplicate running counts for each incorrect DB name, and thus Duplicate key errors when trying to write rows.callingDBObject - The calling DBOBjectfieldName - the name of the field to get the next number value for
DBExceptionpublic void reset(String db)
reset in class NextNumberdb - the db context to clear all the next number values for.
public void reset(String db,
DBObject callingObject)
reset in class NextNumberdb - The db context that the next number resides in.callingObject - the object that links to the various nextnumber
objects
|
Expresso 5-6 | ||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||