Class QuarkusBrowserlessApplicationContext

java.lang.Object
com.vaadin.browserless.quarkus.QuarkusBrowserlessApplicationContext

public final class QuarkusBrowserlessApplicationContext extends Object
Factory for creating a Quarkus-integrated BrowserlessApplicationContext.

Wires a Quarkus-aware servlet and the QuarkusTestLookupInitializer. Three entry points are provided:

  • create(Routes) — returns the unsecured BrowserlessApplicationContext.
  • createSecured(Routes) — returns the credential-typed SecuredBrowserlessApplicationContext; requires Quarkus Security on the classpath.
  • builder(Routes) — returns a pre-wired BrowserlessApplicationContext.Builder for full customization (e.g. plugging in a different security handler).
 var app = QuarkusBrowserlessApplicationContext.createSecured(routes);
 var admin = app.newUser(securityIdentity);
 var window = admin.newWindow();
 window.navigate(ProtectedView.class);
 
See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    static com.vaadin.browserless.BrowserlessApplicationContext.Builder
    builder(com.vaadin.browserless.internal.Routes routes)
    Creates a Quarkus-pre-wired builder.
    static com.vaadin.browserless.BrowserlessApplicationContext.Builder
    builder(com.vaadin.browserless.internal.Routes routes, com.vaadin.browserless.internal.UIFactory uiFactory)
    Creates a Quarkus-pre-wired builder with a custom UI factory.
    static com.vaadin.browserless.BrowserlessApplicationContext
    create(com.vaadin.browserless.internal.Routes routes)
    Creates an unsecured Quarkus-integrated application context.
    static com.vaadin.browserless.BrowserlessApplicationContext
    create(com.vaadin.browserless.internal.Routes routes, com.vaadin.browserless.internal.UIFactory uiFactory)
    Creates an unsecured Quarkus-integrated application context with a custom UI factory.
    static com.vaadin.browserless.SecuredBrowserlessApplicationContext<io.quarkus.security.identity.SecurityIdentity>
    createSecured(com.vaadin.browserless.internal.Routes routes)
    Creates a Quarkus-integrated application context with Quarkus Security wiring.
    static com.vaadin.browserless.SecuredBrowserlessApplicationContext<io.quarkus.security.identity.SecurityIdentity>
    createSecured(com.vaadin.browserless.internal.Routes routes, com.vaadin.browserless.internal.UIFactory uiFactory)
    Creates a secured Quarkus-integrated application context with a custom UI factory.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • builder

      public static com.vaadin.browserless.BrowserlessApplicationContext.Builder builder(com.vaadin.browserless.internal.Routes routes)
      Creates a Quarkus-pre-wired builder. The builder has the Quarkus servlet and the lookup initializer configured; callers can chain additional customizations before calling BrowserlessApplicationContext.Builder.build().
      Parameters:
      routes - the discovered routes
      Returns:
      a pre-wired builder
    • builder

      public static com.vaadin.browserless.BrowserlessApplicationContext.Builder builder(com.vaadin.browserless.internal.Routes routes, com.vaadin.browserless.internal.UIFactory uiFactory)
      Creates a Quarkus-pre-wired builder with a custom UI factory.
      Parameters:
      routes - the discovered routes
      uiFactory - the UI factory
      Returns:
      a pre-wired builder
    • create

      public static com.vaadin.browserless.BrowserlessApplicationContext create(com.vaadin.browserless.internal.Routes routes)
      Creates an unsecured Quarkus-integrated application context.
      Parameters:
      routes - the discovered routes
      Returns:
      a new unsecured application context configured for Quarkus
    • create

      public static com.vaadin.browserless.BrowserlessApplicationContext create(com.vaadin.browserless.internal.Routes routes, com.vaadin.browserless.internal.UIFactory uiFactory)
      Creates an unsecured Quarkus-integrated application context with a custom UI factory.
      Parameters:
      routes - the discovered routes
      uiFactory - the UI factory
      Returns:
      a new unsecured application context configured for Quarkus
    • createSecured

      public static com.vaadin.browserless.SecuredBrowserlessApplicationContext<io.quarkus.security.identity.SecurityIdentity> createSecured(com.vaadin.browserless.internal.Routes routes)
      Creates a Quarkus-integrated application context with Quarkus Security wiring. Requires Quarkus Security on the classpath; throws otherwise.
      Parameters:
      routes - the discovered routes
      Returns:
      a new secured application context configured for Quarkus Security
      Throws:
      IllegalStateException - if Quarkus Security is not on the classpath
    • createSecured

      public static com.vaadin.browserless.SecuredBrowserlessApplicationContext<io.quarkus.security.identity.SecurityIdentity> createSecured(com.vaadin.browserless.internal.Routes routes, com.vaadin.browserless.internal.UIFactory uiFactory)
      Creates a secured Quarkus-integrated application context with a custom UI factory. Requires Quarkus Security on the classpath; throws otherwise.
      Parameters:
      routes - the discovered routes
      uiFactory - the UI factory
      Returns:
      a new secured application context configured for Quarkus Security
      Throws:
      IllegalStateException - if Quarkus Security is not on the classpath