org.apache.webbeans.component.OwbBean Java Examples

The following examples show how to use org.apache.webbeans.component.OwbBean. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: WebappBeanManager.java    From tomee with Apache License 2.0 6 votes vote down vote up
@Override
public boolean accept(final Bean<?> bean) {
    if (BuiltInOwbBean.class.isInstance(bean) || ExtensionBean.class.isInstance(bean)) {
        return false;
    }
    if (OwbBean.class.isInstance(bean)) {
        final OwbBean owbBean = OwbBean.class.cast(bean);
        if (owbBean.isPassivationCapable())
        {
            if (hasBean(owbBean.getId()))
            {
                return false;
            }
        }
    } else if (PassivationCapable.class.isInstance(bean)) {
        if (hasBean(PassivationCapable.class.cast(bean).getId())) {
            return false;
        }
    }

    final Set<Annotation> qualifiers = bean.getQualifiers();
    return beanManager.getBeans(
            bean.getBeanClass(),
            qualifiers.isEmpty() ? EMPTY_ANNOTATIONS : qualifiers.toArray(new Annotation[qualifiers.size()])).isEmpty();
}
 
Example #2
Source File: ProxyRefreshAgent.java    From HotswapAgent with GNU General Public License v2.0 3 votes vote down vote up
private static void recreateInterceptedProxy(ClassLoader appClassLoader, Bean bean, WebBeansContext wbc) {

        if (!(bean instanceof OwbBean) || bean instanceof Interceptor || bean instanceof Decorator) {
            return;
        }

        OwbBean owbBean = (OwbBean) bean;

        AbstractProducer producer = (AbstractProducer) owbBean.getProducer();
        AnnotatedType annotatedType = ((InjectionTargetBean) owbBean).getAnnotatedType();

        producer.defineInterceptorStack(bean, annotatedType, wbc);
    }