public class PersistenceManager
extends java.lang.Thread
The PersistenceManager gets the database object from Engine.getDatabase()
EnginePlugin
Constructor and Description |
---|
PersistenceManager() |
Modifier and Type | Method and Description |
---|---|
void |
callSaveHooks(Entity e) |
void |
clearDirty(Entity entity)
Remove entity from the dirty list.
|
boolean |
isDirty(Entity entity)
True if the entity is on the dirty list.
|
void |
persistEntity(Entity e) |
void |
persistEntity(java.lang.String persistenceKey,
Entity e) |
void |
registerSaveHook(Namespace namespace,
EnginePlugin.SaveHook saveHook)
Register a save hook.
|
void |
run() |
void |
setDirty(Entity entity)
Add entity to the dirty list.
|
void |
start() |
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, stop, stop, suspend, toString, yield
public void registerSaveHook(Namespace namespace, EnginePlugin.SaveHook saveHook)
saveHook
- the hook to be used when your sub object is marked dirty and
needs to be saved. it should handle deep copy if needed. this will be called
by the persistenceManager when it wants to save the object.
if saveHook is null, it will use the default handler which does not do a deep copypublic void setDirty(Entity entity)
public void clearDirty(Entity entity)
public boolean isDirty(Entity entity)
public void start()
start
in class java.lang.Thread
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void persistEntity(java.lang.String persistenceKey, Entity e)
public void persistEntity(Entity e)
public void callSaveHooks(Entity e)