Package javax.enterprise.inject.spi

Examples of javax.enterprise.inject.spi.BeanManager


  protected BeanManager getBeanManager() {
    return BeanManagerLookup.getBeanManager();
  }

  protected javax.el.ELResolver getWrappedResolver() {
    BeanManager beanManager = getBeanManager();
    javax.el.ELResolver resolver = beanManager.getELResolver();
    return resolver;
  }
View Full Code Here


    return new CdiBusinessProcessEvent(task, processDefinition, type, ClockUtil.getCurrentTime());
  }


  protected BeanManager getBeanManager() {
    BeanManager bm = BeanManagerLookup.getBeanManager();
    if (bm == null) {
      throw new ProcessEngineException("No cdi bean manager available, cannot publish event.");
    }
    return bm;
  }
View Full Code Here

   * @throws IllegalStateException if there is no bean of the given class, but only if optional is <code>false</code>
   * @throws javax.enterprise.inject.AmbiguousResolutionException if the given type is satisfied by more than one Bean
   * @see #lookup(Class, boolean)
   */
  public static <T> T lookup(Class<T> clazz, boolean optional) {
    BeanManager bm = BeanManagerLookup.getBeanManager();
    return lookup(clazz, bm, optional);
  }
View Full Code Here

    BeanManager bm = BeanManagerLookup.getBeanManager();
    return lookup(clazz, bm, optional);
  }

  public static Object lookup(String name) {
    BeanManager bm = BeanManagerLookup.getBeanManager();
    return lookup(name, bm);
  }
View Full Code Here

  /** provide a custom jndi lookup name */
  public static String jndiName;

  public static BeanManager getBeanManager() {
   
    BeanManager beanManager = lookupBeanManagerInJndi();
   
    if(beanManager != null) {
      return beanManager;
     
    } else {
View Full Code Here

      catch (Exception e)
      {
         throw new RuntimeException("Failed to start standalone OpenWebBeans container", e);
      }

      BeanManager manager = lifecycle.getBeanManager();

      // start the application lifecycle
      ContextFactory.initApplicationContext(null);
      // start the session lifecycle
      HttpSession session = new MockHttpSession();
View Full Code Here

    @Test(dataProvider = ARQUILLIAN_DATA_PROVIDER)
    @SpecAssertions({ @SpecAssertion(section = "11.3.1", id = "ab") })
    public void testGetBeanManager(BravoMarker bravoMarker) {

        // Test BDA01
        BeanManager alphaManager = AlphaLocator.getBeanManager();
        assertNotNull(alphaManager);
        assertEquals(alphaManager.getBeans(Alpha.class, PowerfulLiteral.INSTANCE).size(), 1);
        // Bravo is an alternative enabled in BDA02 only
        assertEquals(alphaManager.getBeans(Bravo.class).size(), 0);

        // Test BDA02
        assertNotNull(bravoMarker);
        BeanManager bravoManager = bravoMarker.getBeanManager();
        assertNotNull(bravoManager);
        assertEquals(bravoManager.getBeans(Alpha.class, PowerfulLiteral.INSTANCE).size(), 1);
        assertEquals(bravoManager.getBeans(Bravo.class).size(), 1);
    }
View Full Code Here

            @SpecAssertion(section = "7.3.6", id = "o") })
    public void testProduceResourceProxy() {
        Bean<BeanManager> beanManagerBean = getBeans(BeanManager.class, new AnnotationLiteral<Another>() {
        }).iterator().next();
        CreationalContext<BeanManager> beanManagerCc = getCurrentManager().createCreationalContext(beanManagerBean);
        BeanManager beanManager = beanManagerBean.create(beanManagerCc);
        assert beanManager != null;
    }
View Full Code Here

        // may be improved for thread safety, but right now the only risk is to invoke wrapExpressionFactory
        // multiple times for concurrent threads. This is ok, as the call is
        if (expressionFactory == null) {
            synchronized (this) {
                if (expressionFactory == null) {
                    BeanManager bm = beanManager();
                    if (bm == null) {
                        expressionFactory = application.getExpressionFactory();
                    } else {
                        expressionFactory = bm.wrapExpressionFactory(application.getExpressionFactory());
                    }
                }
            }
        }
        return expressionFactory;
View Full Code Here

   private void fireResourceMoved(final File original)
   {
      if (resourceFactory != null)
      {
         BeanManager manager = resourceFactory.getManagerInstance();
         if (manager != null)
         {
            manager.fireEvent(
                     new ResourceRenamed(this, original.getAbsolutePath(), file.getAbsolutePath()));
         }
      }
   }
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.