Tabnine Logo
AbstractBean
Code IndexAdd Tabnine to your IDE (free)

How to use
AbstractBean
in
org.jboss.weld.bean

Best Java code snippets using org.jboss.weld.bean.AbstractBean (Showing top 20 results out of 315)

Refine searchRefine arrow

  • Annotated
  • SpecializationAndEnablementRegistry
  • ContainerLifecycleEvents
  • BeanLogger
  • BeanDeployerEnvironment
origin: weld/core

protected void postSpecialize() {
  // Override qualifiers and the bean name
  Set<Annotation> qualifiers = new HashSet<Annotation>();
  for (Annotation qualifier : attributes().getQualifiers()) {
    // Don't include implicit javax.enterprise.inject.Default qualifier
    if (!qualifier.equals(Default.Literal.INSTANCE) || getAnnotated().isAnnotationPresent(Default.class)) {
      qualifiers.add(qualifier);
    }
  }
  String name = attributes().getName();
  for (AbstractBean<?, ?> specializedBean : getSpecializedBeans()) {
    qualifiers.addAll(specializedBean.getQualifiers());
    if (specializedBean.getName() != null) {
      name = specializedBean.getName();
    }
  }
  setAttributes(new ImmutableBeanAttributes<T>(qualifiers, name, attributes()));
}
origin: weld/core

/**
 * Initializes specialization. This method is called before {@link ProcessBeanAttributes} is fired and also after the event
 * if the {@link BeanAttributes} have been altered.
 */
@Override
public void preInitialize() {
  synchronized (this) {
    if (isSpecializing() && !preInitialized) {
      preInitialized = true;
      preSpecialize();
      specialize();
      checkSpecialization();
      postSpecialize();
    }
  }
}
origin: org.jboss.weld.se/weld-se

@Override
public void initializeAfterBeanDiscovery() {
  checkType();
}
origin: weld/core

/**
 * Initializes the bean and its metadata
 */
@Override
public void internalInitialize(BeanDeployerEnvironment environment) {
  preInitialize();
  BeanLogger.LOG.creatingBean(getType());
  if (getScope() != null) {
    proxyRequired = isNormalScoped();
  } else {
    proxyRequired = false;
  }
  BeanLogger.LOG.qualifiersUsed(getQualifiers(), this);
  BeanLogger.LOG.usingName(getName(), this);
  BeanLogger.LOG.usingScope(getScope(), this);
}
origin: weld/core

