Class EmbeddedPiranhaBuilder

java.lang.Object
cloud.piranha.embedded.EmbeddedPiranhaBuilder

public class EmbeddedPiranhaBuilder extends Object
The builder so you can easily build instances of EmbeddedPiranha.
Author:
Manfred Riem ([email protected])
See Also:
EmbeddedPiranha
  • Constructor Details

    • EmbeddedPiranhaBuilder

      public EmbeddedPiranhaBuilder()
      Constructor.
  • Method Details

    • aliasedDirectoryResource

      public EmbeddedPiranhaBuilder aliasedDirectoryResource(String path, String alias)
      Add an aliased directory resource.
      Parameters:
      path - the path.
      alias - the alias.
      Returns:
      the builder.
    • attribute

      public EmbeddedPiranhaBuilder attribute(String name, Object value)
      Add an attribute.
      Parameters:
      name - the name.
      value - the value.
      Returns:
      the builder.
    • build

      public EmbeddedPiranha build()
      Build the Piranha Embedded instance.
      Returns:
      the instance.
    • buildAndStart

      public EmbeddedPiranha buildAndStart()
      Build and starts the Piranha Embedded instance.
      Returns:
      the instance.
    • directoryResource

      public EmbeddedPiranhaBuilder directoryResource(String path)
      Add a directory resource.
      Parameters:
      path - the path.
      Returns:
      the builder.
    • extension

      public EmbeddedPiranhaBuilder extension(Class<? extends WebApplicationExtension> extensionClass)
      Set the web application extension.
      Parameters:
      extensionClass - the extension class.
      Returns:
      the builder.
    • extensions

      @SafeVarargs public final EmbeddedPiranhaBuilder extensions(Class<? extends WebApplicationExtension>... extensionClasses)
      Set the web application extensions.
      Parameters:
      extensionClasses - the extension classes.
      Returns:
      the builder.
    • feature

      public EmbeddedPiranhaBuilder feature(Class<?> featureClass)
      Add a feature.
      Parameters:
      featureClass - the feature class.
      Returns:
      the builder.
    • feature

      public EmbeddedPiranhaBuilder feature(String className)
      Add a feature.
      Parameters:
      className - the class name.
      Returns:
      the builder.
    • filter

      public EmbeddedPiranhaBuilder filter(String filterName, Class<?> filterClass)
      Add a filter.
      Parameters:
      filterName - the filter name.
      filterClass - the filter class.
      Returns:
      the builder.
    • filter

      public EmbeddedPiranhaBuilder filter(String filterName, String className)
      Add a filter.
      Parameters:
      filterName - the filter name.
      className - the class name.
      Returns:
      the builder.
    • filterInitParam

      public EmbeddedPiranhaBuilder filterInitParam(String filterName, String name, String value)
      Set a filter init parameter.
      Parameters:
      filterName - the filter name.
      name - the name.
      value - the value.
      Returns:
      the builder.
    • filterMapping

      public EmbeddedPiranhaBuilder filterMapping(String filterName, String... urlPatterns)
      Add a filter mapping.
      Parameters:
      filterName - the filter name.
      urlPatterns - the URL patterns.
      Returns:
      the builder.
    • httpSessionManager

      public EmbeddedPiranhaBuilder httpSessionManager(HttpSessionManager httpSessionManager)
      Set the HTTP session manager.
      Parameters:
      httpSessionManager - the HTTP session manager.
      Returns:
      the builder.
    • initializer

      public EmbeddedPiranhaBuilder initializer(Class<?> initializerClass)
      Add an initializer.
      Parameters:
      initializerClass - the class name.
      Returns:
      the builder.
    • initializer

      public EmbeddedPiranhaBuilder initializer(String className)
      Add an initializer.
      Parameters:
      className - the class name.
      Returns:
      the builder.
    • servlet

      public EmbeddedPiranhaBuilder servlet(String servletName, Class<?> servletClass)
      Add a servlet.
      Parameters:
      servletName - the servlet name.
      servletClass - the servlet class.
      Returns:
      the builder.
    • servlet

      public EmbeddedPiranhaBuilder servlet(String servletName, String className)
      Add a servlet.
      Parameters:
      servletName - the servlet name.
      className - the class name.
      Returns:
      the builder.
    • servlet

      public EmbeddedPiranhaBuilder servlet(String servletName, Class<?> servletClass, boolean asyncSupported)
      Add a servlet.
      Parameters:
      servletName - the servlet name.
      servletClass - the servlet class.
      asyncSupported - the async supported flag.
      Returns:
      the builder.
    • servlet

      public EmbeddedPiranhaBuilder servlet(String servletName, String className, boolean asyncSupported)
      Add a servlet.
      Parameters:
      servletName - the servlet name.
      className - the class name.
      asyncSupported - the async supported flag.
      Returns:
      the builder.
    • servletInitParam

      public EmbeddedPiranhaBuilder servletInitParam(String servletName, String name, String value)
      Set a servlet init parameter.
      Parameters:
      servletName - the servlet name.
      name - the name.
      value - the value.
      Returns:
      the builder.
    • servletMapping

      public EmbeddedPiranhaBuilder servletMapping(String servletName, String... urlPatterns)
      Add a servlet mapping.
      Parameters:
      servletName - the servlet name.
      urlPatterns - the URL patterns.
      Returns:
      the builder.
    • stringResource

      public EmbeddedPiranhaBuilder stringResource(String path, String value)
      Add a string resource.
      Parameters:
      path - the path.
      value - the string value added under the given path.
      Returns:
      the builder.