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
  • DecoratorImpl
  • BootstrapLogger
  • Reflections
  • Interceptor
  • Validator
  • ValidatorLogger
  • AbstractBeanDeployer
  • BeanDeployerEnvironment
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
  • scheduleAtFixedRate (Timer)
  • requestLocationUpdates (LocationManager)
  • scheduleAtFixedRate (ScheduledExecutorService)
  • String (java.lang)
  • HttpURLConnection (java.net)
    An URLConnection for HTTP (RFC 2616 [http://tools.ietf.org/html/rfc2616]) used to send and receive d
  • Queue (java.util)
    A collection designed for holding elements prior to processing. Besides basic java.util.Collection o
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Table (org.hibernate.mapping)
    A relational table
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • 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