if (isSpecializing()) {
  boolean isNameDefined = getAnnotated().isAnnotationPresent(Named.class);
  String previousSpecializedBeanName = null;
  for (AbstractBean<?, ?> specializedBean : getSpecializedBeans()) {
    String name = specializedBean.getName();
    if (previousSpecializedBeanName != null && name != null && !previousSpecializedBeanName.equals(specializedBean.getName())) {
      throw BeanLogger.LOG.beansWithDifferentBeanNamesCannotBeSpecialized(previousSpecializedBeanName, specializedBean.getName(), this);
      throw BeanLogger.LOG.nameNotAllowedOnSpecialization(getAnnotated(), specializedBean.getAnnotated());
        && specializedBean.getBeanClass().getTypeParameters().length > 0
        && !(((AbstractClassBean<?>) this).getBeanClass().getGenericSuperclass() instanceof ParameterizedType));
    for (Type specializedType : specializedBean.getTypes()) {
      if (rawInsteadOfGeneric && specializedType instanceof ParameterizedType) {
        throw BeanLogger.LOG.specializingBeanMissingSpecializedType(this, specializedType, specializedBean);
      boolean contains = getTypes().contains(specializedType);
      if (!contains) {
        for (Type specializingType : getTypes()) {
origin: org.jboss.weld.se/weld-se

public boolean isSpecializing() {
  return getAnnotated().isAnnotationPresent(Specializes.class);
}
origin: org.jboss.weld.se/weld-se

  protected <T, S> boolean fireProcessBeanAttributes(AbstractBean<T, S> bean) {
    if (!specializationAndEnablementRegistry.isCandidateForLifecycleEvent(bean)) {
      return false;
    }

    ProcessBeanAttributesImpl<T> event = containerLifecycleEvents.fireProcessBeanAttributes(getManager(), bean, bean.getAnnotated(), bean.getType());
    if (event == null) {
      return false;
    }
    if (event.isVeto()) {
      return true;
    }
    if (event.isDirty()) {
      bean.setAttributes(ExternalBeanAttributesFactory.<T>of(event.getBeanAttributesInternal(), manager));
      bean.checkSpecialization();
    }
    return false;
  }
}
origin: org.jboss.weld.se/weld-se

public void destroy(T instance, CreationalContext<T> creationalContext) {
  super.destroy(instance, creationalContext);
  try {
    getProducer().dispose(instance);
  } catch (Exception e) {
    BeanLogger.LOG.errorDestroying(instance, this);
    BeanLogger.LOG.catchingDebug(e);
  } finally {
    if (getDeclaringBean().isDependent()) {
      creationalContext.release();
    }
  }
}
origin: org.jboss.weld.se/weld-se

protected Set<? extends AbstractBean<?, ?>> getSpecializedBeans() {
  return getBeanManager().getServices().get(SpecializationAndEnablementRegistry.class).resolveSpecializedBeans(this);
}
origin: weld/core

public void addNewBeansFromInjectionPoints(AbstractBean<?, ?> bean) {
  addNewBeansFromInjectionPoints(bean.getInjectionPoints());
}
origin: weld/core

protected static <X> void fire(BeanManagerImpl beanManager, AbstractBean<X, ?> bean) {
  fire(beanManager, bean, bean.getAnnotated());
}
origin: org.jboss.weld.se/weld-se

public void vetoBean(AbstractBean<?, ?> bean) {
  beans.remove(bean);
  if (bean instanceof AbstractClassBean<?>) {
    classBeanMap.get(bean.getBeanClass()).remove(bean);
    if (bean instanceof InterceptorImpl<?>) {
      interceptors.remove(bean);
    }
    if (bean instanceof DecoratorImpl<?>) {
      decorators.remove(bean);
    }
  }
  if (bean instanceof ProducerMethod<?, ?>) {
    ProducerMethod<?, ?> producerMethod = cast(bean);
    producerMethodBeanMap.get(WeldMethodKey.of(producerMethod)).remove(producerMethod);
  }
  if (bean instanceof ProducerField<?, ?>) {
    producerFields.remove(bean);
  }
}
origin: org.jboss.weld.se/weld-se

if (isSpecializing()) {
  boolean isNameDefined = getAnnotated().isAnnotationPresent(Named.class);
  String previousSpecializedBeanName = null;
  for (AbstractBean<?, ?> specializedBean : getSpecializedBeans()) {
    String name = specializedBean.getName();
    if (previousSpecializedBeanName != null && name != null && !previousSpecializedBeanName.equals(specializedBean.getName())) {
      throw BeanLogger.LOG.beansWithDifferentBeanNamesCannotBeSpecialized(previousSpecializedBeanName, specializedBean.getName(), this);
      throw BeanLogger.LOG.nameNotAllowedOnSpecialization(getAnnotated(), specializedBean.getAnnotated());
        && specializedBean.getBeanClass().getTypeParameters().length > 0
        && !(((AbstractClassBean<?>) this).getBeanClass().getGenericSuperclass() instanceof ParameterizedType));
    for (Type specializedType : specializedBean.getTypes()) {
      if (rawInsteadOfGeneric && specializedType instanceof ParameterizedType) {
        throw BeanLogger.LOG.specializingBeanMissingSpecializedType(this, specializedType, specializedBean);
      boolean contains = getTypes().contains(specializedType);
      if (!contains) {
        for (Type specializingType : getTypes()) {
origin: weld/core

public boolean isSpecializing() {
  return getAnnotated().isAnnotationPresent(Specializes.class);
}
origin: org.jboss.weld.se/weld-se

/**
 * Initializes the bean and its metadata
 */
@Override
public void internalInitialize(BeanDeployerEnvironment environment) {
  preInitialize();
  BeanLogger.LOG.creatingBean(getType());
  if (getScope() != null) {
    proxyRequired = isNormalScoped();
  } else {
    proxyRequired = false;
  }
  BeanLogger.LOG.qualifiersUsed(getQualifiers(), this);
  BeanLogger.LOG.usingName(getName(), this);
  BeanLogger.LOG.usingScope(getScope(), this);
}
origin: weld/core

  protected <T, S> boolean fireProcessBeanAttributes(AbstractBean<T, S> bean) {
    if (!specializationAndEnablementRegistry.isCandidateForLifecycleEvent(bean)) {
      return false;
    }

    ProcessBeanAttributesImpl<T> event = containerLifecycleEvents.fireProcessBeanAttributes(getManager(), bean, bean.getAnnotated(), bean.getType());
    if (event == null) {
      return false;
    }
    if (event.isVeto()) {
      return true;
    }
    if (event.isDirty()) {
      bean.setAttributes(ExternalBeanAttributesFactory.<T>of(event.getBeanAttributesInternal(), manager));
      bean.checkSpecialization();
    }
    if (event.isIgnoreFinalMethods()) {
      bean.setIgnoreFinalMethods();
    }
    return false;
  }
}
origin: weld/core

public void destroy(T instance, CreationalContext<T> creationalContext) {
  super.destroy(instance, creationalContext);
  try {
    getProducer().dispose(instance);
  } catch (Exception e) {
    BeanLogger.LOG.errorDestroying(instance, this);
    BeanLogger.LOG.catchingDebug(e);
  } finally {
    if (getDeclaringBean().isDependent()) {
      creationalContext.release();
    }
  }
}
origin: weld/core

protected Set<? extends AbstractBean<?, ?>> getSpecializedBeans() {
  return getBeanManager().getServices().get(SpecializationAndEnablementRegistry.class).resolveSpecializedBeans(this);
}
origin: org.jboss.weld.se/weld-se

public void addNewBeansFromInjectionPoints(AbstractBean<?, ?> bean) {
  addNewBeansFromInjectionPoints(bean.getInjectionPoints());
}
origin: weld/core

protected static <X> void fire(BeanManagerImpl beanManager, AbstractBean<X, ?> bean) {
  fire(beanManager, bean, bean.getAnnotated());
}
org.jboss.weld.beanAbstractBean

Javadoc

An abstract bean representation common for all beans

Most used methods

  • attributes
  • checkSpecialization
    Validates specialization if this bean specializes another bean.
  • checkType
  • destroy
  • getAnnotated
    Returns the annotated item the bean represents
  • getBeanClass
  • getBeanManager
  • getInjectionPoints
  • getName
  • getQualifiers
  • getScope
  • getSpecializedBeans
  • getScope,
  • getSpecializedBeans,
  • getType,
  • getTypes,
  • internalInitialize,
  • isNormalScoped,
  • isSpecializing,
  • postSpecialize,
  • preInitialize,
  • preSpecialize

Popular in Java

  • Making http post requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • addToBackStack (FragmentTransaction)
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • BlockingQueue (java.util.concurrent)
    A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
  • Collectors (java.util.stream)
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Table (org.hibernate.mapping)
    A relational table
  • Best plugins for Eclipse
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