public CdiResourceInjectionService(final WebBeansContext context) { ejbPlugin = CdiPlugin.class.cast(context.getPluginLoader().getEjbPlugin()); }
private static Map<Class<?>, BeanContext> pluginBeans(final WebBeansContext ctx) { return CdiPlugin.class.cast(ctx.getPluginLoader().getEjbPlugin()).beans; }
private static Map<Class<?>, BeanContext> pluginBeans(final WebBeansContext ctx) { return CdiPlugin.class.cast(ctx.getPluginLoader().getEjbPlugin()).beans; }
public CdiResourceInjectionService(final WebBeansContext context) { ejbPlugin = CdiPlugin.class.cast(context.getPluginLoader().getEjbPlugin()); }
public void setWebBeansContext(final WebBeansContext webBeansContext) { this.webBeansContext = webBeansContext; if (!WebappWebBeansContext.class.isInstance(webBeansContext)) { cacheProxies = new ConcurrentHashMap<Contextual<?>, Object>(); } else { // share cache of proxies between the whole app otherwise hard to share an EJB between a webapp and the lib part of the app cacheProxies = CdiPlugin.class.cast(WebappWebBeansContext.class.cast(webBeansContext).getParent().getPluginLoader().getEjbPlugin()).cacheProxies; } }
public void setWebBeansContext(final WebBeansContext webBeansContext) { this.webBeansContext = webBeansContext; if (webBeansContext == null) { return; } if (!WebappWebBeansContext.class.isInstance(webBeansContext)) { cacheProxies = new ConcurrentHashMap<Contextual<?>, Object>(); } else { // share cache of proxies between the whole app otherwise hard to share an EJB between a webapp and the lib part of the app final WebBeansContext parent = WebappWebBeansContext.class.cast(webBeansContext).getParent(); if (parent != null) { cacheProxies = CdiPlugin.class.cast(parent.getPluginLoader().getEjbPlugin()).cacheProxies; } else { cacheProxies = new ConcurrentHashMap<Contextual<?>, Object>(); } } }
/** * Returns ejb bean. * @param webBeansContext * @param <T> bean class info * @param clazz bean class * @return ejb bean */ public static <T> Bean<T> defineEjbBean(Class<T> clazz, AnnotatedType<T> annotatedType, BeanAttributes<T> attributes, WebBeansContext webBeansContext) { PluginLoader loader = webBeansContext.getPluginLoader(); OpenWebBeansEjbPlugin ejbPlugin = loader.getEjbPlugin(); if(ejbPlugin == null) { throw new IllegalStateException("There is no provided EJB plugin. Unable to define session bean for class : " + clazz.getName()); } return ejbPlugin.defineSessionBean(clazz, attributes, annotatedType); }
/** * Returns true if given class is an deployed ejb bean class, false otherwise. * @param clazz bean class * @param webBeansContext * @return true if given class is an deployed ejb bean class * @throws WebBeansConfigurationException if any exception occurs */ public static boolean isSessionBean(Class<?> clazz, WebBeansContext webBeansContext) throws WebBeansConfigurationException { PluginLoader loader = webBeansContext.getPluginLoader(); OpenWebBeansEjbPlugin ejbPlugin = loader.getEjbPlugin(); //There is no ejb container if(ejbPlugin == null) { return false; } return ejbPlugin.isSessionBean(clazz); }
public SpecializationUtil(WebBeansContext webBeansContext) { this.webBeansContext = webBeansContext; this.alternativesManager = webBeansContext.getAlternativesManager(); this.webBeansUtil = webBeansContext.getWebBeansUtil(); this.ejbPlugin = webBeansContext.getPluginLoader().getEjbPlugin(); }
/** * {@inheritDoc} */ public <T> BeanAttributes<T> createBeanAttributes(AnnotatedType<T> type) { OpenWebBeansEjbPlugin ejbPlugin = webBeansContext.getPluginLoader().getEjbPlugin(); if (ejbPlugin != null && ejbPlugin.isSessionBean(type.getJavaClass())) { return ejbPlugin.createBeanAttributes(type); } return BeanAttributesBuilder.forContext(webBeansContext).newBeanAttibutes(type).build(); }
OpenWebBeansEjbPlugin ejbPlugin = webBeansContext.getPluginLoader().getEjbPlugin(); if(ejbPlugin == null)
public ProducerMethodProducer(Bean<P> owner, AnnotatedMethod<? super P> producerMethod, AnnotatedMethod<? super P> disposerMethod, Set<InjectionPoint> points, Set<InjectionPoint> disposalIPs, WebBeansContext webBeansContext) { super(owner, disposerMethod, points, disposalIPs, webBeansContext); Asserts.assertNotNull(producerMethod, "producerMethod"); if (!producerMethod.isStatic()) { if (owner == null) { throw new IllegalArgumentException("owner may not be null for non-static producer method " + producerMethod); } } OpenWebBeansEjbPlugin ejbPlugin = webBeansContext.getPluginLoader().getEjbPlugin(); if (ejbPlugin != null) { this.producerMethod = ejbPlugin.resolveViewMethod(owner, producerMethod.getJavaMember()); } else { this.producerMethod = producerMethod.getJavaMember(); } }
final CdiPlugin plugin = CdiPlugin.class.cast(appContext.getWebBeansContext().getPluginLoader().getEjbPlugin()); if (!plugin.isSessionBean(reference.getResourceType())) { // local beans are here and access is O(1) instead of O(n) boolean ok = false;
final CdiPlugin cdiPlugin = (CdiPlugin) webBeansContext.getPluginLoader().getEjbPlugin();
this.disposalIPs = disposalIPs; OpenWebBeansEjbPlugin ejbPlugin = webBeansContext.getPluginLoader().getEjbPlugin(); if (ejbPlugin != null)
public <T> Bean<T> createNewComponent(Class<T> type) { Asserts.nullCheckForClass(type); OpenWebBeansEjbPlugin ejbPlugin = webBeansContext.getPluginLoader().getEjbPlugin(); if (ejbPlugin != null && ejbPlugin.isNewSessionBean(type)) { return ejbPlugin.defineNewSessionBean(type); } AnnotatedType<T> annotatedType = webBeansContext.getAnnotatedElementFactory().newAnnotatedType(type); BeanAttributesImpl<T> defaultBeanAttributes = BeanAttributesBuilder.forContext(webBeansContext).newBeanAttibutes(annotatedType).build(); BeanAttributesImpl<T> newBeanAttributes = new BeanAttributesImpl<>(defaultBeanAttributes.getTypes(), Collections.<Annotation>singleton(new NewLiteral(type))); // TODO replace this by InjectionPointBuilder ManagedBeanBuilder<T, ManagedBean<T>> beanBuilder = new ManagedBeanBuilder<>(webBeansContext, annotatedType, newBeanAttributes, false); NewManagedBean<T> newBean = new NewManagedBean<>(webBeansContext, WebBeansType.MANAGED, annotatedType, newBeanAttributes, type, beanBuilder.getBean().getInjectionPoints()); return newBean; }
OpenWebBeansEjbPlugin ejbPlugin = getWebBeansContext().getPluginLoader().getEjbPlugin(); if (ejbPlugin != null && ejbPlugin.isNewSessionBean(ownerBean.getBeanClass()))
((CdiPlugin) webBeansContext.getPluginLoader().getEjbPlugin()).clearProxies(); webBeansContext.getPluginLoader().shutDown();
EjbPlugin plugin =(EjbPlugin) WebBeansContext.getInstance().getPluginLoader().getEjbPlugin(); return plugin.getEjbInstance(intf, resourceReference.getResourceType());
((CdiPlugin) webBeansContext.getPluginLoader().getEjbPlugin()).clearProxies(); webBeansContext.getPluginLoader().shutDown();