com.sun.jersey.api.container.grizzly2
Class GrizzlyServerFactory

java.lang.Object
  extended by com.sun.jersey.api.container.grizzly2.GrizzlyServerFactory

public final class GrizzlyServerFactory
extends Object

Factory for creating Grizzly 2 HttpServer instances.

Author:
Matt Swift

Field Summary
static String FEATURE_ALLOW_ENCODED_SLASH
          {@link ResourceConfig feature to enable encoded slashes in URIs.
 
Method Summary
static org.glassfish.grizzly.http.server.HttpServer createHttpServer(String u)
          Creates a new HttpServer which will manage all root resource and provider classes found by searching the classes referenced in the java classpath.
static org.glassfish.grizzly.http.server.HttpServer createHttpServer(String u, ResourceConfig rc)
          Creates a new HttpServer which will manage all root resource and provider classes declared by the resource configuration.
static org.glassfish.grizzly.http.server.HttpServer createHttpServer(String u, ResourceConfig rc, IoCComponentProviderFactory factory)
          Creates a new HttpServer which will manage all root resource and provider classes declared by the resource configuration.
static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI u)
          Creates a new HttpServer which will manage all root resource and provider classes found by searching the classes referenced in the java classpath.
static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI u, org.glassfish.grizzly.http.server.HttpHandler handler)
           
static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI u, org.glassfish.grizzly.http.server.HttpHandler handler, boolean secure)
           
static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI u, org.glassfish.grizzly.http.server.HttpHandler handler, boolean secure, org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator)
           
static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI u, ResourceConfig rc)
          Creates a new HttpServer which will manage all root resource and provider classes declared by the resource configuration.
static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI u, ResourceConfig rc, IoCComponentProviderFactory factory)
          Creates a new HttpServer which will manage all root resource and provider classes declared by the resource configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FEATURE_ALLOW_ENCODED_SLASH

public static final String FEATURE_ALLOW_ENCODED_SLASH
{@link ResourceConfig feature to enable encoded slashes in URIs. If set to false (the default behavior), requests containing encoded slashes will get rejected by Grizzly and will never make it to the Jersey runtime.

See Also:
Constant Field Values
Method Detail

createHttpServer

public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(String u)
                                                                     throws IOException,
                                                                            IllegalArgumentException,
                                                                            NullPointerException
Creates a new HttpServer which will manage all root resource and provider classes found by searching the classes referenced in the java classpath.

The returned implementation defers to the ContainerFactory.createContainer(Class) method for creation of the HttpServer.

Parameters:
u - The URI to create the HttpServer. 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.
Returns:
The new HttpServer which will manage all root resource and provider classes found by searching the classes referenced in the java classpath.
Throws:
IOException - If an error occurs while creating the container.
IllegalArgumentException - If u does not have the scheme "http" or if the path does not begin with a "/".
NullPointerException - If u was null.

createHttpServer

public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(String u,
                                                                            ResourceConfig rc)
                                                                     throws IOException,
                                                                            IllegalArgumentException,
                                                                            NullPointerException
Creates a new HttpServer which will manage all root resource and provider classes declared by the resource configuration.

The returned implementation defers to the ContainerFactory.createContainer(Class, ResourceConfig) method for creation of the HttpServer.

Parameters:
u - The URI to create the HttpServer. 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.
rc - The resource configuration.
Returns:
The new HttpServer which will manage all root resource and provider classes found by searching the classes referenced in the java classpath.
Throws:
IOException - If an error occurs while creating the container.
IllegalArgumentException - If u does not have the scheme "http" or if the path does not begin with a "/".
NullPointerException - If u was null.

createHttpServer

public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(String u,
                                                                            ResourceConfig rc,
                                                                            IoCComponentProviderFactory factory)
                                                                     throws IOException,
                                                                            IllegalArgumentException,
                                                                            NullPointerException
Creates a new HttpServer which will manage all root resource and provider classes declared by the resource configuration.

The returned implementation defers to the ContainerFactory.createContainer(Class, ResourceConfig, IoCComponentProviderFactory) method for creation of the HttpServer.

Parameters:
u - The URI to create the HttpServer. 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.
rc - The resource configuration.
factory - The IoC component provider factory the web application delegates to for obtaining instances of resource and provider classes. May be null if the web application is responsible for instantiating resource and provider classes.
Returns:
The new HttpServer which will manage all root resource and provider classes found by searching the classes referenced in the java classpath.
Throws:
IOException - If an error occurs while creating the container.
IllegalArgumentException - If u does not have the scheme "http" or if the path does not begin with a "/".
NullPointerException - If u was null.

createHttpServer

public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI u)
                                                                     throws IOException,
                                                                            IllegalArgumentException,
                                                                            NullPointerException
