net.walend.lyophil.ejb
Class EJBIdentifierSource

java.lang.Object
  |
  +--net.walend.lyophil.ejb.EJBIdentifierSource
All Implemented Interfaces:
IdentifierSource

public class EJBIdentifierSource
extends java.lang.Object
implements IdentifierSource

Since:
20010801
Author:
David Walend

Field Summary
 
Fields inherited from interface net.walend.lyophil.IdentifierSource
ROLE
 
Constructor Summary
EJBIdentifierSource()
           
 
Method Summary
 boolean checkSetUp()
          make sure the backing storage is set up correctly
 java.io.Serializable createID()
          Return a new identifier Object.
private  IdentifierSourceEJB getIDSource()
           
 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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

EJBIdentifierSource

public EJBIdentifierSource()
Method Detail

getIDSource

private IdentifierSourceEJB getIDSource()

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.

Specified by:
createID in interface IdentifierSource
Throws:
an - IdentifierUnavailableException if the IdentifierSource can't get a new unique Object.
a - 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.

Specified by:
peekNextID in interface IdentifierSource

checkSetUp

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

Specified by:
checkSetUp in interface IdentifierSource
Throws:
<{PersistenceFailureException}>

setUp

public void setUp()
set up the backing storage

Specified by:
setUp in interface IdentifierSource
Throws:
<{PersistenceFailureException}>

tearDown

public void tearDown()
clean up the backing storage

Specified by:
tearDown in interface IdentifierSource
Throws:
<{PersistenceFailureException}>


Copyright (c) 2000, 2001, David Walend