Package arc.backend.headless
Class HeadlessApplication
java.lang.Object
arc.backend.headless.HeadlessApplication
- All Implemented Interfaces:
Application
,Disposable
a headless implementation of an application primarily intended to be used in servers
-
Nested Class Summary
Nested classes/interfaces inherited from interface arc.Application
Application.ApplicationType
-
Field Summary
Modifier and TypeFieldDescriptionprotected final MockGraphics
protected final Seq<ApplicationListener>
protected Thread
protected long
protected final TaskQueue
protected boolean
-
Constructor Summary
ConstructorDescriptionHeadlessApplication
(ApplicationListener listener) HeadlessApplication
(ApplicationListener listener, float renderIntervalSec, Cons<Throwable> exceptionHandler) HeadlessApplication
(ApplicationListener listener, Cons<Throwable> exceptionHandler) -
Method Summary
Modifier and TypeMethodDescriptionvoid
exit()
Schedule an exit from the application.Returns a list of all the application listeners used.getType()
protected void
void
Posts a runnable on the main loop thread.void
setClipboardText
(String text) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface arc.Application
addListener, defaultUpdate, dispose, getJavaHeap, getNativeHeap, getVersion, isAndroid, isDesktop, isHeadless, isIOS, isMobile, isWeb, openFolder, openURI, removeListener
Methods inherited from interface arc.util.Disposable
isDisposed
-
Field Details
-
graphics
-
listeners
-
runnables
-
exceptionHandler
-
renderInterval
protected long renderInterval -
mainLoopThread
-
running
protected boolean running
-
-
Constructor Details
-
HeadlessApplication
-
HeadlessApplication
-
HeadlessApplication
public HeadlessApplication(ApplicationListener listener, float renderIntervalSec, Cons<Throwable> exceptionHandler)
-
-
Method Details
-
initialize
protected void initialize() -
getType
- Specified by:
getType
in interfaceApplication
- Returns:
- what
Application.ApplicationType
this application has, e.g. Android or Desktop
-
getClipboardText
- Specified by:
getClipboardText
in interfaceApplication
-
setClipboardText
- Specified by:
setClipboardText
in interfaceApplication
-
getListeners
Description copied from interface:Application
Returns a list of all the application listeners used.- Specified by:
getListeners
in interfaceApplication
-
post
Description copied from interface:Application
Posts a runnable on the main loop thread.- Specified by:
post
in interfaceApplication
-
exit
public void exit()Description copied from interface:Application
Schedule an exit from the application. On android, this will cause a call to pause() and dispose() some time in the future, it will not immediately finish your application. On iOS this should be avoided in production as it breaks Apples guidelines.- Specified by:
exit
in interfaceApplication
-