com.sun.jersey.simple.container
Class SimpleServerFactory

java.lang.Object
  extended by com.sun.jersey.simple.container.SimpleServerFactory

public final class SimpleServerFactory
extends java.lang.Object

Factory for creating and starting Simple server containers. This returns a handle to the started server as Closeable instances, which allows the server to be stopped by invoking the Closeable.close() method.

To start the server in HTTPS mode an SSLContext can be provided. This will be used to decrypt and encrypt information sent over the connected TCP socket channel.

Author:
Paul.Sandoz@Sun.Com

Method Summary
static java.io.Closeable create(java.lang.String address)
          Create a Closeable that registers an Container that in turn manages all root resource and provder classes found by searching the classes referenced in the java classpath.
static java.io.Closeable create(java.lang.String address, org.simpleframework.http.core.Container container)
          Create a Closeable that registers an Container that in turn manages all root resource and provder classes found by searching the classes referenced in the java classpath.
static java.io.Closeable create(java.lang.String address, ResourceConfig config)
          Create a Closeable that registers an Container that in turn manages all root resource and provder classes declared by the resource configuration.
static java.io.Closeable create(java.lang.String address, ResourceConfig config, IoCComponentProviderFactory factory)
          Create a Closeable that registers an Container that in turn manages all root resource and provder classes declared by the resource configuration.
static java.io.Closeable create(java.lang.String address, javax.net.ssl.SSLContext context)
          Create a Closeable that registers an Container that in turn manages all root resource and provder classes found by searching the classes referenced in the java classpath.
static java.io.Closeable create(java.lang.String address, javax.net.ssl.SSLContext context, org.simpleframework.http.core.Container container)
          Create a Closeable that registers an Container that in turn manages all root resource and provder classes found by searching the classes referenced in the java classpath.
static java.io.Closeable create(java.lang.String address, javax.net.ssl.SSLContext context, ResourceConfig config)
          Create a Closeable that registers an Container that in turn manages all root resource and provder classes declared by the resource configuration.
static java.io.Closeable create(java.lang.String address, javax.net.ssl.SSLContext context, ResourceConfig config, IoCComponentProviderFactory factory)
          Create a Closeable that registers an Container that in turn manages all root resource and provder classes declared by the resource configuration.
static java.io.Closeable create(java.net.URI address)
          Create a Closeable that registers an Container that in turn manages all root resource and provder classes found by searching the classes referenced in the java classpath.
static java.io.Closeable create(java.net.URI address, org.simpleframework.http.core.Container container)
          Create a Closeable that registers an Container that in turn manages all root resource and provder classes found by searching the classes referenced in the java classpath.
static java.io.Closeable create(java.net.URI address, ResourceConfig config)
          Create a Closeable that registers an Container that in turn manages all root resource and provder classes declared by the resource configuration.
static java.io.Closeable create(java.net.URI address, ResourceConfig config, IoCComponentProviderFactory factory)
          Create a Closeable that registers an Container that in turn manages all root resource and provder classes declared by the resource configuration.
static java.io.Closeable create(java.net.URI address, javax.net.ssl.SSLContext context)
          Create a Closeable that registers an Container that in turn manages all root resource and provder classes found by searching the classes referenced in the java classpath.
static java.io.Closeable create(java.net.URI address, javax.net.ssl.SSLContext context, org.simpleframework.http.core.Container container)
          Create a Closeable that registers an Container that in turn manages all root resource and provder classes found by searching the classes referenced in the java classpath.
static java.io.Closeable create(java.net.URI address, javax.net.ssl.SSLContext context, ResourceConfig config)
          Create a Closeable that registers an Container that in turn manages all root resource and provder classes declared by the resource configuration.
static java.io.Closeable create(java.net.URI address, javax.net.ssl.SSLContext context, ResourceConfig config, IoCComponentProviderFactory factory)
          Create a Closeable that registers an Container that in turn manages all root resource and provder classes declared by the resource configuration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

