Class WebBeansContext


  • public class WebBeansContext
    extends Object
    This is the central point to manage the whole CDI container for a single application There is one WebBeansContext per BeanManagerImpl.
    Version:
    $Rev$ $Date$
    • Constructor Detail

      • WebBeansContext

        public WebBeansContext()
    • Method Detail

      • getBeanManagerBean

        public jakarta.enterprise.inject.spi.Bean<jakarta.enterprise.inject.spi.BeanManager> getBeanManagerBean()
      • currentInstance

        public static WebBeansContext currentInstance()
        Method to be used when static use is truely unavoidable, such as serialization Ideally this method would never lazily create a WebBeansContext and as we don't want to do any deployment of new apps during deserialization, we want to rehydrate objects from an existing WebBeansContext which should be the active context. This method could throw a runtime exception if no instance currently exists.
        Returns:
      • getService

        public <T> T getService​(Class<T> clazz)
      • registerService

        public <T> void registerService​(Class<T> clazz,
                                        T t)
      • get

        public <T> T get​(Class<T> clazz)
      • clear

        public void clear()
        Clear and destroy the whole WebBeansContext. This will also properly destroy all SPI services
      • findMissingAnnotatedType

        public boolean findMissingAnnotatedType​(Class<?> missing)