Methods Summary |
---|
private static synchronized UniqueValueGeneratorBackend | getBackendGenerator()
if( generatorBackend_ == null ) {
InitialContext jndiContext = new InitialContext();
generatorBackend_ = (UniqueValueGeneratorBackend)
jndiContext.lookup(UniqueValueGeneratorBackend.JNDI_NAME);
}
return generatorBackend_;
|
public java.lang.String | getContext()
return context_;
|
private static synchronized java.lang.String | getGeneratorBackendId()
if( generatorBackendId_ == null ) {
try {
UniqueValueGeneratorBackend backend = getBackendGenerator();
generatorBackendId_ = backend.getGeneratorId();
} catch(Exception e) {
/** IASRI 4660742
Log.err.println(e);
**/
// START OF IASRI 4660742
_logger.log(Level.SEVERE,"enterprise_util.excep_suidgen_getgenbackendid",e);
// END OF IASRI 4660742
throw new UniqueValueGeneratorException(e.getMessage());
}
}
return generatorBackendId_;
|
public java.lang.String | nextId()
return getGeneratorBackendId() + "_" + nextNumber();
|
public long | nextNumber()
return nextNumberInternal(getContext());
|
private static synchronized long | nextNumberInternal(java.lang.String context)
UniqueValueBlock valueBlock = null;
try {
UniqueValueGeneratorBackend generatorBackend =
getBackendGenerator();
valueBlock = (UniqueValueBlock) contextBlocks_.get(context);
if( (valueBlock == null) || (!valueBlock.hasNext()) ) {
valueBlock = generatorBackend.getNextValueBlock(context);
contextBlocks_.put(context, valueBlock);
}
} catch(Exception e) {
/** IASRI 4660742
Log.err.println(e);
**/
// START OF IASRI 4660742
_logger.log(Level.SEVERE,"enterprise_util.excep_suidgen_nextnuminternal",e);
// END OF IASRI 4660742
throw new UniqueValueGeneratorException(e.getMessage());
}
return valueBlock.next();
|