private BeanManager beanManager(final String appName) { return appContext(appName).getBeanManager(); }
private BeanManager beanManager(final String appName) { return appContext(appName).getBeanManager(); }
public Object beanFromClass(final String appName, final String classname) { final AppContext appContext = appContext(appName); final BeanManager bm = appContext.getBeanManager(); final Class<?> clazz; try { clazz = appContext.getClassLoader().loadClass(classname); } catch (final ClassNotFoundException e) { throw new OpenEJBRuntimeException(e); } final Set<Bean<?>> beans = bm.getBeans(clazz); return instance(bm, beans, clazz); }
public Object beanFromClass(final String appName, final String classname) { final AppContext appContext = appContext(appName); final BeanManager bm = appContext.getBeanManager(); final Class<?> clazz; try { clazz = appContext.getClassLoader().loadClass(classname); } catch (final ClassNotFoundException e) { throw new OpenEJBRuntimeException(e); } final Set<Bean<?>> beans = bm.getBeans(clazz); return instance(bm, beans, clazz); }
public void produce(@Observes final BeforeClass bs) { try { final Assembler a = SystemInstance.get().getComponent(Assembler.class); context.set(a.getContainerSystem().getJNDIContext()); beanManager.set(a.getContainerSystem().getAppContext(a.getDeployedApplications().iterator().next().appId).getBeanManager()); } catch (final Exception e) { // no-op } } }
public void produce(@Observes final BeforeClass bs) { try { final Assembler a = SystemInstance.get().getComponent(Assembler.class); context.set(a.getContainerSystem().getJNDIContext()); beanManager.set(a.getContainerSystem().getAppContext(a.getDeployedApplications().iterator().next().appId).getBeanManager()); } catch (final Exception e) { // no-op } } }
if (appContext.getBeanManager() != null) { OWBInjector.inject(appContext.getBeanManager(), inputTestInstance, null);
comp.rebind("BeanManager", webContext.getAppContext().getBeanManager());
new CdiBuilder().build(appInfo, appContext, allDeployments); ensureWebBeansContext(appContext); appJndiContext.bind("app/BeanManager", appContext.getBeanManager()); appContext.getBindings().put("app/BeanManager", appContext.getBeanManager()); } else { // ensure we can reuse it in tomcat to remove OWB filters appInfo.properties.setProperty("openejb.cdi.activated", "false");
new CdiBuilder().build(appInfo, appContext, allDeployments); ensureWebBeansContext(appContext); appJndiContext.bind("app/BeanManager", appContext.getBeanManager()); appContext.getBindings().put("app/BeanManager", appContext.getBeanManager());
OWBInjector.inject(appContext.getBeanManager(), inputTestInstance, null); } catch (final Throwable t) { error = t;