Class EnterpriseContainerBase<T extends Archive<T>>

    • Constructor Detail

      • EnterpriseContainerBase

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

      • getApplicationPath

        protected abstract ArchivePath getApplicationPath()
        Should be implemented to set the path for Application related resources.
        Returns:
        Base Path for the EnterpriseContainer application resources
      • setApplicationXML

        public T setApplicationXML​(java.lang.String resourceName)
                            throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        Adds a resource to this Archive as application.xml.

        The ClassLoader used to obtain the resource is up to the implementation.
        For instance a resourceName of "test/example.xml" could be placed in "/META-INF/application.xml"
        Specified by:
        setApplicationXML in interface EnterpriseContainer<T extends Archive<T>>
        Parameters:
        resourceName - Name of the ClassLoader resource to add
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resourceName is null
        See Also:
        EnterpriseContainer.setApplicationXML(Asset)
      • setApplicationXML

        public T setApplicationXML​(java.io.File resource)
                            throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        Adds a File to this Archive as application.xml.

        For instance a File "test/example.xml" could be placed in "/META-INF/application.xml"
        Specified by:
        setApplicationXML in interface EnterpriseContainer<T extends Archive<T>>
        Parameters:
        resource - File resource to add
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resource is null
        See Also:
        EnterpriseContainer.setApplicationXML(Asset)
      • setApplicationXML

        public T setApplicationXML​(java.net.URL resource)
                            throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        Adds a URL to this Archive as application.xml.

        For instance a URL "http://my.com/example.xml" could be placed in "/META-INF/application.xml"
        Specified by:
        setApplicationXML in interface EnterpriseContainer<T extends Archive<T>>
        Parameters:
        resource - URL resource to add
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resource is null
        See Also:
        EnterpriseContainer.setApplicationXML(Asset)
      • setApplicationXML

        public T setApplicationXML​(Asset resource)
                            throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        Adds a Asset to this Archive as application.xml.
        Specified by:
        setApplicationXML in interface EnterpriseContainer<T extends Archive<T>>
        Parameters:
        resource - Asset resource to add
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resource is null
      • setApplicationXML

        public T setApplicationXML​(java.lang.Package resourcePackage,
                                   java.lang.String resourceName)
                            throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        Adds a resource inside the package to this Archive as application.xml.

        The ClassLoader used to obtain the resource is up to the implementation.
        Specified by:
        setApplicationXML in interface EnterpriseContainer<T extends Archive<T>>
        Parameters:
        resourcePackage - The package of the resources
        resourceName - The name of the resource inside resourcePackage
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resourcePackage is null
        See Also:
        EnterpriseContainer.setApplicationXML(String)
      • addAsApplicationResource

        public T addAsApplicationResource​(java.lang.String resourceName)
                                   throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        Adds a resource to this Archives application context.

        The ClassLoader used to obtain the resource is up to the implementation.
        For instance a resourceName of "test/example.xml" could be placed in "/META-INF/test/example.xml"
        Specified by:
        addAsApplicationResource in interface EnterpriseContainer<T extends Archive<T>>
        Parameters:
        resourceName - Name of the ClassLoader resource to add
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resourceName is null
        See Also:
        EnterpriseContainer.addAsApplicationResource(Asset, ArchivePath)
      • addAsApplicationResource

        public T addAsApplicationResource​(java.lang.String resourceName,
                                          java.lang.String target)
                                   throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        Adds a resource to this Archives application context.

        The ClassLoader used to obtain the resource is up to the implementation.
        For instance a resourceName of "test/example.xml" and a target of "example/myexample.xml" could be placed in "/META-INF/example/myexample.xml"
        Specified by:
        addAsApplicationResource in interface EnterpriseContainer<T extends Archive<T>>
        Parameters:
        resourceName - Name of the ClassLoader resource to add
        target - The target relative to application path within the archive into which we'll place the resource
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resource is null
        See Also:
        EnterpriseContainer.addAsApplicationResource(Asset, ArchivePath)
      • addAsApplicationResource

        public T addAsApplicationResource​(java.io.File resource,
                                          java.lang.String target)
                                   throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        Adds a File to this Archives application context.

        For instance a File of "test/example.xml" and a target of "example/myexample.xml" could be placed in "/META-INF/example/myexample.xml"
        Specified by:
        addAsApplicationResource in interface EnterpriseContainer<T extends Archive<T>>
        Parameters:
        resource - File resource to add
        target - The target relative to application path within the archive into which we'll place the resource
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resource is null
        See Also:
        EnterpriseContainer.addAsApplicationResource(Asset, ArchivePath)
      • addAsApplicationResource

        public T addAsApplicationResource​(java.net.URL resource,
                                          java.lang.String target)
                                   throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        Adds a URL to this Archives application context.


        For instance a URL of "http://my.com/example.xml" and a target of "example/myexample.xml" could be placed in "/META-INF/example/myexample.xml"
        Specified by:
        addAsApplicationResource in interface EnterpriseContainer<T extends Archive<T>>
        Parameters:
        resource - URL resource to add
        target - The target relative to application path within the archive into which we'll place the resource
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resource is null
        See Also:
        EnterpriseContainer.addAsApplicationResource(Asset, ArchivePath)
      • addAsApplicationResource

        public T addAsApplicationResource​(java.lang.String resourceName,
                                          ArchivePath target)
                                   throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        Adds a resource to this Archives application context.

        The ClassLoader used to obtain the resource is up to the implementation.
        For instance a resourceName of "test/example.xml" and a target of "example/myexample.xml" could be placed in "/META-INF/example/myexample.xml"
        Specified by:
        addAsApplicationResource in interface EnterpriseContainer<T extends Archive<T>>
        Parameters:
        resourceName - Name of the ClassLoader resource to add
        target - The target relative to application path within the archive into which we'll place the resource
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resourceName is null
        See Also:
        EnterpriseContainer.addAsApplicationResource(Asset, ArchivePath)
      • addAsApplicationResource

        public T addAsApplicationResource​(java.io.File resource,
                                          ArchivePath target)
                                   throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        Adds a File to this Archives application context.

        For instance a File of "test/example.xml" and a target of "example/myexample.xml" could be placed in "/META-INF/example/myexample.xml"
        Specified by:
        addAsApplicationResource in interface EnterpriseContainer<T extends Archive<T>>
        Parameters:
        resource - File resource to add
        target - The target relative to application path within the archive into which we'll place the resource
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resource is null
        See Also:
        EnterpriseContainer.addAsApplicationResource(Asset, ArchivePath)
      • addAsApplicationResource

        public T addAsApplicationResource​(java.net.URL resource,
                                          ArchivePath target)
                                   throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        Adds a URL to this Archives application context.

        For instance a File of "test/example.xml" and a target of "example/myexample.xml" could be placed in "/META-INF/example/myexample.xml"
        Specified by:
        addAsApplicationResource in interface EnterpriseContainer<T extends Archive<T>>
        Parameters:
        resource - URL resource to add
        target - The target relative to application path within the archive into which we'll place the resource
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resource is null
        See Also:
        EnterpriseContainer.addAsApplicationResource(Asset, ArchivePath)
      • addAsApplicationResource

        public T addAsApplicationResource​(Asset resource,
                                          ArchivePath target)
                                   throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        Adds a Asset to this Archives application context.
        Specified by:
        addAsApplicationResource in interface EnterpriseContainer<T extends Archive<T>>
        Parameters:
        resource - Asset resource to add
        target - The target relative to application path within the archive into which we'll place the resource
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resource is null
      • addAsApplicationResources

        public T addAsApplicationResources​(java.lang.Package resourcePackage,
                                           java.lang.String... resourceNames)
                                    throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        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:
        addAsApplicationResources in interface EnterpriseContainer<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
      • addAsApplicationResource

        public T addAsApplicationResource​(java.lang.Package resourcePackage,
                                          java.lang.String resourceName)
                                   throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        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:
        addAsApplicationResource in interface EnterpriseContainer<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
      • addAsApplicationResource

        public T addAsApplicationResource​(java.lang.Package resourcePackage,
                                          java.lang.String resourceName,
                                          java.lang.String target)
                                   throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        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:
        addAsApplicationResource in interface EnterpriseContainer<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
      • addAsApplicationResource

        public T addAsApplicationResource​(java.lang.Package resourcePackage,
                                          java.lang.String resourceName,
                                          ArchivePath target)
                                   throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        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:
        addAsApplicationResource in interface EnterpriseContainer<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
      • getModulePath

        protected abstract ArchivePath getModulePath()
        Should be implemented to set the path for Module related resources.
        Returns:
        Base Path for the EnterpriseContainer module resources
      • addAsModules

        public T addAsModules​(Archive<?>... archives)
                       throws java.lang.IllegalArgumentException
        Adds the specified archives to this Archives module context.

        The Archive names are used as paths.
        Specified by:
        addAsModules in interface EnterpriseContainer<T extends Archive<T>>
        Parameters:
        archives - The archives to use
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if not archives are specified
        See Also:
        org.jboss.shrinkwrap.api.container.EnterpriseContainer#addAsModules(org.jboss.shrinkwrap.api.Archive[])
      • addAsModules

        public T addAsModules​(java.lang.String... resourceNames)
                       throws java.lang.IllegalArgumentException
        Adds the specified resources to this Archives module context.
        The resource names are used as paths.
        Specified by:
        addAsModules in interface EnterpriseContainer<T extends Archive<T>>
        Parameters:
        resourceNames - Names of the ClassLoader resources to add
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resourceNames are not specified
        See Also:
        EnterpriseContainer.addAsModules(java.lang.String[])
      • addAsModules

        public T addAsModules​(java.io.File... resources)
                       throws java.lang.IllegalArgumentException
        Adds the specified Files to this Archives module context.
        The File names are used as paths.
        Specified by:
        addAsModules in interface EnterpriseContainer<T extends Archive<T>>
        Parameters:
        resources - File resources to add
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resources are not specified
        See Also:
        EnterpriseContainer.addAsModules(java.io.File[])
      • addAsModule

        public T addAsModule​(java.io.File resource,
                             java.lang.String targetPath)
                      throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        Adds a File to this Archives module context.
        Specified by:
        addAsModule in interface EnterpriseContainer<T extends Archive<T>>
        Parameters:
        resource - File resource to add
        targetPath - The target path within the archive in which to add the resource, relative to the Archives module path.
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resource is null
        See Also:
        EnterpriseContainer.addAsModule(Asset, ArchivePath)
      • addAsModule

        public T addAsModule​(java.lang.String resourceName,
                             java.lang.String targetPath)
                      throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        Adds a resource to this Archives module context.
        Specified by:
        addAsModule in interface EnterpriseContainer<T extends Archive<T>>
        Parameters:
        resourceName - Name of the ClassLoader resource to add
        targetPath - The target path within the archive in which to add the resource, relative to the Archives module path.
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resourceName is null
        See Also:
        EnterpriseContainer.addAsModule(Asset, ArchivePath)
      • addAsModule

        public T addAsModule​(java.net.URL resource,
                             java.lang.String targetPath)
                      throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        Adds a URL to this Archives module context.
        Specified by:
        addAsModule in interface EnterpriseContainer<T extends Archive<T>>
        Parameters:
        resource - URL resource to add
        targetPath - The target path within the archive in which to add the resource, relative to the Archives module path.
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if resource is null
        See Also:
        EnterpriseContainer.addAsModule(Asset, ArchivePath)
      • addAsModule

        public T addAsModule​(Asset resource,
                             ArchivePath targetPath)
                      throws java.lang.IllegalArgumentException
        Description copied from interface: EnterpriseContainer
        Adds a Asset to this Archives module context.
        Specified by:
        addAsModule in interface EnterpriseContainer<T extends Archive<T>>
        Parameters:
        resource - URL resource to add
        targetPath - The target path within the archive in which to add the resource, relative to the Archives module path.
        Returns:
        This virtual archive
        Throws:
        java.lang.IllegalArgumentException - if targetPath is null