org.nakedobjects.runtime.persistence.oidgenerator.simple
Class SimpleOidGenerator

java.lang.Object
  extended by org.nakedobjects.runtime.persistence.oidgenerator.OidGeneratorAbstract
      extended by org.nakedobjects.runtime.persistence.oidgenerator.simple.SimpleOidGenerator
All Implemented Interfaces:
Component, Injectable, SessionScopedComponent, DebugInfo, OidGenerator
Direct Known Subclasses:
TimeBasedOidGenerator

public class SimpleOidGenerator
extends OidGeneratorAbstract

Generates OIDs based on monotonically.

Specifies the OidStringifierDirect as the OID stringifier (SerialOid is conformant)).


Nested Class Summary
static class SimpleOidGenerator.Memento
           
 
Constructor Summary
SimpleOidGenerator()
           
SimpleOidGenerator(long seed)
          Persistent Oids count up from the provided seed parameter, while Oid.isTransient() transient Oids count down.
SimpleOidGenerator(SimpleOidGenerator.Memento memento)
           
 
Method Summary
 void convertTransientToPersistentOid(Oid oid)
          Convert the Oid from transient to persistent, storing the previous Oid as Oid.getPrevious()
 SerialOid createTransientOid(java.lang.Object object)
          Create a new transient Oid for the supplied pojo, uniquely distinguishable from any other Oid.
 void debugData(DebugString debug)
           
 java.lang.String debugTitle()
           
 SimpleOidGenerator.Memento getMemento()
           
 java.lang.String name()
           
 void resetTo(SimpleOidGenerator.Memento memento)
          Reset to a SimpleOidGenerator.Memento previously obtained via getMemento().
 
Methods inherited from class org.nakedobjects.runtime.persistence.oidgenerator.OidGeneratorAbstract
close, getOidStringifier, injectInto, open
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleOidGenerator

public SimpleOidGenerator()

SimpleOidGenerator

public SimpleOidGenerator(long seed)
Persistent Oids count up from the provided seed parameter, while Oid.isTransient() transient Oids count down.


SimpleOidGenerator

public SimpleOidGenerator(SimpleOidGenerator.Memento memento)
Method Detail

name

public java.lang.String name()

createTransientOid

public SerialOid createTransientOid(java.lang.Object object)
Description copied from interface: OidGenerator
Create a new transient Oid for the supplied pojo, uniquely distinguishable from any other Oid.


convertTransientToPersistentOid

public void convertTransientToPersistentOid(Oid oid)
Description copied from interface: OidGenerator
Convert the Oid from transient to persistent, storing the previous Oid as Oid.getPrevious()

Implementation notes:


getMemento

public SimpleOidGenerator.Memento getMemento()

resetTo

public void resetTo(SimpleOidGenerator.Memento memento)
Reset to a SimpleOidGenerator.Memento previously obtained via getMemento().

Used in particular by the InMemoryObjectStore to reset (a new OidGenerator is created each time).


debugData

public void debugData(DebugString debug)

debugTitle

public java.lang.String debugTitle()


Copyright © 2001-2009 Naked Objects Group Ltd.. All Rights Reserved.