Refine search
Thread.currentThread().setContextClassLoader(appClassLoader); WebBeansContext wbc = WebBeansContext.currentInstance(); NormalScopeProxyFactory proxyFactory = wbc.getNormalScopeProxyFactory(); Set<Bean<?>> beans = wbc.getBeanManagerImpl().getBeans(beanClass); if (beans != null) { boolean recreateIt = false;
/** * Default constructor. */ public FailOverFilter() { WebBeansContext webBeansContext = WebBeansContext.currentInstance(); failoverService = webBeansContext.getService(FailOverService.class); }
/** * Default constructor */ public WebBeansConfigurationListener() { webBeansContext = WebBeansContext.getInstance(); contextsService = webBeansContext.getContextsService(); }
for (AnnotatedConstructor<X> constructor: annotatedType.getConstructors()) for (AnnotatedField<? super X> field: annotatedType.getFields()) if (webBeansContext.getBeanManagerImpl().isNormalScope(owner.getScope())) + owner.getBeanClass().getName()); for (AnnotatedMethod<? super X> method: webBeansContext.getAnnotatedElementFactory().getFilteredAnnotatedMethods(annotatedType)) if (method.isAnnotationPresent(Inject.class) && !Modifier.isStatic(method.getJavaMember().getModifiers()))
@Override public boolean findMissingAnnotatedType(final Class<?> missing) { // annotated element caches are empty at this point for (final Bean<?> b : getParent().getBeanManagerImpl().getBeans()) { if (b.getBeanClass() == missing) { return true; } } return false; } }
Set<Class<?>> xmlConfiguredAlternatives = webBeansContext.getAlternativesManager().getXmlConfiguredAlternatives(); InjectionResolver injectionResolver = webBeansContext.getBeanManagerImpl().getInjectionResolver(); if (alternativeClass.equals(exType.getKey().getJavaClass())) exType.getKey().getAnnotation(Alternative.class) != null) if (bean.isAlternative())
preDestroyMethod = ResourceUtils.findPreDestroyMethod(clazz); bm = webbeansContext.getBeanManagerImpl(); this.clazz = clazz; if (bm.isInUse()) { if (bean != null && bm.isNormalScope(bean.getScope())) { normalScopeCreator = new ProvidedInstanceBeanCreator(bm.getReference(bean, bean.getBeanClass(), bm.createCreationalContext(bean))); } else { normalScopeCreator = null;
if (bean == null) // try to find it BeanManagerImpl bm = webBeansContext.getBeanManagerImpl(); Set<Annotation> annotations = new HashSet<>(); for (Annotation a : annotatedType.getAnnotations()) Set<Bean<?>> beans = bm.getBeans(annotatedType.getJavaClass(), annotations.toArray(new Annotation[annotations.size()])); bean = (Bean<T>) bm.resolve(beans);
@SuppressWarnings("unchecked") protected P getParentInstanceFromContext(CreationalContext<?> creationalContext) { P parentInstance; Bean<?> specialize = WebBeansUtil.getMostSpecializedBean(webBeansContext.getBeanManagerImpl(), (AbstractOwbBean<T>) owner); if (specialize != null) { parentInstance = (P) webBeansContext.getBeanManagerImpl().getContext(specialize.getScope()). get((Bean<Object>)specialize,(CreationalContext<Object>) creationalContext); } else { parentInstance = (P) webBeansContext.getBeanManagerImpl().getContext( owner.getScope()).get((Bean<Object>)owner, (CreationalContext<Object>) creationalContext); } return parentInstance; } }
Class beanClass = at.getJavaClass(); boolean isEjb = discoverEjb && EJBWebBeansConfigurator.isSessionBean(beanClass, webBeansContext); try = webBeansContext.getWebBeansUtil().fireProcessBeanAttributes(at, at.getJavaClass(), beanAttributes); if (processBeanAttributes != null) if (!webBeansContext.getBeanManagerImpl().isStereotype((stereotype)))
BeanManagerImpl bm = webBeansContext.getBeanManagerImpl(); for (Map<AnnotatedType<?>, ExtendedBeanAttributes<?>> beanAttributesMap : beanAttributesPerBda.values()) logger.info("Skipping deployment of Class " + annotatedType.getKey().getJavaClass() + "due to a NoClassDefFoundError: " + ncdfe.getMessage());
final BeanManagerImpl mgr; try { final WebBeansContext wbc = WebBeansContext.currentInstance(); mgr = wbc.getBeanManagerImpl(); if (!mgr.isInUse()) { // not yet the time to use CDI, container is not started return PasswordCipher.class.cast(mgr.getReference(bean, PasswordCipher.class, cc)).decrypt(pwd); } finally { if (!mgr.isNormalScope(bean.getScope())) { cc.release();
private boolean isOwbApplication() { if (owbApplication == null) { owbApplication = WebBeansContext.getInstance().getBeanManagerImpl().isInUse(); } return owbApplication; }
public Provider getInstanceProvider(ClassLoader classLoader, Bean<?> bean) String scopeClassName = bean.getScope().getName(); Class<? extends Provider> instanceProviderClass = null; String proxyMappingConfigKey = OpenWebBeansConfiguration.PROXY_MAPPING_PREFIX + scopeClassName; String className = webBeansContext.getOpenWebBeansConfiguration().getProperty(proxyMappingConfigKey); if (className == null || NormalScopedBeanInterceptorHandler.class.getName().equals(className)) return new NormalScopedBeanInterceptorHandler(webBeansContext.getBeanManagerImpl(), bean); return (Provider) ct.newInstance(webBeansContext.getBeanManagerImpl(), bean);
Provider<T> provider = webBeansContext.getNormalScopeProxyFactory().getInstanceProvider(proxy); NormalScopedBeanInterceptorHandler handler = (NormalScopedBeanInterceptorHandler)provider; Bean<T> bean = (Bean<T>)handler.getBean(); Class<? extends Annotation> beanScope = bean.getScope(); Context currentContext = webBeansContext.getBeanManagerImpl().getContext(beanScope); if (currentContext instanceof AlterableContext)
if (instance == null) { try { bm = WebBeansContext.currentInstance().getBeanManagerImpl(); if (bm.isInUse()) { final AnnotatedType<T> annotatedType = bm.createAnnotatedType(clazz); injectionTarget.inject(instance, creationalContext); injectionTarget.postConstruct(instance); for (final Annotation annotation : annotatedType.getAnnotations()) { if (bm.isNormalScope(annotation.annotationType())) { creationalContext = null;
@Override public void startRequestScope() throws Exception { logger.log(Level.FINE, "starting the OWB RequestContext"); WebBeansContext webBeansContext = WebBeansContext.currentInstance(); ContextsService contextsService = webBeansContext.getContextsService(); contextsService.startContext(RequestScoped.class, null); }
else if(webBeansContext.getBeanManagerImpl().isPassivatingScope(beanObj.getScope())) webBeansContext.getDeploymentValidationService().validatePassivationCapable((OwbBean<?>)beanObj);
final boolean isDependent = getScope().equals(Dependent.class); isDependentAndStateful = isDependent && stateful; if (webBeansContext.getBeanManagerImpl().isPassivatingScope(getScope()) && stateful) { if (!getBeanContext().isPassivable()) { throw new DefinitionException( if (getAnnotatedType().isAnnotationPresent(Interceptor.class) || getAnnotatedType().isAnnotationPresent(Decorator.class)) { throw new DefinitionException("An EJB can't be an interceptor or a decorator: " + beanClass);
for (Bean<?> bean : webBeansContext.getBeanManagerImpl().getBeans()) if (bean.isAlternative()) String name = bean.getName(); if (name != null)