create

public static java.io.Closeable create(java.lang.String address)
                                throws java.io.IOException,
                                       java.lang.IllegalArgumentException
Create a Closeable that registers an Container that in turn manages all root resource and provder classes found by searching the classes referenced in the java classpath.

This implementation defers to the ContainerFactory.createContainer(Class) method for creating an Container that manages the root resources.

Parameters:
address - 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 path, query and fragment components are ignored.
Returns:
the closeable connection, with the endpoint started
Throws:
java.io.IOException - if an error occurs creating the container.
java.lang.IllegalArgumentException - if address is null

create

public static java.io.Closeable create(java.lang.String address,
                                       javax.net.ssl.SSLContext context)
                                throws java.io.IOException,
                                       java.lang.IllegalArgumentException
Create a Closeable that registers an Container that in turn manages all root resource and provder classes found by searching the classes referenced in the java classpath.

This implementation defers to the ContainerFactory.createContainer(Class) method for creating an Container that manages the root resources.

Parameters:
address - the URI to create the http server. The URI scheme must be equal to "https". The URI user information and host are ignored If the URI port is not present then port 143 will be used. The URI path, query and fragment components are ignored.
context - this is the SSL context used for SSL connections
Returns:
the closeable connection, with the endpoint started
Throws:
java.io.IOException - if an error occurs creating the container.
java.lang.IllegalArgumentException - if address is null

create

public static java.io.Closeable create(java.net.URI address)
                                throws java.io.IOException,
                                       java.lang.IllegalArgumentException
Create a Closeable that registers an Container that in turn manages all root resource and provder classes found by searching the classes referenced in the java classpath.

This implementation defers to the ContainerFactory.createContainer(Class) method for creating an Container that manages the root resources.

Parameters:
address - 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 path, query and fragment components are ignored.
Returns:
the closeable connection, with the endpoint started
Throws:
java.io.IOException - if an error occurs creating the container.
java.lang.IllegalArgumentException - if address is null

create

public static java.io.Closeable create(java.net.URI address,
                                       javax.net.ssl.SSLContext context)
                                throws java.io.IOException,
                                       java.lang.IllegalArgumentException
Create a Closeable that registers an Container that in turn manages all root resource and provder classes found by searching the classes referenced in the java classpath.

This implementation defers to the ContainerFactory.createContainer(Class) method for creating an Container that manages the root resources.

Parameters:
address - the URI to create the http server. The URI scheme must be equal to "https". The URI user information and host are ignored If the URI port is not present then port 143 will be used. The URI path, query and fragment components are ignored.
context - this is the SSL context used for SSL connections
Returns:
the closeable connection, with the endpoint started
Throws:
java.io.IOException - if an error occurs creating the container.
java.lang.IllegalArgumentException - if address is null

create

public static java.io.Closeable create(java.lang.String address,
                                       ResourceConfig config)
                                throws java.io.IOException,
                                       java.lang.IllegalArgumentException
Create a Closeable that registers an Container that in turn manages all root resource and provder classes declared by the resource configuration.

This implementation defers to the ContainerFactory.createContainer(Class, ResourceConfig) method for creating an Container that manages the root resources.

Parameters:
address - 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 path, query and fragment components are ignored.
config - the resource configuration.
Returns:
the closeable connection, with the endpoint started
Throws:
java.io.IOException - if an error occurs creating the container.
java.lang.IllegalArgumentException - if address is null

create

public static java.io.Closeable create(java.lang.String address,
                                       javax.net.ssl.SSLContext context,
                                       ResourceConfig config)
                                throws java.io.IOException,
                                       java.lang.IllegalArgumentException
Create a Closeable that registers an Container that in turn manages all root resource and provder classes declared by the resource configuration.

This implementation defers to the ContainerFactory.createContainer(Class, ResourceConfig) method for creating an Container that manages the root resources.

