public OpenWebBeansJavaEEPlugin getJavaEEPlugin() { if(!pluginsExist()) { return null; } for(OpenWebBeansPlugin plugin : plugins) { if(plugin instanceof OpenWebBeansJavaEEPlugin) { return (OpenWebBeansJavaEEPlugin)plugin; } } return null; }
public CdiResourceInjectionService(final WebBeansContext context) { ejbPlugin = CdiPlugin.class.cast(context.getPluginLoader().getEjbPlugin()); }
protected InterceptorBeanBuilder(WebBeansContext webBeansContext, AnnotatedType<T> annotatedType, BeanAttributes<T> beanAttributes) { Asserts.assertNotNull(webBeansContext, Asserts.PARAM_NAME_WEBBEANSCONTEXT); Asserts.assertNotNull(annotatedType, "annotated type"); Asserts.assertNotNull(beanAttributes, "beanAttributes"); this.webBeansContext = webBeansContext; this.annotatedType = annotatedType; this.beanAttributes = beanAttributes; ejbPlugin = webBeansContext.getPluginLoader().getEjbLCAPlugin(); if (ejbPlugin != null) { prePassivateClass = ejbPlugin.getPrePassivateClass(); postActivateClass = ejbPlugin.getPostActivateClass(); } else { prePassivateClass = null; postActivateClass = null; } }
OpenWebBeansEjbPlugin ejbPlugin = webBeansContext.getPluginLoader().getEjbPlugin(); if(ejbPlugin == null) OpenWebBeansJmsPlugin jmsPlugin = webBeansContext.getPluginLoader().getJmsPlugin(); if(jmsPlugin == null) return jmsPlugin.getJmsBeanProxy(bean, ClassUtil.getClass(beanType));
private boolean isEEComponent(Class<?> impl) { OpenWebBeansJavaEEPlugin eePlugin = webBeansContext.getPluginLoader().getJavaEEPlugin(); return eePlugin != null && eePlugin.isEEComponent(impl); }
List<OpenWebBeansPlugin> plugins = webBeansContext.getPluginLoader().getPlugins(); for (OpenWebBeansPlugin plugin : plugins)
private static Map<Class<?>, BeanContext> pluginBeans(final WebBeansContext ctx) { return CdiPlugin.class.cast(ctx.getPluginLoader().getEjbPlugin()).beans; }
/** * Gets ejb plugin * * @return ejb plugin */ public OpenWebBeansEjbPlugin getEjbPlugin() { if(!pluginsExist()) { return null; } for(OpenWebBeansPlugin plugin : plugins) { if(plugin instanceof OpenWebBeansEjbPlugin) { return (OpenWebBeansEjbPlugin)plugin; } } return null; }
OpenWebBeansJavaEEPlugin beanEeProvider = webBeansContext.getPluginLoader().getJavaEEPlugin();
private <T> T doServiceLoader(Class<T> serviceInterface) { String implName = getOpenWebBeansConfiguration().getProperty(serviceInterface.getName()); if (implName == null) { //Look for plugins List<OpenWebBeansPlugin> plugins = getPluginLoader().getPlugins(); if(plugins != null && plugins.size() > 0) { for(OpenWebBeansPlugin plugin : plugins) { if(plugin.supportService(serviceInterface)) { return plugin.getSupportedService(serviceInterface); } } } return null; } return serviceInterface.cast(get(implName)); }
private static Map<Class<?>, BeanContext> pluginBeans(final WebBeansContext ctx) { return CdiPlugin.class.cast(ctx.getPluginLoader().getEjbPlugin()).beans; }
/** * Gets the JMS plugin * * @return jms plugin */ public OpenWebBeansJmsPlugin getJmsPlugin() { if(!pluginsExist()) { return null; } for(OpenWebBeansPlugin plugin : plugins) { if(plugin instanceof OpenWebBeansJmsPlugin) { return (OpenWebBeansJmsPlugin)plugin; } } return null; }
public CdiResourceInjectionService(final WebBeansContext context) { ejbPlugin = CdiPlugin.class.cast(context.getPluginLoader().getEjbPlugin()); }
/** * Gets ejb lifecycle annotations plugin * * @return ejb LCA plugin */ public OpenWebBeansEjbLCAPlugin getEjbLCAPlugin() { if(!pluginsExist()) { return null; } for(OpenWebBeansPlugin plugin : plugins) { if(plugin instanceof OpenWebBeansEjbLCAPlugin) { return (OpenWebBeansEjbLCAPlugin)plugin; } } return null; } /**
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>(); } } }
public SpecializationUtil(WebBeansContext webBeansContext) { this.webBeansContext = webBeansContext; this.alternativesManager = webBeansContext.getAlternativesManager(); this.webBeansUtil = webBeansContext.getWebBeansUtil(); this.ejbPlugin = webBeansContext.getPluginLoader().getEjbPlugin(); }
/** * 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); }
/** * 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); }
/** * {@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(); }