Class GrizzlyWebContainerFactory
- java.lang.Object
-
- org.glassfish.jersey.grizzly2.servlet.GrizzlyWebContainerFactory
-
public final class GrizzlyWebContainerFactory extends Object
Factory for creating and starting Grizzly 2HttpServerinstances for deploying aServlet. The default deployed server is an instance ofServletContainer. If no initialization parameters are declared (or is null) then root resource and provider classes will be found by searching the classes referenced in the java classpath.- Author:
- Paul Sandoz, Pavel Bucek
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static org.glassfish.grizzly.http.server.HttpServercreate(String u)Create aHttpServerthat registers theServletContainer.static org.glassfish.grizzly.http.server.HttpServercreate(String u, Class<? extends jakarta.servlet.Servlet> c)Create aHttpServerthat registers the declared servlet class.static org.glassfish.grizzly.http.server.HttpServercreate(String u, Class<? extends jakarta.servlet.Servlet> c, Map<String,String> initParams)Create aHttpServerthat registers the declared servlet class.static org.glassfish.grizzly.http.server.HttpServercreate(String u, Map<String,String> initParams)Create aHttpServerthat registers theServletContainer.static org.glassfish.grizzly.http.server.HttpServercreate(URI u)Create aHttpServerthat registers theServletContainer.static org.glassfish.grizzly.http.server.HttpServercreate(URI u, jakarta.servlet.Servlet servlet, Map<String,String> initParams, Map<String,String> contextInitParams)Create aHttpServerthat registers the declared servlet instance.static org.glassfish.grizzly.http.server.HttpServercreate(URI u, Class<? extends jakarta.servlet.Servlet> c)Create aHttpServerthat registers the declared servlet class.static org.glassfish.grizzly.http.server.HttpServercreate(URI u, Class<? extends jakarta.servlet.Servlet> c, Map<String,String> initParams)Create aHttpServerthat registers the declared servlet class.static org.glassfish.grizzly.http.server.HttpServercreate(URI u, Map<String,String> initParams)Create aHttpServerthat registers theServletContainer.
-
-
-
Method Detail
-
create
public static org.glassfish.grizzly.http.server.HttpServer create(String u) throws IOException, IllegalArgumentException
Create aHttpServerthat registers theServletContainer.- Parameters:
u- the URI to create the http server. The URI scheme must be equal to "http". The URI user information and host are ignored If the URI port is not present then port 80 will be used. The URI query and fragment components are ignored. Only first path segment will be used as context path, the rest will be ignored.- Returns:
- the http server, with the endpoint started.
- Throws:
IOException- if an error occurs creating the container.IllegalArgumentException- ifuisnull.
-
create
public static org.glassfish.grizzly.http.server.HttpServer create(String u, Map<String,String> initParams) throws IOException, IllegalArgumentException
Create aHttpServerthat registers theServletContainer.- Parameters:
u- the URI to create the http server. The URI scheme must be equal to "http". The URI user information and host are ignored If the URI port is not present then port 80 will be used. The URI query and fragment components are ignored. Only first path segment will be used as context path, the rest will be ignored.initParams- the servlet initialization parameters.- Returns:
- the http server, with the endpoint started.
- Throws:
IOException- if an error occurs creating the container.IllegalArgumentException- ifuisnull.
-
create
public static org.glassfish.grizzly.http.server.HttpServer create(URI u) throws IOException, IllegalArgumentException
Create aHttpServerthat registers theServletContainer.- Parameters:
u- the URI to create the http server. The URI scheme must be equal to "http". The URI user information and host are ignored If the URI port is not present then port 80 will be used. The URI query and fragment components are ignored. Only first path segment will be used as context path, the rest will be ignored.- Returns:
- the http server, with the endpoint started.
- Throws:
IOException- if an error occurs creating the container.IllegalArgumentException- ifuisnull.
-
create
public static org.glassfish.grizzly.http.server.HttpServer create(URI u, Map<String,String> initParams) throws IOException
Create aHttpServerthat registers theServletContainer.- Parameters:
u- the URI to create the http server. The URI scheme must be equal to "http". The URI user information and host are ignored If the URI port is not present then port 80 will be used. The URI query and fragment components are ignored. Only first path segment will be used as context path, the rest will be ignored.initParams- the servlet initialization parameters.- Returns:
- the http server, with the endpoint started.
- Throws:
IOException- if an error occurs creating the container.IllegalArgumentException- ifuisnull.
-
create
public static org.glassfish.grizzly.http.server.HttpServer create(String u, Class<? extends jakarta.servlet.Servlet> c) throws IOException
Create aHttpServerthat registers the declared servlet class.- Parameters:
u- the URI to create the http server. The URI scheme must be equal to "http". The URI user information and host are ignored If the URI port is not present then port 80 will be used. The URI query and fragment components are ignored. Only first path segment will be used as context path, the rest will be ignored.c- the servlet class.- Returns:
- the http server, with the endpoint started.
- Throws:
IOException- if an error occurs creating the container.IllegalArgumentException- ifuisnull.
-
create
public static org.glassfish.grizzly.http.server.HttpServer create(String u, Class<? extends jakarta.servlet.Servlet> c, Map<String,String> initParams) throws IOException
Create aHttpServerthat registers the declared servlet class.- Parameters:
u- the URI to create the http server. The URI scheme must be equal to "http". The URI user information and host are ignored If the URI port is not present then port 80 will be used. The URI query and fragment components are ignored. Only first path segment will be used as context path, the rest will be ignored.c- the servlet class.initParams- the servlet initialization parameters.- Returns:
- the http server, with the endpoint started.
- Throws:
IOException- if an error occurs creating the container.IllegalArgumentException- ifuisnull.
-
create
public static org.glassfish.grizzly.http.server.HttpServer create(URI u, Class<? extends jakarta.servlet.Servlet> c) throws IOException
Create aHttpServerthat registers the declared servlet class.- Parameters:
u- the URI to create the http server. The URI scheme must be equal to "http". The URI user information and host are ignored If the URI port is not present then port 80 will be used. The URI query and fragment components are ignored. Only first path segment will be used as context path, the rest will be ignored.c- the servlet class- Returns:
- the http server, with the endpoint started.
- Throws:
IOException- if an error occurs creating the container.IllegalArgumentException- ifuisnull.
-
create
public static org.glassfish.grizzly.http.server.HttpServer create(URI u, Class<? extends jakarta.servlet.Servlet> c, Map<String,String> initParams) throws IOException
Create aHttpServerthat registers the declared servlet class.- Parameters:
u- the URI to create the http server. The URI scheme must be equal to "http". The URI user information and host are ignored If the URI port is not present then port 80 will be used. The URI query and fragment components are ignored. Only first path segment will be used as context path, the rest will be ignored.c- the servlet classinitParams- the servlet initialization parameters.- Returns:
- the http server, with the endpoint started.
- Throws:
IOException- if an error occurs creating the container.IllegalArgumentException- ifuisnull.
-
create
public static org.glassfish.grizzly.http.server.HttpServer create(URI u, jakarta.servlet.Servlet servlet, Map<String,String> initParams, Map<String,String> contextInitParams) throws IOException
Create aHttpServerthat registers the declared servlet instance.- Parameters:
u- the URI to create the http server. The URI scheme must be equal to "http". The URI user information and host are ignored If the URI port is not present then port 80 will be used. The URI query and fragment components are ignored. Only first path segment will be used as context path, the rest will be ignored.servlet- the servlet instance.initParams- the servlet initialization parameters.contextInitParams- the servlet context initialization parameters.- Returns:
- the http server, with the endpoint started.
- Throws:
IOException- if an error occurs creating the container.IllegalArgumentException- ifuisnull.
-
-