public interface Cef
Modifier and Type | Method and Description |
---|---|
Browser |
createBrowser(RenderHandler renderHandler,
java.net.URL initialURL)
Create a new browser.
|
void |
doMessageLoopWork()
Perform a single iteration of CEF message loop processing.
|
void |
initialize()
Initialize CEF.
|
boolean |
isInitialized() |
void |
shutdown()
Shutdown CEF processes, should be called before the application exits.
|
java.util.concurrent.CompletableFuture<java.lang.Void> |
start()
Start CEF and run the automatic message loop.
|
void initialize()
doMessageLoopWork()
.
Must be called from the main application thread (see CEF documentation on CefInitialize
).java.util.concurrent.CompletableFuture<java.lang.Void> start()
CefRunMessageLoop
). When using this method,
initialize()
must not be invoked manually as it will be handled by the
implementation to ensure it happens on the correct thread.CompletableFuture
which completes when CEF has been initialized.
Can be used to determine the status as alternative to polling isInitialized()
.void doMessageLoopWork()
initialize()
beforehand. Must be called from the main application thread
(see CEF documentation on CefDoMessageLoopWork
).
Note that care needs to be taken to neither call this too infrequently (to avoid starving the CEF message loop)
but also not too often (to avoid impacting CPU usage) - see CEF documentation for details when using this approach.void shutdown() throws java.lang.InterruptedException
doMessageLoopWork()
, this must be called from the main
application thread (see CEF documentation on CefShutdown
). When using the integrated/automatic
message loop it may be invoked from any thread as the implementation ensures the shutdown is run on the correct thread.java.lang.InterruptedException
- if the current thread is interrupted whilst waiting on the
shutdown of the integrated message loopboolean isInitialized()
Browser createBrowser(RenderHandler renderHandler, java.net.URL initialURL)
renderHandler
- handler which provides viewport information and renders imagesinitialURL
- the initial URL to load in the created browserjava.lang.IllegalStateException
- if CEF has not been initialized yet