Creates a new HttpServer which will manage all root resource and provider classes found by searching the classes referenced in the java classpath.

The returned implementation defers to the ContainerFactory.createContainer(Class) method for creation of the HttpServer.

Parameters:
u - The URI to create the HttpServer. 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.
Returns:
The new HttpServer which will manage all root resource and provider classes found by searching the classes referenced in the java classpath.
Throws:
IOException - If an error occurs while creating the container.
IllegalArgumentException - If u does not have the scheme "http" or if the path does not begin with a "/".
NullPointerException - If u was null.

createHttpServer

public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI u,
                                                                            ResourceConfig rc)
                                                                     throws IOException,
                                                                            IllegalArgumentException,
                                                                            NullPointerException
Creates a new HttpServer which will manage all root resource and provider classes declared by the resource configuration.

The returned implementation defers to the ContainerFactory.createContainer(Class, ResourceConfig) method for creation of the HttpServer.

Parameters:
u - The URI to create the HttpServer. 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.
rc - The resource configuration.
Returns:
The new HttpServer which will manage all root resource and provider classes found by searching the classes referenced in the java classpath.
Throws:
IOException - If an error occurs while creating the container.
IllegalArgumentException - If u does not have the scheme "http" or if the path does not begin with a "/".
NullPointerException - If u was null.

createHttpServer

public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI u,
                                                                            ResourceConfig rc,
                                                                            IoCComponentProviderFactory factory)
                                                                     throws IOException,
                                                                            IllegalArgumentException,
                                                                            NullPointerException
Creates a new HttpServer which will manage all root resource and provider classes declared by the resource configuration.

The returned implementation defers to the ContainerFactory.createContainer(Class, ResourceConfig, IoCComponentProviderFactory) method for creation of the HttpServer.

Parameters:
u - The URI to create the HttpServer. 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.
rc - The resource configuration.
factory - The IoC component provider factory the web application delegates to for obtaining instances of resource and provider classes. May be null if the web application is responsible for instantiating resource and provider classes.
Returns:
The new HttpServer which will manage all root resource and provider classes found by searching the classes referenced in the java classpath.
Throws:
IOException - If an error occurs while creating the container.
IllegalArgumentException - If u does not have the scheme "http" or if the path does not begin with a "/".
NullPointerException - If u was null.

createHttpServer

public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI u,
                                                                            org.glassfish.grizzly.http.server.HttpHandler handler,
                                                                            boolean secure,
                                                                            org.glassfish.grizzly.ssl.SSLEngineConfigurator sslEngineConfigurator)
                                                                     throws IOException,
                                                                            IllegalArgumentException,
                                                                            NullPointerException
Throws:
IOException
IllegalArgumentException
NullPointerException

createHttpServer

public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI u,
                                                                            org.glassfish.grizzly.http.server.HttpHandler handler,
                                                                            boolean secure)
                                                                     throws IOException,
                                                                            IllegalArgumentException,
                                                                            NullPointerException
Throws:
IOException
IllegalArgumentException
NullPointerException

createHttpServer

public static org.glassfish.grizzly.http.server.HttpServer createHttpServer(URI u,
                                                                            org.glassfish.grizzly.http.server.HttpHandler handler)
                                                                     throws IOException,
                                                                            IllegalArgumentException,
                                                                            NullPointerException
Throws:
IOException
IllegalArgumentException
NullPointerException


Copyright © 2015 Oracle Corporation. All Rights Reserved.