java.lang.Object
cloud.piranha.embedded.EmbeddedPiranhaBuilder
The builder so you can easily build instances of
EmbeddedPiranha
.- Author:
- Manfred Riem ([email protected])
- See Also:
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionaliasedDirectoryResource
(String path, String alias) Add an aliased directory resource.Add an attribute.build()
Build the Piranha Embedded instance.Build and starts the Piranha Embedded instance.classLoader
(ClassLoader classLoader) Set the class loader.directoryResource
(String path) Add a directory resource.extension
(Class<? extends WebApplicationExtension> extensionClass) Set the web application extension.final EmbeddedPiranhaBuilder
extensions
(Class<? extends WebApplicationExtension>... extensionClasses) Set the web application extensions.Add a filter.Add a filter.filterInitParam
(String filterName, String name, String value) Set a filter init parameter.filterMapping
(String filterName, String... urlPatterns) Add a filter mapping.httpSessionManager
(HttpSessionManager httpSessionManager) Set the HTTP session manager.initializer
(Class<?> initializerClass) Add an initializer.initializer
(String className) Add an initializer.initializers
(Class<?>... initializerClasses) Add initializers.Add a listeners.Add a servletAdd a servlet.Add a servlet.Add a servlet.servletInitParam
(String servletName, String name, String value) Set a servlet init parameter.servletMapped
(Class<?> servletClass, boolean asyncSupported, String... urlPatterns) Add a servlet and a servlet mapping.servletMapped
(Class<?> servletClass, String... urlPatterns) Add a servlet and a servlet mapping.servletMapping
(String servletName, String... urlPatterns) Add a servlet mapping.servletsMapped
(Class<?> servletClass1, String urlPattern1) Add servlets and their servlet mapping.servletsMapped
(Class<?> servletClass1, String urlPattern1, Class<?> servletClass2, String urlPattern2) Add servlets and their servlet mapping.servletsMapped
(Class<?> servletClass1, String urlPattern1, Class<?> servletClass2, String urlPattern2, Class<?> servletClass3, String urlPattern3) Add servlets and their servlet mapping.servletsMapped
(Class<?> servletClass1, String urlPattern1, Class<?> servletClass2, String urlPattern2, Class<?> servletClass3, String urlPattern3, Class<?> servletClass4, String urlPattern4) Add servlets and their servlet mapping.servletsMapped
(Class<?> servletClass1, String urlPattern1, Class<?> servletClass2, String urlPattern2, Class<?> servletClass3, String urlPattern3, Class<?> servletClass4, String urlPattern4, Class<?> servletClass5, String urlPattern5) Add servlets and their servlet mapping.stringResource
(String path, String value) Add a string resource.webApplication
(WebApplication webApplication) Set the web application.
-
Constructor Details
-
EmbeddedPiranhaBuilder
public EmbeddedPiranhaBuilder()Constructor.
-
-
Method Details
-
aliasedDirectoryResource
Add an aliased directory resource.- Parameters:
path
- the path.alias
- the alias.- Returns:
- the builder.
-
attribute
Add an attribute.- Parameters:
name
- the name.value
- the value.- Returns:
- the builder.
-
build
Build the Piranha Embedded instance.- Returns:
- the instance.
-
buildAndStart
Build and starts the Piranha Embedded instance.- Returns:
- the instance.
-
classLoader
Set the class loader.- Parameters:
classLoader
- the class loader.- Returns:
- the builder.
-
directoryResource
Add a directory resource.- Parameters:
path
- the path.- Returns:
- the builder.
-
extension
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.
-
filter
Add a filter.- Parameters:
filterName
- the filter name.filterClass
- the filter class.- Returns:
- the builder.
-
filter
Add a filter.- Parameters:
filterName
- the filter name.className
- the class name.- Returns:
- the builder.
-
filterInitParam
Set a filter init parameter.- Parameters:
filterName
- the filter name.name
- the name.value
- the value.- Returns:
- the builder.
-
filterMapping
Add a filter mapping.- Parameters:
filterName
- the filter name.urlPatterns
- the URL patterns.- Returns:
- the builder.
-
httpSessionManager
Set the HTTP session manager.- Parameters:
httpSessionManager
- the HTTP session manager.- Returns:
- the builder.
-
initializer
Add an initializer.- Parameters:
initializerClass
- the class name.- Returns:
- the builder.
-
initializer
Add an initializer.- Parameters:
className
- the class name.- Returns:
- the builder.
-
initializers
Add initializers.- Parameters:
initializerClasses
- the classes- Returns:
- the builder.
-
listener
Add a listeners.- Parameters:
className
- the class name.- Returns:
- the builder.
-
servlet
Add a servlet- Parameters:
servletName
- the servlet name.servletClass
- the servlet class.- Returns:
- the builder.
-
servlet
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
Add a servlet.- Parameters:
servletName
- the servlet name.className
- the class name.asyncSupported
- the async supported flag.- Returns:
- the builder.
-
servletInitParam
Set a servlet init parameter.- Parameters:
servletName
- the servlet name.name
- the name.value
- the value.- Returns:
- the builder.
-
servletMapped
Add a servlet and a servlet mapping.- Parameters:
servletClass
- the servlet class.urlPatterns
- the URL patterns- Returns:
- the builder.
-
servletMapped
public EmbeddedPiranhaBuilder servletMapped(Class<?> servletClass, boolean asyncSupported, String... urlPatterns) Add a servlet and a servlet mapping.- Parameters:
servletClass
- the servlet class.asyncSupported
- the async supported flag.urlPatterns
- the URL patterns- Returns:
- the builder.
-
servletMapping
Add a servlet mapping.- Parameters:
servletName
- the servlet name.urlPatterns
- the URL patterns.- Returns:
- the builder.
-
servletsMapped
Add servlets and their servlet mapping.- Parameters:
servletClass1
- the first servlet class.urlPattern1
- the first URL pattern.- Returns:
- the builder.
-
servletsMapped
public EmbeddedPiranhaBuilder servletsMapped(Class<?> servletClass1, String urlPattern1, Class<?> servletClass2, String urlPattern2) Add servlets and their servlet mapping.- Parameters:
servletClass1
- the first servlet class.urlPattern1
- the first URL pattern.servletClass2
- the second servlet class.urlPattern2
- the second URL pattern.- Returns:
- the builder.
-
servletsMapped
public EmbeddedPiranhaBuilder servletsMapped(Class<?> servletClass1, String urlPattern1, Class<?> servletClass2, String urlPattern2, Class<?> servletClass3, String urlPattern3) Add servlets and their servlet mapping.- Parameters:
servletClass1
- the first servlet class.urlPattern1
- the first URL pattern.servletClass2
- the second servlet class.urlPattern2
- the second URL pattern.servletClass3
- the third servlet class.urlPattern3
- the third URL pattern.- Returns:
- the builder.
-
servletsMapped
public EmbeddedPiranhaBuilder servletsMapped(Class<?> servletClass1, String urlPattern1, Class<?> servletClass2, String urlPattern2, Class<?> servletClass3, String urlPattern3, Class<?> servletClass4, String urlPattern4) Add servlets and their servlet mapping.- Parameters:
servletClass1
- the first servlet class.urlPattern1
- the first URL pattern.servletClass2
- the second servlet class.urlPattern2
- the second URL pattern.servletClass3
- the third servlet class.urlPattern3
- the third URL pattern.servletClass4
- the fourth servlet class.urlPattern4
- the fourth URL pattern.- Returns:
- the builder.
-
servletsMapped
public EmbeddedPiranhaBuilder servletsMapped(Class<?> servletClass1, String urlPattern1, Class<?> servletClass2, String urlPattern2, Class<?> servletClass3, String urlPattern3, Class<?> servletClass4, String urlPattern4, Class<?> servletClass5, String urlPattern5) Add servlets and their servlet mapping.- Parameters:
servletClass1
- the first servlet class.urlPattern1
- the first URL pattern.servletClass2
- the second servlet class.urlPattern2
- the second URL pattern.servletClass3
- the third servlet class.urlPattern3
- the third URL pattern.servletClass4
- the fourth servlet class.urlPattern4
- the fourth URL pattern.servletClass5
- the fifth servlet class.urlPattern5
- the fifth URL pattern.- Returns:
- the builder.
-
stringResource
Add a string resource.- Parameters:
path
- the path.value
- the string value added under the given path.- Returns:
- the builder.
-
webApplication
Set the web application.- Parameters:
webApplication
- the web application.- Returns:
- the builder.
-