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

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

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

Refine searchRefine arrow

  • BeanManagerImpl
  • Interceptor
  • ValidatorLogger
  • Validator
  • DecoratorImpl
  • BootstrapLogger
  • Reflections
origin: org.jboss.weld.se/weld-se

public static <T> InterceptorImpl<T> of(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) {
  return new InterceptorImpl<T>(attributes, type, beanManager);
}
origin: org.jboss.weld.se/weld-se

@Override
public void initializeAfterBeanDiscovery() {
  super.initializeAfterBeanDiscovery();
  checkInterceptorBindings();
}
origin: weld/core

@SuppressWarnings("unchecked")
private InterceptorClassMetadata<T> initInterceptorMetadata() {
  CdiInterceptorFactory<T> reference = new CdiInterceptorFactory<T>(this);
  return new InterceptorMetadataImpl<T>((Class<T>) getBeanClass(), reference, InterceptorMetadataUtils.buildMethodMap(getEnhancedAnnotated(), false,
      getBeanManager()));
}
origin: weld/core

  @Override
  public String toString() {
    return "Interceptor [" + getBeanClass() + " intercepts " + Formats.formatAnnotations(getInterceptorBindings()) + "]";
  }
}
origin: org.jboss.weld.se/weld-se

public void endInitialization() {
  tracker.start(Tracker.OP_END_INIT);
  final BeanIdentifierIndex index = deploymentManager.getServices().get(BeanIdentifierIndex.class);
  if (index != null) {
  deploymentManager.getServices().cleanupAfterBoot();
  deploymentManager.cleanupAfterBoot();
  for (BeanDeployment beanDeployment : getBeanDeployments()) {
    BeanManagerImpl beanManager = beanDeployment.getBeanManager();
    for (Decorator<?> decorator : beanManager.getDecorators()) {
      if (decorator instanceof DecoratorImpl<?>) {
        Reflections.<DecoratorImpl<?>>cast(decorator).cleanupAfterBoot();
    for (Interceptor<?> interceptor : beanManager.getInterceptors()) {
      if (interceptor instanceof InterceptorImpl<?>) {
        Reflections.<InterceptorImpl<?>>cast(interceptor).cleanupAfterBoot();
  if (modules != null) {
    modules.processBeanDeployments(getBeanDeployments());
    BootstrapLogger.LOG.debugv("EE modules: {0}", modules);
origin: org.jboss.weld.se/weld-se

private void validateInterceptors(BeanManagerImpl beanManager, AbstractClassBean<?> classBean) {
  InterceptionModel interceptionModel = beanManager.getInterceptorModelRegistry().get(classBean.getAnnotated());
  if (interceptionModel != null) {
    Set<? extends InterceptorClassMetadata<?>> interceptors = interceptionModel.getAllInterceptors();
    if (interceptors.size() > 0) {
      boolean passivationCapabilityCheckRequired = beanManager.isPassivatingScope(classBean.getScope());
      for (InterceptorClassMetadata<?> interceptorMetadata : interceptors) {
          Interceptor<?> interceptor = cdiInterceptorFactory.getInterceptor();
          boolean isSerializable = (interceptor instanceof InterceptorImpl) ? ((InterceptorImpl<?>) interceptor).isSerializable() : Beans.isPassivationCapableDependency(interceptor);
          if (!isSerializable) {
            throw ValidatorLogger.LOG.passivatingBeanWithNonserializableInterceptor(classBean, interceptor);
            beanManager = ((InterceptorImpl<?>) interceptor).getBeanManager();
          for (InjectionPoint injectionPoint : interceptor.getInjectionPoints()) {
            Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(injectionPoint));
            validateInterceptorDecoratorInjectionPointPassivationCapable(injectionPoint, resolvedBean, beanManager, classBean);
          PlainInterceptorFactory<?> factory = (PlainInterceptorFactory<?>) interceptorMetadata.getInterceptorFactory();
          Class<?> interceptorClass = interceptorMetadata.getJavaClass();
          if (passivationCapabilityCheckRequired && !Reflections.isSerializable(interceptorClass)) {
            throw ValidatorLogger.LOG.passivatingBeanWithNonserializableInterceptor(this, interceptorClass.getName());
            validateInjectionPoint(injectionPoint, beanManager);
            if (passivationCapabilityCheckRequired) {
              Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(injectionPoint));
              validateInterceptorDecoratorInjectionPointPassivationCapable(injectionPoint, resolvedBean, beanManager, classBean);
origin: org.jboss.weld.se/weld-se

protected void validateInterceptor(Interceptor<?> interceptor, BeanManagerImpl manager) {
  if (interceptor instanceof InterceptorImpl<?>) {
    EnhancedAnnotatedType<?> annotated = ((InterceptorImpl<?>) interceptor).getEnhancedAnnotated();
    if (!BeanMethods.getObserverMethods(annotated).isEmpty()) {
      throw ValidatorLogger.LOG.interceptorsCannotHaveObserverMethods(interceptor);
    }
    if (!interceptor.getScope().equals(Dependent.class)) {
      throw ValidatorLogger.LOG.interceptorOrDecoratorMustBeDependent(interceptor);
    }
    while (annotated != null && annotated.getJavaClass() != Object.class) {
      if (!annotated.getDeclaredEnhancedMethods(Produces.class).isEmpty()) {
        throw ValidatorLogger.LOG.interceptorsCannotHaveProducerMethods(interceptor);
      }
      if (!annotated.getDeclaredEnhancedFields(Produces.class).isEmpty()) {
        throw ValidatorLogger.LOG.interceptorsCannotHaveProducerFields(interceptor);
      }
      if (!annotated.getDeclaredEnhancedMethodsWithAnnotatedParameters(Disposes.class).isEmpty()) {
        throw ValidatorLogger.LOG.interceptorsCannotHaveDisposerMethods(interceptor);
      }
      annotated = annotated.getEnhancedSuperclass();
    }
  }
  for (InjectionPoint injectionPoint : interceptor.getInjectionPoints()) {
    validateInjectionPoint(injectionPoint, manager);
  }
}
origin: weld/core

protected InterceptorImpl(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) {
  super(attributes, type, new StringBeanIdentifier(forInterceptor(type)), beanManager);
  this.interceptorMetadata = initInterceptorMetadata();
  this.serializable = type.isSerializable();
  this.interceptorBindingTypes = Interceptors.mergeBeanInterceptorBindings(beanManager, getEnhancedAnnotated(), getStereotypes()).uniqueValues();
}
origin: org.jboss.weld.se/weld-se

protected InterceptorImpl(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) {
  super(attributes, type, new StringBeanIdentifier(forInterceptor(type)), beanManager);
  this.interceptorMetadata = initInterceptorMetadata();
  this.serializable = type.isSerializable();
  this.interceptorBindingTypes = Collections.unmodifiableSet(new HashSet<Annotation>(Interceptors.mergeBeanInterceptorBindings(beanManager, getEnhancedAnnotated(), getStereotypes()).values()));
  if (Beans.findInterceptorBindingConflicts(beanManager, interceptorBindingTypes)) {
    throw new DeploymentException(BeanLogger.LOG.conflictingInterceptorBindings(getType()));
  }
}
origin: org.jboss.weld.se/weld-se

public <T> InterceptorClassMetadata<T> getCdiInterceptorMetadata(Interceptor<T> interceptor) {
  if (interceptor instanceof InterceptorImpl) {
    InterceptorImpl<T> interceptorImpl = (InterceptorImpl<T>) interceptor;
    return interceptorImpl.getInterceptorMetadata();
  }
  return cdiInterceptorMetadataCache.getCastValue(interceptor);
}
origin: weld/core

private void checkInterceptorBindings() {
  if (interceptorMetadata.isEligible(org.jboss.weld.interceptor.spi.model.InterceptionType.POST_CONSTRUCT)
      || interceptorMetadata.isEligible(org.jboss.weld.interceptor.spi.model.InterceptionType.PRE_DESTROY)
      || interceptorMetadata.isEligible(org.jboss.weld.interceptor.spi.model.InterceptionType.POST_ACTIVATE)
      || interceptorMetadata.isEligible(org.jboss.weld.interceptor.spi.model.InterceptionType.PRE_PASSIVATE)) {
    for (Annotation interceptorBindingType : interceptorBindingTypes) {
      Target target = interceptorBindingType.annotationType().getAnnotation(Target.class);
      if (target == null || hasInvalidTargetType(target.value())) {
        ReflectionLogger.LOG.lifecycleCallbackInterceptorWithInvalidBindingTarget(this, interceptorBindingType.annotationType().getName(),
            target != null ? Arrays.toString(target.value()) : "Target meta-annotation is not present");
      }
    }
  }
}
origin: weld/core

public void endInitialization() {
  tracker.start(Tracker.OP_END_INIT);
  final BeanIdentifierIndex index = deploymentManager.getServices().get(BeanIdentifierIndex.class);
  if (index != null) {
  deploymentManager.getServices().cleanupAfterBoot();
  deploymentManager.cleanupAfterBoot();
  for (BeanDeployment beanDeployment : getBeanDeployments()) {
    BeanManagerImpl beanManager = beanDeployment.getBeanManager();
    for (Decorator<?> decorator : beanManager.getDecorators()) {
      if (decorator instanceof DecoratorImpl<?>) {
        Reflections.<DecoratorImpl<?>>cast(decorator).cleanupAfterBoot();
    for (Interceptor<?> interceptor : beanManager.getInterceptors()) {
      if (interceptor instanceof InterceptorImpl<?>) {
        Reflections.<InterceptorImpl<?>>cast(interceptor).cleanupAfterBoot();
  if (modules != null) {
    modules.processBeanDeployments(getBeanDeployments());
    BootstrapLogger.LOG.debugv("EE modules: {0}", modules);
      beanDeployment.getBeanManager().getBeanResolver().clear();
    deploymentManager.getServices().get(Validator.class).clearResolved();
    deploymentManager.getServices().get(ClassTransformer.class).cleanupAfterBoot();
origin: weld/core

private void validateInterceptors(BeanManagerImpl beanManager, AbstractClassBean<?> classBean) {
  InterceptionModel interceptionModel = beanManager.getInterceptorModelRegistry().get(classBean.getAnnotated());
  if (interceptionModel != null) {
    Set<? extends InterceptorClassMetadata<?>> interceptors = interceptionModel.getAllInterceptors();
    if (interceptors.size() > 0) {
      boolean passivationCapabilityCheckRequired = beanManager.isPassivatingScope(classBean.getScope());
      for (InterceptorClassMetadata<?> interceptorMetadata : interceptors) {
          Interceptor<?> interceptor = cdiInterceptorFactory.getInterceptor();
          boolean isSerializable = (interceptor instanceof InterceptorImpl) ? ((InterceptorImpl<?>) interceptor).isSerializable() : Beans.isPassivationCapableDependency(interceptor);
          if (!isSerializable) {
            throw ValidatorLogger.LOG.passivatingBeanWithNonserializableInterceptor(classBean, interceptor);
            beanManager = ((InterceptorImpl<?>) interceptor).getBeanManager();
          for (InjectionPoint injectionPoint : interceptor.getInjectionPoints()) {
            Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(injectionPoint));
            validateInterceptorDecoratorInjectionPointPassivationCapable(injectionPoint, resolvedBean, beanManager, classBean);
          PlainInterceptorFactory<?> factory = (PlainInterceptorFactory<?>) interceptorMetadata.getInterceptorFactory();
          Class<?> interceptorClass = interceptorMetadata.getJavaClass();
          if (passivationCapabilityCheckRequired && !Reflections.isSerializable(interceptorClass)) {
            throw ValidatorLogger.LOG.passivatingBeanWithNonserializableInterceptor(this, interceptorClass.getName());
            validateInjectionPoint(injectionPoint, beanManager);
            if (passivationCapabilityCheckRequired) {
              Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(injectionPoint));
              validateInterceptorDecoratorInjectionPointPassivationCapable(injectionPoint, resolvedBean, beanManager, classBean);
origin: weld/core

protected void validateInterceptor(Interceptor<?> interceptor, BeanManagerImpl manager) {
  if (interceptor instanceof InterceptorImpl<?>) {
    EnhancedAnnotatedType<?> annotated = ((InterceptorImpl<?>) interceptor).getEnhancedAnnotated();
    if (!BeanMethods.getObserverMethods(annotated).isEmpty() || !BeanMethods.getAsyncObserverMethods(annotated).isEmpty()) {
      throw ValidatorLogger.LOG.interceptorsCannotHaveObserverMethods(interceptor);
    }
    if (!interceptor.getScope().equals(Dependent.class)) {
      throw ValidatorLogger.LOG.interceptorOrDecoratorMustBeDependent(interceptor);
    }
    while (annotated != null && annotated.getJavaClass() != Object.class) {
      if (!annotated.getDeclaredEnhancedMethods(Produces.class).isEmpty()) {
        throw ValidatorLogger.LOG.interceptorsCannotHaveProducerMethods(interceptor);
      }
      if (!annotated.getDeclaredEnhancedFields(Produces.class).isEmpty()) {
        throw ValidatorLogger.LOG.interceptorsCannotHaveProducerFields(interceptor);
      }
      if (!annotated.getDeclaredEnhancedMethodsWithAnnotatedParameters(Disposes.class).isEmpty()) {
        throw ValidatorLogger.LOG.interceptorsCannotHaveDisposerMethods(interceptor);
      }
      annotated = annotated.getEnhancedSuperclass();
    }
  }
  for (InjectionPoint injectionPoint : interceptor.getInjectionPoints()) {
    validateInjectionPoint(injectionPoint, manager);
  }
}
origin: weld/core

protected InterceptorImpl(BeanAttributes<T> attributes, EnhancedAnnotatedType<T> type, BeanManagerImpl beanManager) {
  super(attributes, type, new StringBeanIdentifier(forInterceptor(type)), beanManager);
  this.interceptorMetadata = initInterceptorMetadata();
  this.serializable = type.isSerializable();
  this.interceptorBindingTypes = Interceptors.mergeBeanInterceptorBindings(beanManager, getEnhancedAnnotated(), getStereotypes()).uniqueValues();
}
origin: weld/core

  @Override
  public String toString() {
    return "Interceptor [" + getBeanClass() + " intercepts " + Formats.formatAnnotations(getInterceptorBindings()) + "]";
  }
}
origin: weld/core

public <T> InterceptorClassMetadata<T> getCdiInterceptorMetadata(Interceptor<T> interceptor) {
  if (interceptor instanceof InterceptorImpl) {
    InterceptorImpl<T> interceptorImpl = (InterceptorImpl<T>) interceptor;
    return interceptorImpl.getInterceptorMetadata();
  }
  return cdiInterceptorMetadataCache.getCastValue(interceptor);
}
origin: weld/core

private void checkInterceptorBindings() {
  if (interceptorMetadata.isEligible(org.jboss.weld.interceptor.spi.model.InterceptionType.POST_CONSTRUCT)
      || interceptorMetadata.isEligible(org.jboss.weld.interceptor.spi.model.InterceptionType.PRE_DESTROY)
      || interceptorMetadata.isEligible(org.jboss.weld.interceptor.spi.model.InterceptionType.POST_ACTIVATE)
      || interceptorMetadata.isEligible(org.jboss.weld.interceptor.spi.model.InterceptionType.PRE_PASSIVATE)) {
    for (Annotation interceptorBindingType : interceptorBindingTypes) {
      Target target = interceptorBindingType.annotationType().getAnnotation(Target.class);
      if (target == null || hasInvalidTargetType(target.value())) {
        ReflectionLogger.LOG.lifecycleCallbackInterceptorWithInvalidBindingTarget(this, interceptorBindingType.annotationType().getName(),
            target != null ? Arrays.toString(target.value()) : "Target meta-annotation is not present");
      }
    }
  }
}
origin: weld/core

public void endInitialization() {
  tracker.start(Tracker.OP_END_INIT);
  final BeanIdentifierIndex index = deploymentManager.getServices().get(BeanIdentifierIndex.class);
  if (index != null) {
  deploymentManager.getServices().cleanupAfterBoot();
  deploymentManager.cleanupAfterBoot();
  for (BeanDeployment beanDeployment : getBeanDeployments()) {
    BeanManagerImpl beanManager = beanDeployment.getBeanManager();
    for (Decorator<?> decorator : beanManager.getDecorators()) {
      if (decorator instanceof DecoratorImpl<?>) {
        Reflections.<DecoratorImpl<?>>cast(decorator).cleanupAfterBoot();
    for (Interceptor<?> interceptor : beanManager.getInterceptors()) {
      if (interceptor instanceof InterceptorImpl<?>) {
        Reflections.<InterceptorImpl<?>>cast(interceptor).cleanupAfterBoot();
  if (modules != null) {
    modules.processBeanDeployments(getBeanDeployments());
    BootstrapLogger.LOG.debugv("EE modules: {0}", modules);
      beanDeployment.getBeanManager().getBeanResolver().clear();
    deploymentManager.getServices().get(Validator.class).clearResolved();
    deploymentManager.getServices().get(ClassTransformer.class).cleanupAfterBoot();
origin: weld/core

private void validateInterceptors(BeanManagerImpl beanManager, AbstractClassBean<?> classBean) {
  InterceptionModel interceptionModel = beanManager.getInterceptorModelRegistry().get(classBean.getAnnotated());
  if (interceptionModel != null) {
    Set<? extends InterceptorClassMetadata<?>> interceptors = interceptionModel.getAllInterceptors();
    if (interceptors.size() > 0) {
      boolean passivationCapabilityCheckRequired = beanManager.isPassivatingScope(classBean.getScope());
      for (InterceptorClassMetadata<?> interceptorMetadata : interceptors) {
          Interceptor<?> interceptor = cdiInterceptorFactory.getInterceptor();
          boolean isSerializable = (interceptor instanceof InterceptorImpl) ? ((InterceptorImpl<?>) interceptor).isSerializable() : Beans.isPassivationCapableDependency(interceptor);
          if (!isSerializable) {
            throw ValidatorLogger.LOG.passivatingBeanWithNonserializableInterceptor(classBean, interceptor);
            beanManager = ((InterceptorImpl<?>) interceptor).getBeanManager();
          for (InjectionPoint injectionPoint : interceptor.getInjectionPoints()) {
            Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(injectionPoint));
            validateInterceptorDecoratorInjectionPointPassivationCapable(injectionPoint, resolvedBean, beanManager, classBean);
          PlainInterceptorFactory<?> factory = (PlainInterceptorFactory<?>) interceptorMetadata.getInterceptorFactory();
          Class<?> interceptorClass = interceptorMetadata.getJavaClass();
          if (passivationCapabilityCheckRequired && !Reflections.isSerializable(interceptorClass)) {
            throw ValidatorLogger.LOG.passivatingBeanWithNonserializableInterceptor(this, interceptorClass.getName());
            validateInjectionPoint(injectionPoint, beanManager);
            if (passivationCapabilityCheckRequired) {
              Bean<?> resolvedBean = beanManager.resolve(beanManager.getBeans(injectionPoint));
              validateInterceptorDecoratorInjectionPointPassivationCapable(injectionPoint, resolvedBean, beanManager, classBean);
org.jboss.weld.beanInterceptorImpl

Most used methods

  • <init>
  • checkInterceptorBindings
  • cleanupAfterBoot
  • getBeanClass
  • getBeanManager
  • getEnhancedAnnotated
  • getInterceptorBindings
  • getInterceptorMetadata
  • getStereotypes
  • hasInvalidTargetType
  • initInterceptorMetadata
  • initialize
  • initInterceptorMetadata,
  • initialize,
  • isSerializable,
  • of,
  • getType

Popular in Java

  • Start an intent from android
  • notifyDataSetChanged (ArrayAdapter)
  • setScale (BigDecimal)
  • setContentView (Activity)
  • Kernel (java.awt.image)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • GregorianCalendar (java.util)
    GregorianCalendar is a concrete subclass of Calendarand provides the standard calendar used by most
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • 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