Class Autosaver
java.lang.Object
com.xpdustry.claj.server.util.Autosaver
Save periodically the registered
Autosaver.Saveables and also when the application exit.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enumDefines the order to save things.static interfaceDefines a things that can be saved by theAutosaver. -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic arc.func.Cons2<Autosaver.Saveable, Throwable> Called when a save fail. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidadd(Autosaver.Saveable saveable) Adds to thenormalpriority.static voidadd(Autosaver.Saveable saveable, Autosaver.Priority priority) static voidclear()Don't do that!static voidclear(Autosaver.Priority priority) Don't do that!static booleanSave all registered things now, even not modified.static booleanhas(Autosaver.Saveable saveable) static booleanhas(Autosaver.Saveable saveable, Autosaver.Priority priority) static voidinit(arc.Application app) Init the auto-saver to run a save every seconds.static Autosaver.PrioritypriorityOf(Autosaver.Saveable saveable) static voidremove(Autosaver.Saveable saveable) static booleansave()Save all registered things now, only if modified.static boolean
-
Field Details
-
errorHandler
Called when a save fail.
-
-
Constructor Details
-
Autosaver
public Autosaver()
-
-
Method Details
-
init
public static void init(arc.Application app) Init the auto-saver to run a save every seconds. -
add
Adds to thenormalpriority. -
add
-
remove
-
clear
public static void clear()Don't do that! -
clear
Don't do that! -
has
-
has
-
priorityOf
-
saveNeeded
public static boolean saveNeeded() -
save
public static boolean save()Save all registered things now, only if modified. -
forceSave
public static boolean forceSave()Save all registered things now, even not modified.
-