congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
BeanAttributesImpl
Code IndexAdd Tabnine to your IDE (free)

How to use
BeanAttributesImpl
in
org.apache.webbeans.component

Best Java code snippets using org.apache.webbeans.component.BeanAttributesImpl (Showing top 20 results out of 315)

origin: HotswapProjects/HotswapAgent

@SuppressWarnings({ "rawtypes", "unchecked" })
private static void createAnnotatedTypeForExistingBeanClass(BeanManagerImpl beanManager, InjectionTargetBean bean) {
  WebBeansContext wbc = beanManager.getWebBeansContext();
  AnnotatedElementFactory annotatedElementFactory = wbc.getAnnotatedElementFactory();
  // Clear AnnotatedElementFactory caches
  annotatedElementFactory.clear();
  AnnotatedType annotatedType = annotatedElementFactory.newAnnotatedType(bean.getBeanClass());
  ReflectionHelper.set(bean, InjectionTargetBean.class, "annotatedType", annotatedType);
  // Updated members that were set by bean attributes
  BeanAttributesImpl attributes = BeanAttributesBuilder.forContext(wbc).newBeanAttibutes(annotatedType).build();
  ReflectionHelper.set(bean, BeanAttributesImpl.class, "types", attributes.getTypes());
  ReflectionHelper.set(bean, BeanAttributesImpl.class, "qualifiers", attributes.getQualifiers());
  ReflectionHelper.set(bean, BeanAttributesImpl.class, "scope", attributes.getScope());
  ReflectionHelper.set(bean, BeanAttributesImpl.class, "name", attributes.getName());
  ReflectionHelper.set(bean, BeanAttributesImpl.class, "stereotypes", attributes.getStereotypes());
  ReflectionHelper.set(bean, BeanAttributesImpl.class, "alternative", attributes.isAlternative());
  InjectionTargetFactory factory = new InjectionTargetFactoryImpl(annotatedType, bean.getWebBeansContext());
  InjectionTarget injectionTarget = factory.createInjectionTarget(bean);
  ReflectionHelper.set(bean, InjectionTargetBean.class, "injectionTarget", injectionTarget);
  LOGGER.debug("New annotated type created for bean '{}'", bean.getBeanClass());
}
origin: org.apache.openwebbeans/openwebbeans-impl

  public BeanAttributes<T> getBeanAttributes()
  {
    // make sure we always have an @Any Qualifier as well.
    qualifiers.add(AnyLiteral.INSTANCE);

    return new BeanAttributesImpl<>(types, qualifiers, scope, name, false, stereotypes, alternative);
  }
}
origin: org.apache.openwebbeans/openwebbeans-impl

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;
}

origin: org.apache.openwebbeans/openwebbeans-impl

(!beanAttributes.isAlternative() || isEnabledAlternative(at, beanAttributes.getStereotypes())))
origin: org.apache.openwebbeans/openwebbeans-jms

return new JmsBean<>(webBeansContext, model, new BeanAttributesImpl<>(apiTypes, qualifiers));
origin: org.apache.openwebbeans/openwebbeans-impl

protected BuiltInOwbBean(
    WebBeansContext webBeansContext,
    WebBeansType webBeansType,
    BeanAttributesImpl<T> beanAttributes,
    Class<T> returnType,
    boolean nullable,
    ProducerFactory<T> producerFactory)
{
  super(webBeansContext, webBeansType, beanAttributes, returnType, nullable);
  Asserts.assertNotNull(producerFactory, "ProducerFactory");
  producer = producerFactory.createProducer(this);
}

origin: org.apache.openwebbeans/openwebbeans-impl

public InjectionPointBean(WebBeansContext webBeansContext)
{
  super(webBeansContext,
     WebBeansType.INJECTIONPOINT,
     new BeanAttributesImpl<>(CollectionUtil.<Type>unmodifiableSet(InjectionPoint.class, Object.class)),
     InjectionPoint.class,
     false,
     new SimpleProducerFactory<>(new InjectionPointProducer()));
}
origin: org.apache.openwebbeans/openwebbeans-impl

public EventMetadataBean(WebBeansContext webBeansContext)
{
  super(webBeansContext,
     WebBeansType.METADATA,
     new BeanAttributesImpl<>(CollectionUtil.<Type>unmodifiableSet(EventMetadata.class, Object.class)),
     EventMetadata.class,
     false,
     new SimpleProducerFactory<>(new EventMetadataProducer()));
}

