Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * JBoss, Home of Professional Open Source
   * Copyright 2010, Red Hat, Inc., and individual contributors
   * by the @authors tag. See the copyright.txt in the distribution for a
   * full listing of individual contributors.
   *
   * Licensed under the Apache License, Version 2.0 (the "License");
   * you may not use this file except in compliance with the License.
   * You may obtain a copy of the License at
  * http://www.apache.org/licenses/LICENSE-2.0
  * Unless required by applicable law or agreed to in writing, software
  * distributed under the License is distributed on an "AS IS" BASIS,
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
 package org.jboss.weld.bootstrap.api;
 
 import java.net.URL;
 
 
Application container initialization API for Weld. To initialize the container you must call, in this order:
  1. startContainer(org.jboss.weld.bootstrap.api.Environment,org.jboss.weld.bootstrap.spi.Deployment)
  2. startInitialization()
  3. deployBeans()
  4. validateBeans()
  5. endInitialization()
To stop the container and clean up, you must call shutdown()

Author(s):
Pete Muir
 
 public 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

Parameters:
environment the environment in use, by default Environments.EE
deployment the Deployment to be booted
Throws:
java.lang.IllegalStateException if not all the services required for the given environment are available
 
     Bootstrap startContainer(Environment environmentDeployment deployment);

    
Starts the application container initialization process: Finally, the javax.enterprise.inject.spi.BeforeBeanDiscovery event is fired.
 
     Bootstrap startInitialization();

    
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 javax.enterprise.inject.spi.AfterBeanDiscovery is event is fired
 
     Bootstrap deployBeans();

    
Validates the deployment. After validation, the javax.enterprise.inject.spi.AfterDeploymentValidation event is fired
    Bootstrap validateBeans();

    
Cleans up after the initialization
    Bootstrap endInitialization();

    
Causes the container to clean up and shutdown Before the contain is shutdown the javax.enterprise.inject.spi.BeforeShutdown event is fired
    void shutdown();

    
Get the manager used for this beanDeploymentArchive. If startContainer(org.jboss.weld.bootstrap.api.Environment,org.jboss.weld.bootstrap.spi.Deployment) has not been called, this method will return null. If the beanDeploymentArchive is not known to Weld (for example, it was not passed to the Weld as part of the org.jboss.weld.bootstrap.spi.Deployment, or has not yet been requested by org.jboss.weld.bootstrap.spi.Deployment.loadBeanDeploymentArchive(java.lang.Class)), null will be returned.

Returns:
the manager or null if not yet available or not found.
    WeldManager getManager(BeanDeploymentArchive beanDeploymentArchive);

    
Parse the specified URL as a beans.xml file.

Parameters:
url the url to parse
Returns:
the BeansXml data structure which represents the URL
Throws:
java.lang.IllegalArgumentException if the URL cannot be opened
    BeansXml parse(URL url);

    
Parse the specified URLs as a series of beans.xml file and merge the result. Duplicate entries are not removed.

Parameters:
url the url to parse
Returns:
the BeansXml data structure which represents the URL
Throws:
java.lang.IllegalArgumentException if the URL cannot be opened
    BeansXml parse(Iterable<URLurls);

    
Parse the specified URLs as a series of beans.xml file and merge the result.

Parameters:
urls the urls to parse
removeDuplicates whether duplicate entries (alternatives, interceptors, etc) are removed
Returns:
the BeansXml data structure which represents the URL
Throws:
java.lang.IllegalArgumentException if the URL cannot be opened
    BeansXml parse(Iterable<URLurlsboolean removeDuplicates);

    
Load CDI extensions using the provided ClassLoader

Parameters:
classLoader the ClassLoader to use to load the extensions
Throws:
java.lang.IllegalArgumentException if classLoader is null
New to GrepCode? Check out our FAQ X