Class EmbeddedPiranhaBuilder


  • public class EmbeddedPiranhaBuilder
    extends Object
    The builder so you can easily build instances of EmbeddedPiranha.
    Author:
    Manfred Riem (mriem@manorrock.com)
    See Also:
    EmbeddedPiranha
    • Constructor Detail

      • EmbeddedPiranhaBuilder

        public EmbeddedPiranhaBuilder()
        Constructor.
    • Method Detail

      • 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.
      • feature

        public EmbeddedPiranhaBuilder feature​(String className)
        Add a feature.
        Parameters:
        className - the class name.
        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​(String className)
        Add an initializer.
        Parameters:
        className - the class name.
        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,
                                              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.