Parameters:
address - the URI to create the http server. The URI scheme must be equal to "https". The URI user information and host are ignored If the URI port is not present then port 143 will be used. The URI path, query and fragment components are ignored.
context - this is the SSL context used for SSL connections
Returns:
the closeable connection, with the endpoint started
Throws:
java.io.IOException - if an error occurs creating the container.
java.lang.IllegalArgumentException - if address is null

create

public static java.io.Closeable create(java.net.URI address,
                                       ResourceConfig config)
                                throws java.io.IOException,
                                       java.lang.IllegalArgumentException
Create a Closeable that registers an Container that in turn manages all root resource and provder classes declared by the resource configuration.

This implementation defers to the ContainerFactory.createContainer(Class, ResourceConfig) method for creating an Container that manages the root resources.

Parameters:
address - 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 path, query and fragment components are ignored.
config - the resource configuration.
Returns:
the closeable connection, with the endpoint started
Throws:
java.io.IOException - if an error occurs creating the container.
java.lang.IllegalArgumentException - if address is null

create

public static java.io.Closeable create(java.net.URI address,
                                       javax.net.ssl.SSLContext context,
                                       ResourceConfig config)
                                throws java.io.IOException,
                                       java.lang.IllegalArgumentException
Create a Closeable that registers an Container that in turn manages all root resource and provder classes declared by the resource configuration.

This implementation defers to the ContainerFactory.createContainer(Class, ResourceConfig) method for creating an Container that manages the root resources.

Parameters:
address - the URI to create the http server. The URI scheme must be equal to "https". The URI user information and host are ignored If the URI port is not present then port 143 will be used. The URI path, query and fragment components are ignored.
context - this is the SSL context used for SSL connections
config - the resource configuration.
Returns:
the closeable connection, with the endpoint started
Throws:
java.io.IOException - if an error occurs creating the container.
java.lang.IllegalArgumentException - if address is null

create

public static java.io.Closeable create(java.lang.String address,
                                       ResourceConfig config,
                                       IoCComponentProviderFactory factory)
                                throws java.io.IOException,
                                       java.lang.IllegalArgumentException
Create a Closeable that registers an Container that in turn manages all root resource and provder classes declared by the resource configuration.

This implementation defers to the ContainerFactory.createContainer(Class, ResourceConfig, IoCComponentProviderFactory) method for creating an Container that manages the root resources.

Parameters:
address - 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 path, query and fragment components are ignored.
config - 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 closeable connection, with the endpoint started
Throws:
java.io.IOException - if an error occurs creating the container.
java.lang.IllegalArgumentException - if address is null

create

public static java.io.Closeable create(java.lang.String address,
                                       javax.net.ssl.SSLContext context,
                                       ResourceConfig config,
                                       IoCComponentProviderFactory factory)
                                throws java.io.IOException,
                                       java.lang.IllegalArgumentException
Create a Closeable that registers an Container that in turn manages all root resource and provder classes declared by the resource configuration.

This implementation defers to the ContainerFactory.createContainer(Class, ResourceConfig, IoCComponentProviderFactory) method for creating an Container that manages the root resources.

Parameters:
address - the URI to create the http server. The URI scheme must be equal to "https". The URI user information and host are ignored If the URI port is not present then port 143 will be used. The URI path, query and fragment components are ignored.
context - this is the SSL context used for SSL connections
config - 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 closeable connection, with the endpoint started
Throws:
java.io.IOException - if an error occurs creating the container.
java.lang.IllegalArgumentException - if address is null

create

public static java.io.Closeable create(java.net.URI address,
                                       ResourceConfig config,
                                       IoCComponentProviderFactory factory)
                                throws java.io.IOException,
                                       java.lang.IllegalArgumentException
Create a Closeable that registers an Container that in turn manages all root resource and provder classes declared by the resource configuration.

This implementation defers to the ContainerFactory.createContainer(Class, ResourceConfig, IoCComponentProviderFactory) method for creating an Container that manages the root resources.

