Class ContainerFactory


  • public final class ContainerFactory
    extends java.lang.Object
    Factory for creating specific HTTP-based containers.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private ContainerFactory()
      Prevents instantiation.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static <T> T createContainer​(java.lang.Class<T> type, javax.ws.rs.core.Application application)
      Create a container according to the class requested.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ContainerFactory

        private ContainerFactory()
        Prevents instantiation.
    • Method Detail

      • createContainer

        public static <T> T createContainer​(java.lang.Class<T> type,
                                            javax.ws.rs.core.Application application)
        Create a container according to the class requested.

        The list of service-provider supporting the ContainerProvider service-provider will be iterated over until one returns a non-null container instance.

        Type Parameters:
        T - container type
        Parameters:
        type - type of the container
        application - JAX-RS / Jersey application.
        Returns:
        the container.
        Throws:
        ContainerException - if there was an error creating the container.
        java.lang.IllegalArgumentException - if no container provider supports the type.