org.nakedobjects.object
Class AbstractNakedObjectStore

java.lang.Object
  extended byorg.nakedobjects.object.AbstractNakedObjectStore
All Implemented Interfaces:
DebugInfo, NakedObjectStore
Direct Known Subclasses:
FileObjectStore, SqlObjectStore, TransientObjectStore

public abstract class AbstractNakedObjectStore
extends java.lang.Object
implements NakedObjectStore


Constructor Summary
protected AbstractNakedObjectStore()
          Create a new AbstractNakedObjectStore.
protected AbstractNakedObjectStore(CachePolicy cache)
          Create a new AbstractNakedObjectStore with a specified CachePolicy
 
Method Summary
 boolean areObjectsDistributed()
           
 boolean areObjectsProxied()
           
protected  void broadcastAddUpdate(NakedCollection collection, NakedObject object)
           
protected  void broadcastObjectUpdate(NakedObject object)
           
protected  void broadcastRemoveUpdate(NakedCollection collection, NakedObject object)
           
 java.util.Enumeration classes()
          Returns a list of all the classes (as NakedClasses) that this object store can handle.
 NakedObject createInstance(NakedClass type)
          Creates an new, persistent, naked object of the specified type - creates a logical instance.
 NakedObject getCachedObject(java.lang.Object oid)
           
 java.lang.String getDebugData()
          Debug details describing the object being investigated
 java.lang.String getDebugTitle()
          the title for the debug information
protected  Log getLog()
           
 void init()
           
 boolean isLoaded(java.lang.Object oid)
          Returns true if the system already holds an object with the specific OID
 void loaded(NakedObject object)
          Called by a client to indicate it has loaded a NakedObject into the system.
protected  void log()
           
protected  void log(java.lang.String text)
           
 PersistenceType persistenceType()
           
 void restart()
          Clears the cache.
 void setLog(Log newLog)
          Specifies the Log that all future logging calls should be made to.
 void setUpdateNotifier(UpdateNotifier notifier)
           
 void shutdown()
           
 void unloaded(NakedObject object)
          Called by a client to indicate it has unloaded a NakedObject from memory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.nakedobjects.object.NakedObjectStore
abortTransaction, addElement, containsElement, destroyObject, endTransaction, getNextElements, getNextInstances, getObject, getPreviousElements, getPreviousInstances, hasInstances, isFirstElement, isFirstInstance, isLastElement, isLastInstance, makePersistent, name, numberOfElements, numberOfInstances, removeElement, resolve, save, serialNumber, startTransaction
 

Constructor Detail

AbstractNakedObjectStore

protected AbstractNakedObjectStore()
Create a new AbstractNakedObjectStore. The CachePolicy is determined by the configuration file. TODO should throw ConfigurationException?


AbstractNakedObjectStore

protected AbstractNakedObjectStore(CachePolicy cache)
Create a new AbstractNakedObjectStore with a specified CachePolicy

Method Detail

getCachedObject

public NakedObject getCachedObject(java.lang.Object oid)

getDebugData

public java.lang.String getDebugData()
Description copied from interface: DebugInfo
Debug details describing the object being investigated

Specified by:
getDebugData in interface DebugInfo

getDebugTitle

public java.lang.String getDebugTitle()
Description copied from interface: DebugInfo
the title for the debug information

Specified by:
getDebugTitle in interface DebugInfo

isLoaded

public boolean isLoaded(java.lang.Object oid)
Description copied from interface: NakedObjectStore
Returns true if the system already holds an object with the specific OID

Specified by:
isLoaded in interface NakedObjectStore
Parameters:
oid -

setLog

public void setLog(Log newLog)
Description copied from interface: NakedObjectStore
Specifies the Log that all future logging calls should be made to.

Specified by:
setLog in interface NakedObjectStore
Parameters:
newLog - org.nakedobjects.utility.Log

setUpdateNotifier

public void setUpdateNotifier(UpdateNotifier notifier)
Specified by:
setUpdateNotifier in interface NakedObjectStore

areObjectsDistributed

public boolean areObjectsDistributed()
Specified by:
areObjectsDistributed in interface NakedObjectStore

areObjectsProxied

public boolean areObjectsProxied()
Specified by:
areObjectsProxied in interface NakedObjectStore

classes

public java.util.Enumeration classes()
                              throws ObjectStoreException
Description copied from interface: NakedObjectStore
Returns a list of all the classes (as NakedClasses) that this object store can handle.

Specified by:
classes in interface NakedObjectStore
Throws:
ObjectStoreException

createInstance

public NakedObject createInstance(NakedClass type)
                           throws ObjectStoreException
Deprecated.  

Description copied from interface: NakedObjectStore
Creates an new, persistent, naked object of the specified type - creates a logical instance. This creates a physical instance, makes it persistent, calls the new instance's created method, and ensures the object's initial logical state is stored away.

Specified by:
createInstance in interface NakedObjectStore
Throws:
ObjectStoreException

init

public void init()
          throws ObjectStoreException
Specified by:
init in interface NakedObjectStore
Throws:
ObjectStoreException

loaded

public void loaded(NakedObject object)
            throws ResolveException
Description copied from interface: NakedObjectStore
Called by a client to indicate it has loaded a NakedObject into the system. Should throw ResolveException if the object has already been loaded.

Specified by:
loaded in interface NakedObjectStore
Parameters:
object -
Throws:
ResolveException

persistenceType

public PersistenceType persistenceType()
Specified by:
persistenceType in interface NakedObjectStore

shutdown

public void shutdown()
              throws ObjectStoreException
Specified by:
shutdown in interface NakedObjectStore
Throws:
ObjectStoreException

unloaded

public void unloaded(NakedObject object)
Description copied from interface: NakedObjectStore
Called by a client to indicate it has unloaded a NakedObject from memory. Should throw ResolveException if the object has already been unloaded.

Specified by:
unloaded in interface NakedObjectStore
Parameters:
object -

getLog

protected Log getLog()

broadcastAddUpdate

protected void broadcastAddUpdate(NakedCollection collection,
                                  NakedObject object)

broadcastObjectUpdate

protected void broadcastObjectUpdate(NakedObject object)

broadcastRemoveUpdate

protected void broadcastRemoveUpdate(NakedCollection collection,
                                     NakedObject object)

log

protected void log()

log

protected void log(java.lang.String text)

restart

public void restart()
Clears the cache.

Specified by:
restart in interface NakedObjectStore