Parameters:
address - 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 path, query and fragment components are ignored.
config - 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 closeable connection, with the endpoint started
Throws:
java.io.IOException - if an error occurs creating the container.
java.lang.IllegalArgumentException - if address is null

create

public static java.io.Closeable create(java.net.URI address,
                                       javax.net.ssl.SSLContext context,
                                       ResourceConfig config,
                                       IoCComponentProviderFactory factory)
                                throws java.io.IOException,
                                       java.lang.IllegalArgumentException
Create a Closeable that registers an Container that in turn manages all root resource and provder classes declared by the resource configuration.

This implementation defers to the ContainerFactory.createContainer(Class, ResourceConfig, IoCComponentProviderFactory) method for creating an Container that manages the root resources.

Parameters:
address - the URI to create the http server. The URI scheme must be equal to "https". The URI user information and host are ignored If the URI port is not present then port 143 will be used. The URI path, query and fragment components are ignored.
context - this is the SSL context used for SSL connections
config - 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 closeable connection, with the endpoint started
Throws:
java.io.IOException - if an error occurs creating the container.
java.lang.IllegalArgumentException - if address is null

create

public static java.io.Closeable create(java.lang.String address,
                                       org.simpleframework.http.core.Container container)
                                throws java.io.IOException,
                                       java.lang.IllegalArgumentException
Create a Closeable that registers an Container that in turn manages all root resource and provder classes found by searching the classes referenced in the java classpath.

Parameters:
address - 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 path, query and fragment components are ignored.
container - the container that handles all HTTP requests
Returns:
the closeable connection, with the endpoint started
Throws:
java.io.IOException - if an error occurs creating the container.
java.lang.IllegalArgumentException - if address is null

create

public static java.io.Closeable create(java.lang.String address,
                                       javax.net.ssl.SSLContext context,
                                       org.simpleframework.http.core.Container container)
                                throws java.io.IOException,
                                       java.lang.IllegalArgumentException
Create a Closeable that registers an Container that in turn manages all root resource and provder classes found by searching the classes referenced in the java classpath.

Parameters:
address - the URI to create the http server. The URI scheme must be equal to "https". The URI user information and host are ignored If the URI port is not present then port 143 will be used. The URI path, query and fragment components are ignored.
context - this is the SSL context used for SSL connections
container - the container that handles all HTTP requests
Returns:
the closeable connection, with the endpoint started
Throws:
java.io.IOException - if an error occurs creating the container.
java.lang.IllegalArgumentException - if address is null

create

public static java.io.Closeable create(java.net.URI address,
                                       org.simpleframework.http.core.Container container)
                                throws java.io.IOException,
                                       java.lang.IllegalArgumentException
Create a Closeable that registers an Container that in turn manages all root resource and provder classes found by searching the classes referenced in the java classpath.

Parameters:
address - 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 path, query and fragment components are ignored.
container - the container that handles all HTTP requests
Returns:
the closeable connection, with the endpoint started
Throws:
java.io.IOException - if an error occurs creating the container.
java.lang.IllegalArgumentException - if address is null

create

public static java.io.Closeable create(java.net.URI address,
                                       javax.net.ssl.SSLContext context,
                                       org.simpleframework.http.core.Container container)
                                throws java.io.IOException,
                                       java.lang.IllegalArgumentException
Create a Closeable that registers an Container that in turn manages all root resource and provder classes found by searching the classes referenced in the java classpath.

Parameters:
address - the URI to create the http server. The URI scheme must be equal to "https". The URI user information and host are ignored If the URI port is not present then port 143 will be used. The URI path, query and fragment components are ignored.
context - this is the SSL context used for SSL connections
container - the container that handles all HTTP requests
Returns:
the closeable connection, with the endpoint started
Throws:
java.io.IOException - if an error occurs creating the container.
java.lang.IllegalArgumentException - if address is null


Copyright © 2011 Sun Microsystems, Inc. All Rights Reserved.