org.objectweb.jorm.facility.naming.generator
Class LongGenIncr

java.lang.Object
  extended byorg.objectweb.jorm.facility.naming.generator.LongGenIncr
All Implemented Interfaces:
LongGen, PAccessor, PBinding, PLongGen

public abstract class LongGenIncr
extends java.lang.Object
implements PLongGen, PAccessor, PBinding

Implements a long generator (LongGen) that produces new long ID merely by incrementing a persistent long variable.

Author:
P. Dechamboux

Field Summary
 
Fields inherited from interface org.objectweb.jorm.api.PBinding
ACTION_BIND, ACTION_EXIST, ACTION_EXPORT, ACTION_READ, ACTION_UNBIND, ACTION_UNEXPORT, ACTION_WRITE, LIFECYCLE_ACTIVEFORIO, LIFECYCLE_DELTOWRITE, LIFECYCLE_ERROR, LIFECYCLE_NEWTOWRITE, LIFECYCLE_NOTBOUND
 
Constructor Summary
LongGenIncr()
           
 
Method Summary
 long genId()
          Generates a new long identifier.
 long genId(java.lang.Object conn)
           
 java.lang.Object getMemoryInstance()
          It returns the memory instance within which the persistent variables are defined.
 void init(java.lang.String name, PClassMapping pcm, LongGenMgr mgr)
          Initializes this long generator.
 long paGetNextId()
          nextId getter.
 void paSetNextId(long val)
          nextId setter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.objectweb.jorm.api.PBinding
bind, exist, export, export, getPClassMapping, getPName, getStatus, init, read, read, unbind, unexport, write
 

Constructor Detail

LongGenIncr

public LongGenIncr()
Method Detail

init

public void init(java.lang.String name,
                 PClassMapping pcm,
                 LongGenMgr mgr)
          throws PException
Initializes this long generator. Verifies if it already exists and if not, creates it.

Specified by:
init in interface PLongGen
Parameters:
name - The name identifier associated with this long generator.
pcm - The associated PClassMapping.
mgr - The manager associated with this generator.
Throws:
PException

genId

public long genId()
           throws PException
Generates a new long identifier.

Specified by:
genId in interface LongGen
Returns:
The new identifier.
Throws:
PException

genId

public long genId(java.lang.Object conn)
           throws PException
Specified by:
genId in interface LongGen
Throws:
PException

getMemoryInstance

public java.lang.Object getMemoryInstance()
It returns the memory instance within which the persistent variables are defined.

Specified by:
getMemoryInstance in interface PAccessor
Returns:
The actual object containing memory persistent variables.

paGetNextId

public long paGetNextId()
nextId getter.


paSetNextId

public void paSetNextId(long val)
nextId setter.