java.lang.Object
io.hypersistence.optimizer.core.event.persistence.WebApp

public class WebApp extends Object
The WebApp optionally starts the Hypersistence Optimizer WebApp inside the host application, so the events can be visualized without deploying a separate process.

It reuses the host application's Hibernate ConnectionProvider (via HostWebAppConnectionProvider), so the web app reads the events with the very same database credentials and connection pool as the application, and it binds an embedded HTTP server (by default on a dynamically-allocated free port on localhost), logging the resulting URL.

Like the rest of the event persistence feature, it is fully failure-isolated: any problem while starting the web app is logged and never propagated to the host application.

Since:
2.14.0
Author:
Vlad Mihalcea
  • Constructor Details

  • Method Details

    • start

      public void start()
      Start the web app, if it is not already running. The Config.EventPersistence#setWebAppEnabled setting only controls whether the bootstrap starts it automatically; calling this method always starts it. Never throws; failures are logged and the web app simply stays down.
    • getUrl

      public String getUrl()
      Get the URL the web app is available at, or null if it is not running.
      Returns:
      the web app URL, or null
    • stop

      public void stop()
      Stop the web app, if it is running. Never throws.