Codota Logo
BeanManager.isScope
Code IndexAdd Codota to your IDE (free)

How to use
isScope
method
in
javax.enterprise.inject.spi.BeanManager

Best Java code snippets using javax.enterprise.inject.spi.BeanManager.isScope (Showing top 20 results out of 315)

  • Common ways to obtain BeanManager
private void myMethod () {
BeanManager b =
  • Codota IconCDI.current().getBeanManager()
  • Codota IconBeanManagerProvider.getInstance().getBeanManager()
  • Codota IconWeldContainer container;container.getBeanManager()
  • Smart code suggestions by Codota
}
origin: resteasy/Resteasy

Annotation[] annotations = proxyType.getDeclaredAnnotations();
for(Annotation annotation : annotations) {
  if(beanManager.isScope(annotation.annotationType())) {
   possibleScopes.add(annotation);
origin: camunda/camunda-bpm-platform

protected Class< ? extends ScopedAssociation> getBroadestActiveContext() {
 for (Class< ? extends ScopedAssociation> scopeType : getAvailableScopedAssociationClasses()) {
  Annotation scopeAnnotation = scopeType.getAnnotations().length > 0 ? scopeType.getAnnotations()[0] : null;
  if (scopeAnnotation == null || !beanManager.isScope(scopeAnnotation.annotationType())) {
   throw new ProcessEngineException("ScopedAssociation must carry exactly one annotation and it must be a @Scope annotation");
  }
  try {
   beanManager.getContext(scopeAnnotation.annotationType());
   return scopeType;
  } catch (ContextNotActiveException e) {
   log.finest("Context " + scopeAnnotation.annotationType() + " not active.");
  }
 }
 throw new ProcessEngineException("Could not determine an active context to associate the current process instance / task instance with.");
}
origin: resteasy/Resteasy

  /**
  * Find out if a given class is explicitly bound to a scope.
  *
  * @param clazz class
  * @param manager bean manager
  * @return <code>true</code> if a given class is annotated with a scope
  *         annotation or with a stereotype which (transitively) declares a
  *         scope
  */
  private static boolean isScopeDefined(Class<?> clazz, BeanManager manager)
  {
   for (Annotation annotation : clazz.getAnnotations())
   {
     if (manager.isScope(annotation.annotationType()))
     {
      return true;
     }
     if (manager.isStereotype(annotation.annotationType()))
     {
      if (isScopeDefined(annotation.annotationType(), manager))
      {
        return true;
      }
     }
   }
   return false;
  }
}
origin: resteasy/Resteasy

/**
* Find out if a given annotated type is explicitly bound to a scope.
*
* @param annotatedType annotated type
* @param manager bean manager
* @return true if and only if a given annotated type is annotated with a scope
*         annotation or with a stereotype which (transitively) declares a
*         scope
*/
public static boolean isScopeDefined(AnnotatedType<?> annotatedType, BeanManager manager)
{
 for (Annotation annotation : annotatedType.getAnnotations())
 {
   if (manager.isScope(annotation.annotationType()))
   {
    return true;
   }
   if (manager.isStereotype(annotation.annotationType()))
   {
    if (isScopeDefined(annotation.annotationType(), manager))
    {
      return true;
    }
   }
 }
 return false;
}
origin: org.apache.openwebbeans.arquillian/owb-arquillian-standalone

protected boolean isBeanDefiningAnnotation(Annotation annotation)
{
  Class<? extends Annotation> annotationType = annotation.annotationType();
  boolean isBeanAnnotation = beanManager.isScope(annotationType);
  isBeanAnnotation = isBeanAnnotation || beanManager.isStereotype(annotationType);
  return isBeanAnnotation;
}
origin: org.jboss.weld.se/weld-se

@Override
public boolean isScope(Class<? extends Annotation> annotationType) {
  return delegate().isScope(annotationType);
}
origin: org.jboss.weld.se/weld-se-shaded

@Override
public boolean isScope(Class<? extends Annotation> annotationType) {
  return delegate().isScope(annotationType);
}
origin: weld/core

@Override
public boolean isScope(Class<? extends Annotation> annotationType) {
  return delegate().isScope(annotationType);
}
origin: weld/core

@Override
public boolean isScope(Class<? extends Annotation> annotationType) {
  return delegate().isScope(annotationType);
}
origin: weld/core

@Override
public boolean isScope(Class<? extends Annotation> annotationType) {
  return delegate().isScope(annotationType);
}
origin: org.jboss.cdi.tck/cdi-tck-impl

@Test
@SpecAssertion(section = BM_DETERMINING_ANNOTATION, id = "ab")
public void testDetermineScope() {
  assertTrue(getCurrentManager().isScope(ApplicationScoped.class));
  assertTrue(getCurrentManager().isScope(DummyScoped.class));
  assertFalse(getCurrentManager().isScope(Tame.class));
  assertFalse(getCurrentManager().isScope(AnimalStereotype.class));
  assertFalse(getCurrentManager().isScope(Transactional.class));
}
origin: org.jboss.jsr299.tck/jsr299-tck-impl

@Test(groups="rewrite")
// Should also check a custom scope
@SpecAssertion(section = "11.3.13", id = "ab")
public void testDetermineScopeType()
{
 assert getCurrentManager().isScope(ApplicationScoped.class);
 assert !getCurrentManager().isScope(Tame.class);
 assert !getCurrentManager().isScope(AnimalStereotype.class);
 assert !getCurrentManager().isScope(Transactional.class);
}
origin: org.jboss.weld/weld-junit5

<T> void rewriteTestClassScope(@Observes ProcessAnnotatedType<T> pat, BeanManager beanManager) {
  AnnotatedType<T> annotatedType = pat.getAnnotatedType();
  if (annotatedType.getJavaClass().equals(testClass)) {
    // Replace any test class's scope with @Singleton
    Set<Annotation> annotations = annotatedType.getAnnotations().stream()
        .filter(annotation -> beanManager.isScope(annotation.annotationType()))
        .collect(Collectors.toSet());
    annotations.add(SINGLETON_LITERAL);
    pat.setAnnotatedType(new AnnotationRewritingAnnotatedType<>(annotatedType, annotations));
  }
}
origin: weld/weld-junit

<T> void rewriteTestClassScope(@Observes ProcessAnnotatedType<T> pat, BeanManager beanManager) {
  AnnotatedType<T> annotatedType = pat.getAnnotatedType();
  if (annotatedType.getJavaClass().equals(testClass)) {
    // Replace any test class's scope with @Singleton
    Set<Annotation> annotations = annotatedType.getAnnotations().stream()
        .filter(annotation -> beanManager.isScope(annotation.annotationType()))
        .collect(Collectors.toSet());
    annotations.add(SINGLETON_LITERAL);
    pat.setAnnotatedType(new AnnotationRewritingAnnotatedType<>(annotatedType, annotations));
  }
}
origin: org.jboss.weld.se/weld-se

public static void validateScope(BeanAttributes<?> attributes, BeanManager manager) {
  if(attributes.getScope() == null) {
    throw MetadataLogger.LOG.scopeNull(attributes);
  }
  if (!manager.isScope(attributes.getScope())) {
    throw MetadataLogger.LOG.notAScope(attributes.getScope(), attributes);
  }
}
origin: weld/core

public static void validateScope(BeanAttributes<?> attributes, BeanManager manager) {
  if(attributes.getScope() == null) {
    throw MetadataLogger.LOG.scopeNull(attributes);
  }
  if (!manager.isScope(attributes.getScope())) {
    throw MetadataLogger.LOG.notAScope(attributes.getScope(), attributes);
  }
}
origin: org.jboss.weld.se/weld-se-shaded

public static void validateScope(BeanAttributes<?> attributes, BeanManager manager) {
  if(attributes.getScope() == null) {
    throw MetadataLogger.LOG.scopeNull(attributes);
  }
  if (!manager.isScope(attributes.getScope())) {
    throw MetadataLogger.LOG.notAScope(attributes.getScope(), attributes);
  }
}
origin: org.jboss.weld.servlet/weld-servlet-shaded

public static void validateScope(BeanAttributes<?> attributes, BeanManager manager) {
  if(attributes.getScope() == null) {
    throw MetadataLogger.LOG.scopeNull(attributes);
  }
  if (!manager.isScope(attributes.getScope())) {
    throw MetadataLogger.LOG.notAScope(attributes.getScope(), attributes);
  }
}
origin: weld/core

public static void validateScope(BeanAttributes<?> attributes, BeanManager manager) {
  if(attributes.getScope() == null) {
    throw MetadataLogger.LOG.scopeNull(attributes);
  }
  if (!manager.isScope(attributes.getScope())) {
    throw MetadataLogger.LOG.notAScope(attributes.getScope(), attributes);
  }
}
origin: weld/core

public static void validateScope(BeanAttributes<?> attributes, BeanManager manager) {
  if(attributes.getScope() == null) {
    throw MetadataLogger.LOG.scopeNull(attributes);
  }
  if (!manager.isScope(attributes.getScope())) {
    throw MetadataLogger.LOG.notAScope(attributes.getScope(), attributes);
  }
}
javax.enterprise.inject.spiBeanManagerisScope

Javadoc

Test the given annotation type to determine if it is a javax.enterprise.context.

Popular methods of BeanManager

  • createCreationalContext
    Obtain an instance of a javax.enterprise.context.spi.CreationalContext for the given javax.enterpris
  • getBeans
    Return the set of beans which have the given required type and qualifiers and are available for inje
  • getReference
    Obtains a contextual reference for a certain Bean and a certain bean type of the bean.
  • resolve
    Apply the ambiguous dependency resolution rules to a set of Bean. Note that when called during invoc
  • createAnnotatedType
    Obtain an AnnotatedType that may be used to read the annotations of the given class or interface.
  • createInjectionTarget
    Obtains an InjectionTarget for the given AnnotatedType. The container ignores the annotations and t
  • fireEvent
    Fire an event and notify observers. This method is deprecated from CDI 2.0 and #getEvent()) should b
  • getContext
    Obtains an active javax.enterprise.context.spi.Context for the given javax.enterprise.context .
  • isNormalScope
    Test the given annotation type to determine if it is a javax.enterprise.context.
  • isQualifier
    Test the given annotation type to determine if it is a javax.inject.Qualifier.
  • isStereotype
    Test the given annotation type to determine if it is a javax.enterprise.inject.Stereotype.
  • getInjectableReference
    Obtains an injectable reference for a certain InjectionPoint.
  • isStereotype,
  • getInjectableReference,
  • getELResolver,
  • getPassivationCapableBean,
  • getInjectionTargetFactory,
  • getStereotypeDefinition,
  • wrapExpressionFactory,
  • getExtension,
  • isInterceptorBinding

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSystemService (Context)
  • getSharedPreferences (Context)
  • setRequestProperty (URLConnection)
    Sets the general request property. If a property with the key already exists, overwrite its value wi
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Kernel (java.awt.image)
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • Response (javax.ws.rs.core)
    Defines the contract between a returned instance and the runtime when an application needs to provid
  • IsNull (org.hamcrest.core)
    Is the value null?
  • DateTimeFormat (org.joda.time.format)
    Factory that creates instances of DateTimeFormatter from patterns and styles. Datetime formatting i
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now