Class WebContainerBase<T extends Archive<T>>

    • Constructor Detail

      • WebContainerBase

        protected WebContainerBase​(java.lang.Class<T> actualType,
                                   Archive<?> archive)
    • Method Detail

      • getWebPath

        protected abstract ArchivePath getWebPath()
        Returns the path to web resources
        Returns:
        Base Path for the web resources
      • getWebInfPath

        protected abstract ArchivePath getWebInfPath()
        Returns the path to WEB-INF
        Returns:
        the path to WEB-INF
      • getServiceProvidersPath

        protected abstract ArchivePath getServiceProvidersPath()
        Returns the path to web container service providers
        Returns:
        the path to web container service providers
      • setWebXML

        public T setWebXML​(java.lang.String resourceName)
                    throws java.lang.IllegalArgumentException
        Description copied from interface: WebContainer
        Adds the resource as web.xml to the container, returning the container itself.
        The ClassLoader used to obtain the resource is up to the implementation.
        Specified by:
        setWebXML in interface WebContainer<T extends Archive<T>>
        Parameters:
        resourceName - resource to add
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resourceName is null
        See Also:
        WebContainer.setWebXML(Asset)
      • setWebXML

        public T setWebXML​(java.io.File resource)
                    throws java.lang.IllegalArgumentException
        Description copied from interface: WebContainer
        Adds the File as web.xml to the container, returning the container itself.
        Specified by:
        setWebXML in interface WebContainer<T extends Archive<T>>
        Parameters:
        resource - File resource to add
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resource is null
        See Also:
        WebContainer.setWebXML(Asset)
      • setWebXML

        public T setWebXML​(java.net.URL resource)
                    throws java.lang.IllegalArgumentException
        Description copied from interface: WebContainer
        Adds the URL as web.xml to the container, returning the container itself.
        Specified by:
        setWebXML in interface WebContainer<T extends Archive<T>>
        Parameters:
        resource - URL resource to add
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resource is null
        See Also:
        WebContainer.setWebXML(Asset)
      • setWebXML

        public T setWebXML​(Asset resource)
                    throws java.lang.IllegalArgumentException
        Description copied from interface: WebContainer
        Adds the Asset as web.xml to the container, returning the container itself.
        Specified by:
        setWebXML in interface WebContainer<T extends Archive<T>>
        Parameters:
        resource - Asset resource to add
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resource is null
      • setWebXML

        public T setWebXML​(java.lang.Package resourcePackage,
                           java.lang.String resourceName)
                    throws java.lang.IllegalArgumentException
        Description copied from interface: WebContainer
        Adds the resource inside the package as web.xml to the container, returning the container itself.

        The ClassLoader used to obtain the resource is up to the implementation.
        Specified by:
        setWebXML in interface WebContainer<T extends Archive<T>>
        Parameters:
        resourcePackage - The package of the resources
        resourceName - The name of the resources inside resourcePackage
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resourcePackage is null
      • addAsWebResource

        public T addAsWebResource​(java.lang.String resourceName)
                           throws java.lang.IllegalArgumentException
        Description copied from interface: WebContainer
        Adds the resource as a Web resource to the container, returning the container itself.
        The resource will be placed into the Container Web path under the same context from which it was retrieved.

        The ClassLoader used to obtain the resource is up to the implementation.
        Specified by:
        addAsWebResource in interface WebContainer<T extends Archive<T>>
        Parameters:
        resourceName - resource to add
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resourceName is null
        See Also:
        WebContainer.addAsWebResource(Asset, ArchivePath)
      • addAsWebResource

        public T addAsWebResource​(java.io.File resource)
                           throws java.lang.IllegalArgumentException
        Description copied from interface: WebContainer
        Adds the File as a Web resource to the container, returning the container itself.
        The File will be placed into the Container Web path under File.getName().
        Specified by:
        addAsWebResource in interface WebContainer<T extends Archive<T>>
        Parameters:
        resource - resource to add
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if File resource is null
        See Also:
        WebContainer.addAsWebResource(Asset, ArchivePath)
      • addAsWebResource

        public T addAsWebResource​(java.lang.String resourceName,
                                  java.lang.String target)
                           throws java.lang.IllegalArgumentException
        Description copied from interface: WebContainer
        Adds the resource as a Web resource to the container, returning the container itself.
        The ClassLoader used to obtain the resource is up to the implementation.
        Specified by:
        addAsWebResource in interface WebContainer<T extends Archive<T>>
        Parameters:
        resourceName - resource to add
        target - The target path within the archive in which to add the resource, relative to the Archives web path.
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resourceName is null
        See Also:
        WebContainer.addAsWebResource(Asset, ArchivePath)
      • addAsWebResource

        public T addAsWebResource​(java.io.File resource,
                                  java.lang.String target)
                           throws java.lang.IllegalArgumentException
        Description copied from interface: WebContainer
        Adds the File as a Web resource to the container, returning the container itself.
        Specified by:
        addAsWebResource in interface WebContainer<T extends Archive<T>>
        Parameters:
        resource - File resource to add
        target - The target path within the archive in which to add the resource, relative to the Archives web path.
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resource is null
        See Also:
        WebContainer.addAsWebResource(Asset, ArchivePath)
      • addAsWebResource

        public T addAsWebResource​(java.net.URL resource,
                                  java.lang.String target)
                           throws java.lang.IllegalArgumentException
        Description copied from interface: WebContainer
        Adds the URL as a Web resource to the container, returning the container itself.
        Specified by:
        addAsWebResource in interface WebContainer<T extends Archive<T>>
        Parameters:
        resource - URL resource to add
        target - The target path within the archive in which to add the resource, relative to the Archives web path.
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resource is null
        See Also:
        WebContainer.addAsWebResource(Asset, ArchivePath)
      • addAsWebResource

        public T addAsWebResource​(Asset resource,
                                  java.lang.String target)
                           throws java.lang.IllegalArgumentException
        Description copied from interface: WebContainer
        Adds the Asset as a Web resource to the container, returning the container itself.
        Specified by:
        addAsWebResource in interface WebContainer<T extends Archive<T>>
        Parameters:
        resource - Asset resource to add
        target - The target path within the archive in which to add the resource, relative to the Archives web path.
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resource is null
        See Also:
        WebContainer.addAsWebResource(Asset, ArchivePath)
      • addAsWebResource

        public T addAsWebResource​(java.lang.String resourceName,
                                  ArchivePath target)
                           throws java.lang.IllegalArgumentException
        Description copied from interface: WebContainer
        Adds the resource as a Web resource to the container, returning the container itself.


        The ClassLoader used to obtain the resource is up to the implementation.
        Specified by:
        addAsWebResource in interface WebContainer<T extends Archive<T>>
        Parameters:
        resourceName - resource to add
        target - The target path within the archive in which to add the resource, relative to the Archives web path.
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resourceName is null
        See Also:
        WebContainer.addAsWebResource(Asset, ArchivePath)
      • addAsWebResource

        public T addAsWebResource​(java.net.URL resource,
                                  ArchivePath target)
                           throws java.lang.IllegalArgumentException
        Description copied from interface: WebContainer
        Adds the URL as a Web resource to the container, returning the container itself.
        Specified by:
        addAsWebResource in interface WebContainer<T extends Archive<T>>
        Parameters:
        resource - URL resource to add
        target - The target path within the archive in which to add the resource, relative to the Archives web path.
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resource is null
        See Also:
        WebContainer.addAsWebResource(Asset, ArchivePath)
      • addAsWebResources

        public T addAsWebResources​(java.lang.Package resourcePackage,
                                   java.lang.String... resourceNames)
                            throws java.lang.IllegalArgumentException
        Adds the resources inside the package as multiple resources to the container, returning the container itself.

        The ClassLoader used to obtain the resource is up to the implementation.
        Specified by:
        addAsWebResources in interface WebContainer<T extends Archive<T>>
        Parameters:
        resourcePackage - The package of the resources
        resourceNames - The names of the resources inside resoucePackage
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resourcePackage is null
        See Also:
        WebContainer.addAsWebResources(java.lang.Package, java.lang.String[])
      • addAsWebResource

        public T addAsWebResource​(java.lang.Package resourcePackage,
                                  java.lang.String resourceName)
                           throws java.lang.IllegalArgumentException
        Description copied from interface: WebContainer
        Adds the resource as a resource to the container, returning the container itself.

        The ClassLoader used to obtain the resource is up to the implementation.
        Specified by:
        addAsWebResource in interface WebContainer<T extends Archive<T>>
        Parameters:
        resourcePackage - The package of the resource
        resourceName - The name of the resource inside resoucePackage
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resourcePackage is null
      • addAsWebResource

        public T addAsWebResource​(java.lang.Package resourcePackage,
                                  java.lang.String resourceName,
                                  java.lang.String target)
                           throws java.lang.IllegalArgumentException
        Description copied from interface: WebContainer
        Adds the resource as a resource to a specific path inside the container, returning the container itself.

        The ClassLoader used to obtain the resource is up to the implementation.
        Specified by:
        addAsWebResource in interface WebContainer<T extends Archive<T>>
        Parameters:
        resourcePackage - The package of the resource
        resourceName - The name of the resource inside resoucePackage
        target - The target location inside the container
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resourcePackage is null
      • addAsWebResource

        public T addAsWebResource​(java.lang.Package resourcePackage,
                                  java.lang.String resourceName,
                                  ArchivePath target)
                           throws java.lang.IllegalArgumentException
        Description copied from interface: WebContainer
        Adds the resource as a resource to a specific path inside the container, returning the container itself.

        The ClassLoader used to obtain the resource is up to the implementation.
        Specified by:
        addAsWebResource in interface WebContainer<T extends Archive<T>>
        Parameters:
        resourcePackage - The package of the resource
        resourceName - The name of the resource inside resoucePackage
        target - The target location inside the container
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resourcePackage is null
      • addAsWebInfResource

        public T addAsWebInfResource​(java.lang.String resourceName)
                              throws java.lang.IllegalArgumentException
        Adds the resource as a WEB-INF resource to the container, returning the container itself.

        The ClassLoader used to obtain the resource is up to the implementation.
        Specified by:
        addAsWebInfResource in interface WebContainer<T extends Archive<T>>
        Parameters:
        resourceName - resource to add
        Returns:
        This Archive
        Throws:
        java.lang.IllegalArgumentException - if resourceName is not specified
        See Also:
        WebContainer.addAsWebInfResource(java.lang.String)
      • addAsWebInfResource

        public T addAsWebInfResource​(java.io.File resource)
                              throws java.lang.IllegalArgumentException
        Adds the File as a WEB-INF resource to the container, returning the container itself.
        The File will be placed into the Container WEB-INF path under File.getName().
        Specified by:
        addAsWebInfResource in interface WebContainer<T extends Archive<T>>
        Parameters:
        resource - Resource to add
        Returns:
        This Archive
        Throws:
        java.lang.IllegalArgumentException - if File resource is null
        See Also:
        WebContainer.addAsWebInfResource(java.io.File)
      • addAsWebInfResource

        public T addAsWebInfResource​(java.lang.String resourceName,
                                     java.lang.String target)
                              throws java.lang.IllegalArgumentException
        Adds the resource as a WEB-INF resource to the container, returning the container itself.
        The ClassLoader used to obtain the resource is up to the implementation.
        Specified by:
        addAsWebInfResource in interface WebContainer<T extends Archive<T>>
        Parameters:
        resourceName - resource to add
        target - The target path within the archive in which to add the resource, relative to the Archives WEB-INF path.
        Returns:
        This Archive
        Throws:
        java.lang.IllegalArgumentException - if resourceName or target is not specified
        See Also:
        WebContainer.addAsWebInfResource(java.lang.String, java.lang.String)
      • addAsWebInfResource

        public T addAsWebInfResource​(java.io.File resource,
                                     java.lang.String target)
                              throws java.lang.IllegalArgumentException
        Adds the File as a WEB-INF resource to the container, returning the container itself.
        Specified by:
        addAsWebInfResource in interface WebContainer<T extends Archive<T>>
        Parameters:
        resource - File resource to add
        target - The target path within the archive in which to add the resource, relative to the Archives WEB-INF path.
        Returns:
        This Archive
        Throws:
        java.lang.IllegalArgumentException - If the resource or target is not specified
        See Also:
        WebContainer.addAsWebInfResource(java.io.File, java.lang.String)
      • addAsWebInfResource

        public T addAsWebInfResource​(java.net.URL resource,
                                     java.lang.String target)
                              throws java.lang.IllegalArgumentException
        Adds the URL as a WEB-INF resource to the container, returning the container itself.
        Specified by:
        addAsWebInfResource in interface WebContainer<T extends Archive<T>>
        Parameters:
        resource - URL resource to add
        target - The target path within the archive in which to add the resource, relative to the Archives WEB-INF path.
        Returns:
        This Archive
        Throws:
        java.lang.IllegalArgumentException - If the resource or target is not specified
        See Also:
        WebContainer.addAsWebInfResource(java.net.URL, java.lang.String)
      • addAsWebInfResources

        public T addAsWebInfResources​(java.lang.Package resourcePackage,
                                      java.lang.String... resourceNames)
                               throws java.lang.IllegalArgumentException
        Adds the resources inside the package as multiple WEB-INF resources to the container, returning the container itself.

        The ClassLoader used to obtain the resource is up to the implementation.
        Specified by:
        addAsWebInfResources in interface WebContainer<T extends Archive<T>>
        Parameters:
        resourcePackage - The package of the resources
        resourceNames - The names of the resources inside resourcePackage
        Returns:
        This Archive
        Throws:
        java.lang.IllegalArgumentException - If resourcePackage is null, or if no resourceNames are specified or containing null
        See Also:
        WebContainer.addAsWebInfResources(java.lang.Package, java.lang.String[])
      • addAsWebInfResource

        public T addAsWebInfResource​(java.lang.Package resourcePackage,
                                     java.lang.String resourceName)
                              throws java.lang.IllegalArgumentException
        Adds the resource as a WEB-INF resource to the container, returning the container itself.

        The ClassLoader used to obtain the resource is up to the implementation.
        Specified by:
        addAsWebInfResource in interface WebContainer<T extends Archive<T>>
        Parameters:
        resourcePackage - The package of the resource
        resourceName - The name of the resource inside resourcePackage
        Returns:
        This Archive
        Throws:
        java.lang.IllegalArgumentException - If the package or resource name is not specified
        See Also:
        WebContainer.addAsWebInfResource(java.lang.Package, java.lang.String)
      • addAsWebInfResource

        public T addAsWebInfResource​(java.lang.Package resourcePackage,
                                     java.lang.String resourceName,
                                     java.lang.String target)
                              throws java.lang.IllegalArgumentException
        Adds the resource as a WEB-INF resource to a specific path inside the container, returning the container itself.

        The ClassLoader used to obtain the resource is up to the implementation.
        Specified by:
        addAsWebInfResource in interface WebContainer<T extends Archive<T>>
        Parameters:
        resourcePackage - The package of the resource
        resourceName - The name of the resource inside resoucePackage
        target - The target location inside the container
        Returns:
        This Archive
        Throws:
        java.lang.IllegalArgumentException - If the package, resource name, or target is not specified
        See Also:
        WebContainer.addAsWebInfResource(java.lang.Package, java.lang.String, java.lang.String)
      • addAsWebInfResource

        public T addAsWebInfResource​(java.lang.Package resourcePackage,
                                     java.lang.String resourceName,
                                     ArchivePath target)
                              throws java.lang.IllegalArgumentException
        Adds the resource as a WEB-INF resource to a specific path inside the container, returning the container itself.

        The ClassLoader used to obtain the resource is up to the implementation.
        Specified by:
        addAsWebInfResource in interface WebContainer<T extends Archive<T>>
        Parameters:
        resourcePackage - The package of the resource
        resourceName - The name of the resource inside resoucePackage
        target - The target location inside the container
        Returns:
        This Archive
        Throws:
        java.lang.IllegalArgumentException - If the package, resource name, or target is not specified
        See Also:
        WebContainer.addAsWebInfResource(java.lang.Package, java.lang.String, org.jboss.shrinkwrap.api.ArchivePath)
      • addAsServiceProvider

        public T addAsServiceProvider​(java.lang.Class<?> serviceInterface,
                                      java.lang.Class<?>... serviceImpls)
                               throws java.lang.IllegalArgumentException
        Description copied from interface: ManifestContainer
        Adds a META-INF/services/ServiceInterfaceName Asset representing this service. Warning: this method does not add the specified classes to the archive.
        Specified by:
        addAsServiceProvider in interface ManifestContainer<T extends Archive<T>>
        Overrides:
        addAsServiceProvider in class ContainerBase<T extends Archive<T>>
        Parameters:
        serviceInterface - The Service Interface class
        serviceImpls - The Service Interface Implementations
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if serviceInterface is null
      • addAsServiceProviderAndClasses

        public T addAsServiceProviderAndClasses​(java.lang.Class<?> serviceInterface,
                                                java.lang.Class<?>... serviceImpls)
                                         throws java.lang.IllegalArgumentException
        Description copied from interface: ServiceProviderContainer
        Adds a META-INF/services/ServiceInterfaceName Asset and the classes related to the service to the archive.
        Specified by:
        addAsServiceProviderAndClasses in interface ServiceProviderContainer<T extends Archive<T>>
        Overrides:
        addAsServiceProviderAndClasses in class ContainerBase<T extends Archive<T>>
        Parameters:
        serviceInterface - The Service Interface class
        serviceImpls - The Service Interface Implementations
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if serviceInterface is null