Package javax.enterprise.inject.spi

Examples of javax.enterprise.inject.spi.BeanManager


   public void bindToJavaComp()
   {
      try
      {
         Context compContext = getJavaCompContext();
         BeanManager beanManagerContext = null;
         try
         {
            beanManagerContext = (BeanManager) compContext.lookup("BeanManager");
         } catch (NamingException e)
         {
View Full Code Here


      BeanDeploymentArchive archive = deployment.getBeanDeploymentArchives().iterator().next();
     
      if (deployment.getBeanDeploymentArchives().size() > 1)
         log.warn("More than one bean deployment archives, using the first " + archive);
     
      BeanManager manager = bootstrapBean.getBootstrap().getManager(archive);
      if (manager == null)
         throw new IllegalStateException("Could not find a manager for archive " + null);
     
      //When the created weld kernel controller context is installed, call installCreatedBean() which removes
      //this bean from the controller
View Full Code Here

      Method m = context.getTarget().getClass().getMethod("getBootstrap");
      Object o = m.invoke(context.getTarget());
      assertNotNull(o);
      assertInstanceOf(o, Bootstrap.class);
     
      BeanManager manager = ((Bootstrap)o).getManager(getBeanDeploymentArchive(unit));
      assertNotNull(manager);
      return manager;
   }
View Full Code Here

         assertNotNull(flatDeployment);

         //Check the bootstrap bean has been installed
         assertNotNull(getControllerContext(DeployersUtils.getBootstrapBeanName(earDU)));

         BeanManager manager = getBeanManager(earDU);
        
         if (test != null)
            test.runTest(manager, earDU);
      }
      finally
View Full Code Here

    *
    * @return BeanManager instance
    */
   protected BeanManager lookupBeanManager()
   {
      BeanManager beanManager = null;

      // Do a lookup for BeanManager in JNDI (this is the only *portable* way)
      beanManager = lookupBeanManagerInJndi("java:comp/BeanManager");
      if (beanManager != null)
      {
View Full Code Here

        if (catchUnavailable) {
            log.trace("Catch integration previously disabled");
            return parent.getExceptionHandler();
        }

        BeanManager beanManager = null;
        try {
            locator = new BeanManagerLocator();
            beanManager = locator.getBeanManager();
        } catch (BeanManagerUnavailableException e) {
            log.info("Could not location BeanManager, Catch integration disabled");
            catchUnavailable = true;
            return parent.getExceptionHandler();
        }

        // TODO this looks like a nice utility for Solder
        if (beanManager.getBeans(CatchExceptionHandler.class).isEmpty()) {
            log.info("Catch not available, Catch integration disabled");
            catchUnavailable = true;
            return parent.getExceptionHandler();
        }
View Full Code Here

        return parent.getNavigationCases();
    }

    @Override
    public void handleNavigation(final FacesContext context, final String fromAction, final String outcome) {
        BeanManager manager = new BeanManagerLocator().getBeanManager();
        NavigationHandler navigationHandler = context.getApplication().getNavigationHandler();

        NavigationCase navigationCase;
        if (navigationHandler instanceof ConfigurableNavigationHandler) {
            navigationCase = ((ConfigurableNavigationHandler) navigationHandler)
                    .getNavigationCase(context, fromAction, outcome);
        } else {
            navigationCase = getNavigationCase(context, fromAction, outcome);
        }
        manager.fireEvent(new PreNavigateEvent(context, fromAction, outcome, navigationCase));
        parent.handleNavigation(context, fromAction, outcome);
    }
View Full Code Here

        }
        return currentContext;
    }

    private RenderContext getCurrentRenderContext() {
        BeanManager manager = new BeanManagerLocator().getBeanManager();
        return BeanManagerUtils.getContextualInstance(manager, RenderContext.class);
    }
View Full Code Here

        } catch (IOException ex) {
            throw new RuntimeException(ex);
        } catch (SAXException ex) {
            throw new RuntimeException(ex);
        }
        BeanManager beanManager = (BeanManager) sc.getAttribute(BeanManagerServletContextListener.BEANMANAGER_SERVLETCONTEXT_KEY);
        ViewConfigStore store = BeanManagerUtils.getContextualInstance(beanManager, ViewConfigStore.class);
        List<UrlMapping> mappings = loadUrlMappings(store, webXmlParser.getFacesMapping());
        PrettyConfig prettyConfig = new PrettyConfig();
        prettyConfig.setMappings(mappings);
        return prettyConfig;
View Full Code Here

    @Override
    public ExternalContext getExternalContext(final Object context, final Object request, final Object response)
            throws FacesException {
        try {
            BeanManager manager = new BeanManagerLocator().getBeanManager();

            SeamExternalContext seamExternalContext = BeanManagerUtils
                    .getContextualInstance(manager, SeamExternalContext.class);
            seamExternalContext.setWrapped(parent.getExternalContext(context, request, response));
View Full Code Here

TOP

Related Classes of javax.enterprise.inject.spi.BeanManager

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.