origin: org.apache.openwebbeans/openwebbeans-impl

public BeanManagerBean(WebBeansContext webBeansContext)
{
  super(webBeansContext,
     WebBeansType.MANAGER,
     new BeanAttributesImpl<>(CollectionUtil.<Type>unmodifiableSet(BeanManager.class, Object.class), AnnotationUtil.DEFAULT_AND_ANY_ANNOTATION_SET),
     BeanManager.class,
     false,
     new SimpleProducerFactory<>(new BeanManagerProducer(webBeansContext)));
}

origin: org.apache.openwebbeans/openwebbeans-impl

public InterceptionFactoryBean(WebBeansContext webBeansContext)
{
  super(webBeansContext,
      WebBeansType.INTERCEPTIONFACTORY,
      new BeanAttributesImpl<>(
          CollectionUtil.<Type>unmodifiableSet(InterceptionFactory.class, Object.class),
          AnnotationUtil.DEFAULT_AND_ANY_ANNOTATION_SET),
      InterceptionFactory.class,
      false,
      new SimpleProducerFactory<>(new InterceptionFactoryProducer(webBeansContext)));
}
origin: org.apache.openwebbeans/openwebbeans-impl

public RequestContextControllerBean(WebBeansContext webBeansContext)
{
  super(webBeansContext,
      WebBeansType.MANAGER,
      new BeanAttributesImpl<>(CollectionUtil.unmodifiableSet(RequestContextController.class, Object.class),
          AnnotationUtil.DEFAULT_AND_ANY_ANNOTATION_SET),
      RequestContextController.class,
      false,
      new SimpleProducerFactory<>(new RequestContextControllerProducer(webBeansContext)));
}
origin: org.apache.openwebbeans/openwebbeans-impl

@SuppressWarnings("serial")
public InterceptorMetadataBean(WebBeansContext webBeansContext)
{
  super(webBeansContext,
    WebBeansType.METADATA,
    new BeanAttributesImpl<>(CollectionUtil.<Type>unmodifiableSet(Interceptor.class, Object.class)),
    new TypeLiteral<Interceptor<T>>(){}.getRawType(),
    false,
    new SimpleProducerFactory<>(new MetadataProducer<Interceptor<T>>()));
}

origin: org.apache.openwebbeans/openwebbeans-impl

@SuppressWarnings("serial")
public InstanceBean(WebBeansContext webBeansContext)
{
  super(webBeansContext,
    WebBeansType.INSTANCE,
    new BeanAttributesImpl(CollectionUtil.unmodifiableSet(Instance.class, Provider.class, Object.class)),
    new TypeLiteral<Instance<T>>(){}.getRawType(),
    false,
    new SimpleProducerFactory(new InstanceProducer(webBeansContext)));
}
origin: org.apache.openwebbeans/openwebbeans-impl

@SuppressWarnings("serial")
public BeanMetadataBean(WebBeansContext webBeansContext)
{
  super(webBeansContext,
     WebBeansType.METADATA,
     new BeanAttributesImpl<>(CollectionUtil.<Type>unmodifiableSet(Bean.class, Contextual.class, Object.class)),
     new TypeLiteral<Bean<T>>(){}.getRawType(),
     false,
     new SimpleProducerFactory<>(new MetadataProducer<Bean<T>>()));
}

origin: org.apache.openwebbeans/openwebbeans-impl

@SuppressWarnings("serial")
public DecoratorMetadataBean(WebBeansContext webBeansContext)
{
  super(webBeansContext,
     WebBeansType.METADATA,
     new BeanAttributesImpl<>(CollectionUtil.<Type>unmodifiableSet(Decorator.class, Object.class)),
     new TypeLiteral<Decorator<T>>(){}.getRawType(),
     false,
     new SimpleProducerFactory<>(new MetadataProducer<Decorator<T>>()));
}

origin: org.apache.openwebbeans/openwebbeans-impl

@SuppressWarnings("serial")
public InterceptedOrDecoratedBeanMetadataBean(WebBeansContext webBeansContext)
{
  super(webBeansContext,
    WebBeansType.METADATA,
    new BeanAttributesImpl<>(
      CollectionUtil.<Type>unmodifiableSet(Bean.class, Contextual.class, Object.class),
      CollectionUtil.<Annotation>unmodifiableSet(new AnnotationLiteral<Intercepted>()
      {
      }, new AnnotationLiteral<Decorated>()
      {
      })),
    new TypeLiteral<Bean<T>>(){}.getRawType(),
    false,
    new SimpleProducerFactory<>(new BeanMetadataProducer<Bean<T>>()));
}

