org.jboss.weld.bootstrap

Class WeldBootstrap

  • All Implemented Interfaces:
    Bootstrap, CDI11Bootstrap


    public class WeldBootstrapextends Objectimplements CDI11Bootstrap
    Common bootstrapping functionality that is run at application startup and detects and register beans
    Author:
    Pete Muir, Ales Justin, Marko Luksa
    • Constructor Detail

      • WeldBootstrap

        public WeldBootstrap()
    • Method Detail

      • startExtensions

        public TypeDiscoveryConfiguration startExtensions(Iterable<Metadata<Extension>> extensions)
        Description copied from interface: CDI11Bootstrap

        The container bootstrap sequence begins with initializing extensions. The container performs the following actions:

        The container fires the BeforeBeanDiscovery event which allows extensions to register scopes and stereotypes. The container combines the registered scopes and stereotypes with scopes associated with the built-in contexts and built-in stereotypes and makes the resulting set available through TypeDiscoveryConfiguration.getKnownBeanDefiningAnnotations()

        Afterwards, an EE7-compatible integrator performs type discovery in the following locations:

        • Library jars
        • EJB jars or application client jars
        • The WEB-INF/classes directory of a war
        • Directories in the JVM classpath

        These locations are referred to as available archives hereafter.

        Next, the integrator builds the set of bean defining annotations. The set contains:

        The resulting set is referred to as bean defining annotations hereafter.

        Next, the integrator processes available archives according to these rules. The rules are exclusive.

        If an archive:

        • contains the beans.xml file and the file does not contain the bean-discovery-mode attribute, or
        • contains the beans.xml file and the value of the bean-discovery-mode attribute is set to all

        this archive is an explicit bean archive.

        If an archive:

        • contains the beans.xml file and the bean-discovery-mode attribute is set to annotated, or
        • does not contain the beans.xml file nor any implementation of the Extension interface but the archive contains types annotated with a bean defining annotation or session beans

        this archive is an implicit bean archive.

        If an archive:

        • contains the beans.xml file and the bean-discovery-mode attribute is set to none, or
        • does not contain the beans.xml file and contains an implementation of the Extension interface, or
        • does not contain the beans.xml file and does not contain any types annotated with a bean defining annotation nor session bean

        this archive is not a bean archive.

        For each explicit bean archive the integrator creates an instance of BeanDeploymentArchive representing this archive. The BeanDeploymentArchive.getBeanClasses() method returns a collection of all types present within the archive. Filtering rules defined in BeansXml.getScanning() are not required to be applied by the integrator and are applied later on by Weld. The BeanDeploymentArchive.getEjbs() method returns a collection of EJB descriptors for EJBs present in the archive.

        For each implicit bean archive the integrator creates an instance of BeanDeploymentArchive representing this archive. The BeanDeploymentArchive.getBeanClasses() of the bean archive returns all the types found in the archive which are annotated with a bean defining annotations or are Session bean definitions. Filtering rules ( BeansXml.getScanning()) are not required to be applied by the integrator. The BeanDeploymentArchive.getEjbs() method returns a collection of EJB descriptors for Session beans present in the archive.

        Initially, the integrator does not need to create a BeanDeploymentArchive instance for an archive which is not a bean archive. Note that although these archives are ignored when building the initial collection of bean archives, the integrator may be required to create a BeanDeploymentArchive later upon a call to Deployment.loadBeanDeploymentArchive(Class). For example, when the method is called for a extension class that is deployed in an archive that is not a bean archive.

        Specified by:
        startExtensions in interface CDI11Bootstrap
        Parameters:
        extensions - discovered CDI extensions
        Returns:
        TypeDiscoveryConfiguration type discovery configuration including known bean defining annotations
      • startContainer

        public Bootstrap startContainer(Environment environment,                                Deployment deployment)
        Description copied from interface: Bootstrap
        Creates the application container:
        • Checks that the services required by the environment have been provided
        • Adds container provided services
        • Creates and initializes the built in contexts
        • Creates the manager
        context
        Specified by:
        startContainer in interface Bootstrap
        Parameters:
        environment - the environment in use, by default Environments.EE
        deployment - the Deployment to be booted
        Returns:
        self
      • startContainer

        public Bootstrap startContainer(String contextId,                                Environment environment,                                Deployment deployment)
        Description copied from interface: CDI11Bootstrap
        Creates the application container:
        • Checks that the services required by the environment have been provided
        • Adds container provided services
        • Creates and initializes the built in contexts
        • Creates the manager

        In addition to Bootstrap.startContainer(Environment, Deployment), this method allows an identifier (contextId) to be assigned to the container. This identifier will be used to identify this application when invoking Singleton methods.

        Specified by:
        startContainer in interface CDI11Bootstrap
        Parameters:
        contextId - the identifier of this application container instance
        environment - the environment in use, by default Environments.EE
        deployment - the Deployment to be booted
        Returns:
        self
      • deployBeans

        public Bootstrap deployBeans()
        Description copied from interface: Bootstrap
        Creates and deploys the application's beans:
        • Creates and deploys the discovered beans
        • Creates and deploys the built-in beans defined by the CDI specification
        Finally the AfterBeanDiscovery is event is fired
        Specified by:
        deployBeans in interface Bootstrap
        Returns:
        self
      • shutdown

        public void shutdown()
        Description copied from interface: Bootstrap
        Causes the container to clean up and shutdown Before the contain is shutdown the BeforeShutdown event is fired
        Specified by:
        shutdown in interface Bootstrap
      • parse

        public BeansXml parse(Iterable<URL> urls)
        Description copied from interface: Bootstrap
        Parse the specified URLs as a series of beans.xml file and merge the result. Duplicate entries are not removed.
        Specified by:
        parse in interface Bootstrap
        Parameters:
        urls - the urls to parse
        Returns:
        the BeansXml data structure which represents the URL
      • parse

        public BeansXml parse(Iterable<URL> urls,                      boolean removeDuplicates)
        Description copied from interface: Bootstrap
        Parse the specified URLs as a series of beans.xml file and merge the result.
        Specified by:
        parse in interface Bootstrap
        Parameters:
        urls - the urls to parse
        removeDuplicates - whether duplicate entries (alternatives, interceptors, etc) are removed
        Returns:
        the BeansXml data structure which represents the URL
      • parse

        public BeansXml parse(URL url)
        Description copied from interface: Bootstrap
        Parse the specified URL as a beans.xml file.
        Specified by:
        parse in interface Bootstrap
        Parameters:
        url - the url to parse
        Returns:
        the BeansXml data structure which represents the URL

Copyright © 2015. All Rights Reserved.



NOTHING
NOTHING
Add the Maven Dependecy to your project: maven dependecy for com.amazonaws : aws-java-sdk : 1.3.14