org.objectweb.speedo.sequence.lib
Class SpeedoSequence

java.lang.Object
  extended byorg.objectweb.speedo.sequence.lib.SpeedoSequence
All Implemented Interfaces:
javax.jdo.datastore.Sequence, java.io.Serializable, SerializableSequence

public class SpeedoSequence
extends java.lang.Object
implements javax.jdo.datastore.Sequence, SerializableSequence

This class corresponds to the description of the tag sequence in the XML file. A sequence has : - a name - a datastore name (not mandatory) - a factory class (not mandatory) - a strategy - a package name

Author:
Y.Bersihand
See Also:
Serialized Form

Field Summary
 java.lang.Integer cache
           
static byte CONTIGUOUS
           
static java.lang.String CONTIGUOUS_STRING
           
 java.lang.String datastoreName
          The name of the sequence in the datastore Can be null or ""
 java.lang.String factoryClass
          The name of the factory class Can be null or ""
 java.lang.Integer increment
           
 java.lang.String name
          The name of the sequence
static byte NON_TRANSACTIONAL
           
static java.lang.String NON_TRANSACTIONAL_STRING
           
 java.lang.String packageName
          The name of the package in which the sequence has been defined
 java.lang.Integer start
           
 byte strategy
          The strategy of the sequence (NON_TRANSACTIONAL | CONTIGUOUS | NON_CONTIGUOUS)
static byte TRANSACTIONAL
           
static java.lang.String TRANSACTIONAL_STRING
           
 
Constructor Summary
SpeedoSequence()
           
 
Method Summary
 void allocate(int additional)
          Provides a hint to the implementation that the application will need additional sequence value objects in short order.
 java.lang.Object current()
          Returns the current sequence value object if it is available.
 long currentValue()
           
 org.objectweb.jorm.facility.naming.generator.LongGen getLongGen()
           
 java.lang.String getName()
          Returns the fully qualified name of the Sequence.
 SequenceManager getSequenceManager()
           
 java.lang.Object next()
          Returns the next sequence value object.
 long nextValue()
           
 void setLongGen(org.objectweb.jorm.facility.naming.generator.LongGen longGen)
           
 void setSequenceManager(SequenceManager sequenceManager)
           
static byte strategyToByte(java.lang.String s)
          Transforms a String into a Byte.
static java.lang.String strategyToString(byte b)
          Transforms a byte into a String.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

NON_TRANSACTIONAL

public static final byte NON_TRANSACTIONAL
See Also:
Constant Field Values

CONTIGUOUS

public static final byte CONTIGUOUS
See Also:
Constant Field Values

TRANSACTIONAL

public static final byte TRANSACTIONAL
See Also:
Constant Field Values

NON_TRANSACTIONAL_STRING

public static final java.lang.String NON_TRANSACTIONAL_STRING
See Also:
Constant Field Values

CONTIGUOUS_STRING

public static final java.lang.String CONTIGUOUS_STRING
See Also:
Constant Field Values

TRANSACTIONAL_STRING

public static final java.lang.String TRANSACTIONAL_STRING
See Also:
Constant Field Values

name

public java.lang.String name
The name of the sequence


datastoreName

public java.lang.String datastoreName
The name of the sequence in the datastore Can be null or ""


factoryClass

public java.lang.String factoryClass
The name of the factory class Can be null or ""


strategy

public byte strategy
The strategy of the sequence (NON_TRANSACTIONAL | CONTIGUOUS | NON_CONTIGUOUS)


packageName

public java.lang.String packageName
The name of the package in which the sequence has been defined


increment

public java.lang.Integer increment

start

public java.lang.Integer start

cache

public java.lang.Integer cache
Constructor Detail

SpeedoSequence

public SpeedoSequence()
Method Detail

getLongGen

public org.objectweb.jorm.facility.naming.generator.LongGen getLongGen()

setLongGen

public void setLongGen(org.objectweb.jorm.facility.naming.generator.LongGen longGen)

strategyToByte

public static byte strategyToByte(java.lang.String s)
Transforms a String into a Byte. The String must corresponds to local variables. It returns the byte associated with the variable.

Parameters:
s - String to transform.
Returns:
the byte associated to the String.

strategyToString

public static java.lang.String strategyToString(byte b)
Transforms a byte into a String.

Parameters:
b - the byte to transform.
Returns:
the String associated to the byte.

getSequenceManager

public SequenceManager getSequenceManager()

setSequenceManager

public void setSequenceManager(SequenceManager sequenceManager)

allocate

public void allocate(int additional)
Provides a hint to the implementation that the application will need additional sequence value objects in short order.

Specified by:
allocate in interface javax.jdo.datastore.Sequence

current

public java.lang.Object current()
Returns the current sequence value object if it is available.

Specified by:
current in interface javax.jdo.datastore.Sequence

getName

public java.lang.String getName()
Returns the fully qualified name of the Sequence.

Specified by:
getName in interface javax.jdo.datastore.Sequence

next

public java.lang.Object next()
Returns the next sequence value object.

Specified by:
next in interface javax.jdo.datastore.Sequence

nextValue

public long nextValue()
Specified by:
nextValue in interface javax.jdo.datastore.Sequence

currentValue

public long currentValue()
Specified by:
currentValue in interface javax.jdo.datastore.Sequence