org.exolab.jms.persistence
Class SeedGenerator

java.lang.Object
  |
  +--org.exolab.jms.persistence.SeedGenerator

public class SeedGenerator
extends java.lang.Object

This class generates seeds

Version:
$Revision: 1.3 $ $Date: 2005/06/09 14:39:52 $
Author:
Tim Anderson

Constructor Summary
protected SeedGenerator()
          Constructor
 
Method Summary
 void close()
          Issue a close, which in this case invalidates the singleton TODO: do we really need this
static SeedGenerator initialise()
          Initialise the seed generator
static SeedGenerator instance()
          Returns the singleton instance.
 long next(java.sql.Connection connection, java.lang.String name)
          Return the next seed value for the given name
 void removeAll(java.sql.Connection connection)
          Remove all seeds.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SeedGenerator

protected SeedGenerator()
Constructor
Method Detail

instance

public static SeedGenerator instance()
Returns the singleton instance. Note that initialise() must have been invoked first for this to return a valid instance.
Returns:
SeedGenerator the singleton instance

initialise

public static SeedGenerator initialise()
Initialise the seed generator
Returns:
SeedGenerator the singleton instance

next

public long next(java.sql.Connection connection,
                 java.lang.String name)
          throws PersistenceException
Return the next seed value for the given name
Parameters:
connection - - the connection used
name - - the name of the seed
Returns:
long - the next seed value
Throws:
PersistenceException - - if the seed cannot be retrieved

removeAll

public void removeAll(java.sql.Connection connection)
               throws PersistenceException
Remove all seeds.
Parameters:
connection - - the connection to use
Throws:
PersistenceException - - is thrown if the request does not complete

close

public void close()
Issue a close, which in this case invalidates the singleton TODO: do we really need this


Copyright © 1999-2005 The OpenJMS Group. All Rights Reserved.