public final class ContainerFactory
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
static <A> A |
createContainer(java.lang.Class<A> type)
Create an instance of a container according to the class requested.
|
static <A> A |
createContainer(java.lang.Class<A> type,
java.lang.Class<?>... resourceClasses)
Create a container according to the class requested.
|
static <A> A |
createContainer(java.lang.Class<A> type,
ResourceConfig resourceConfig)
Create a container according to the class requested.
|
static <A> A |
createContainer(java.lang.Class<A> type,
ResourceConfig resourceConfig,
IoCComponentProviderFactory factory)
Create a container according to the class requested.
|
static <A> A |
createContainer(java.lang.Class<A> type,
java.util.Set<java.lang.Class<?>> resourceClasses)
Create a container according to the class requested.
|
static <A> A |
createContainer(java.lang.Class<A> type,
java.lang.String... paths)
Create an instance of a container according to the class requested.
|
static <A> A |
createContainer(java.lang.Class<A> type,
java.lang.String packageName)
Deprecated.
|
public static <A> A createContainer(java.lang.Class<A> type, java.lang.Class<?>... resourceClasses) throws ContainerException, java.lang.IllegalArgumentException
The list of service-provider supporting the ContainerProvider
service-provider will be iterated over until one returns a non-null
container instance.
A
- the type of the container.type
- the type of the container.resourceClasses
- the list of Web resources to be managed by the
Web application.ContainerException
- if there is an error creating the container.java.lang.IllegalArgumentException
- if no container provider supports the type.public static <A> A createContainer(java.lang.Class<A> type, java.util.Set<java.lang.Class<?>> resourceClasses) throws ContainerException, java.lang.IllegalArgumentException
The list of service-provider supporting the ContainerProvider
service-provider will be iterated over until one returns a non-null
container instance.
A
- the type of the container.type
- the type of the container.resourceClasses
- the set of Web resources to be managed by the
Web application.ContainerException
- if there is an error creating the container.java.lang.IllegalArgumentException
- if no container provider supports the type.public static <A> A createContainer(java.lang.Class<A> type, ResourceConfig resourceConfig) throws ContainerException, java.lang.IllegalArgumentException
The list of service-provider supporting the ContainerProvider
service-provider will be iterated over until one returns a non-null
container instance.
A
- the type of the container.type
- the type of the container.resourceConfig
- the resource configuration containing the set
of Web resources to be managed by the Web application.ContainerException
- if there is an error creating the container.java.lang.IllegalArgumentException
- if no container provider supports the type.public static <A> A createContainer(java.lang.Class<A> type, ResourceConfig resourceConfig, IoCComponentProviderFactory factory) throws ContainerException, java.lang.IllegalArgumentException
The list of service-provider supporting the ContainerProvider
service-provider will be iterated over until one returns a non-null
container instance.
A
- the type of the container.type
- the type of the container.resourceConfig
- the resource configuration containing the set
of Web resources to be managed by the Web application.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.ContainerException
- if there is an error creating the container.java.lang.IllegalArgumentException
- if no container provider supports the type.@Deprecated public static <A> A createContainer(java.lang.Class<A> type, java.lang.String packageName) throws ContainerException, java.lang.IllegalArgumentException
A
- the type of the container.type
- the type of the container.packageName
- the name of the package where to find the resource configuration
class.ContainerException
- if the resource configuration class could not
be found and instantiated or there is an error creating the container.java.lang.IllegalArgumentException
- if no container provider supports the type.public static <A> A createContainer(java.lang.Class<A> type)
All java classpath will be scanned for Root Resource Classes.
A
- the type of the container.type
- the type of the container.java.lang.IllegalArgumentException
- if no container provider supports the type.public static <A> A createContainer(java.lang.Class<A> type, java.lang.String... paths)
Root Resource Classes will be scanned in paths.
A
- the type of the container.type
- the type of the container.paths
- a list of paths to be scanned for resource classes.java.lang.IllegalArgumentException
- if no container provider supports the type.Copyright © 2016 Oracle Corporation. All Rights Reserved.