origin: org.apache.openwebbeans/openwebbeans-impl

/**
 * Default constructor.
 * @param webBeansContext
 */
public ConversationBean(WebBeansContext webBeansContext)
{
  super(webBeansContext,
     WebBeansType.CONVERSATION,
       new BeanAttributesImpl<>(
        CollectionUtil.<Type>unmodifiableSet(Conversation.class, ConversationImpl.class, Object.class),
        AnnotationUtil.DEFAULT_AND_ANY_ANNOTATION_SET,
        RequestScoped.class,
        "javax.enterprise.context.conversation",
        false,
        Collections.<Class<? extends Annotation>>emptySet(),
        false),
     ConversationImpl.class,
     false,
     new SimpleProducerFactory<>(
        new ConversationProducer(webBeansContext.getAnnotatedElementFactory().newAnnotatedType(ConversationImpl.class), webBeansContext)));
  setEnabled(true);
}
origin: org.apache.openwebbeans/openwebbeans-impl

/**
 * New WebBeans component class.
 *
 * @return the new component
 */
public <T> NewManagedBean<T> createNewComponent(OwbBean<T> bean, Class<T> type)
{
  Asserts.assertNotNull(bean, "bean");
  if (!EnumSet.of(WebBeansType.MANAGED, WebBeansType.ENTERPRISE, WebBeansType.PRODUCERMETHOD, WebBeansType.PRODUCERFIELD).contains(bean.getWebBeansType()))
  {
    throw new WebBeansConfigurationException("@New annotation on type : " + bean.getBeanClass()
        + " must defined as a simple or an enterprise web bean");
  }
  AnnotatedType<T> annotatedType = webBeansContext.getAnnotatedElementFactory().newAnnotatedType(type);
  BeanAttributesImpl<T> newBeanAttributes = new BeanAttributesImpl<>(bean.getTypes(), Collections.<Annotation>singleton(new NewLiteral(type)));
  NewManagedBean<T> newBean = new NewManagedBean<>(bean.getWebBeansContext(), bean.getWebBeansType(), annotatedType, newBeanAttributes, type, bean.getInjectionPoints());
  //TODO XXX set producer
  return newBean;
}
origin: org.apache.openwebbeans/openwebbeans-impl

/**
 * Creates a new extesion bean.
 * 
 * @param returnType return type
 * @param webBeansContext
 */
public ExtensionBean(WebBeansContext webBeansContext, Class<T> returnType)
{
  super(webBeansContext,
     WebBeansType.EXTENSION,
     new BeanAttributesImpl<>(
     webBeansContext.getAnnotatedElementFactory().getAnnotatedType(returnType).getTypeClosure(),
     AnnotationUtil.DEFAULT_AND_ANY_ANNOTATION_SET,
     ApplicationScoped.class),
     returnType,
     false,
     new ExtensionProducerFactory<>(webBeansContext.getAnnotatedElementFactory().getAnnotatedType(returnType), webBeansContext));
}
origin: org.apache.openwebbeans/openwebbeans-impl

/**
 * Creates a new instance of event bean.
 * @param webBeansContext
 */
@SuppressWarnings("serial")
public EventBean(WebBeansContext webBeansContext)
{
  super(webBeansContext,
     WebBeansType.OBSERVABLE,
     new BeanAttributesImpl<>(CollectionUtil.<Type>unmodifiableSet(new TypeLiteral<Event<T>>()
     {
     }.getRawType(), Object.class)),
     new TypeLiteral<Event<T>>(){}.getRawType(),
     false,
     new SimpleProducerFactory<>(new EventProducer<T>(webBeansContext)));
}

org.apache.webbeans.componentBeanAttributesImpl

Most used methods

  • <init>
  • getStereotypes
  • getTypes
  • isAlternative
  • getName
  • getQualifiers
  • getScope

Popular in Java

  • Finding current android device location
  • notifyDataSetChanged (ArrayAdapter)
  • addToBackStack (FragmentTransaction)
  • setRequestProperty (URLConnection)
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • BufferedImage (java.awt.image)
    The BufferedImage subclass describes an java.awt.Image with an accessible buffer of image data. All
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now