net.walend.lyophil
Interface IdentifierSource

All Known Implementing Classes:
EJBIdentifierSource, JDBCIdentifierSource, MemIdentifierSource

public interface IdentifierSource

This interface defines a source of identifier Objects.

Since:
20001121
Author:
David Walend

Field Summary
static java.lang.String ROLE
           
 
Method Summary
 boolean checkSetUp()
          make sure the backing storage is set up correctly
 java.io.Serializable createID()
          Return a new identifier Object.
 java.io.Serializable peekNextID()
          Returns the next id to be created, without assigning it as in use.
 void setUp()
          set up the backing storage
 void tearDown()
          clean up the backing storage
 

Field Detail

ROLE

public static final java.lang.String ROLE
Method Detail

createID

public java.io.Serializable createID()
Return a new identifier Object. The Object should be immutable and unique inside the system. Longs or RMI identifiers are a good choice. Your implementation should periodically log information about how quickly it's using up unique identifiers.

Throws:
IdentifierUnavailableException - if the IdentifierSource can't get a new unique Object.
LastIdentifierUsedException - if the IdentifierSource is completely out of unique Objects.

peekNextID

public java.io.Serializable peekNextID()
Returns the next id to be created, without assigning it as in use. I use this method for testing.


checkSetUp

public boolean checkSetUp()
make sure the backing storage is set up correctly

Throws:
PersistenceFailureException

setUp

public void setUp()
set up the backing storage

Throws:
PersistenceFailureException

tearDown

public void tearDown()
clean up the backing storage

Throws:
PersistenceFailureException


Copyright (c) 2000, 2001, David Walend